HPC-Quantize-V2 / __init__.py
CompressedGemma's picture
Upload 6 files
279a216 verified
Raw History Blame Contribute Delete
2.26 kB
"""HPC-Quantize V2: factored Q2_K quantization in Python.
The package keeps the full HPC decision stack (batched GGML seeds, WLS
superblock solve, factored candidate field, sequential Sieve, 36-state
Viterbi, spectral/DC shaping, local-safety floors) while replacing the
original factored solver with a monotone, multi-start, fp16-exact version.
"""
from .analog import (
build_block_analogs,
subblock_isomoment_analog,
subscale_lattice_analog,
vesica_gram_analog,
)
from .config import HPCConfig
from .cuda_backend import cuda_device_name, cuda_is_available, quantize_cuda
from .factored import (
FactorResult,
factor_1d,
factor_candidates,
factor_only_solve,
factor_q2k_block,
)
from .gguf import (
GGUFReader,
expand_importance,
is_q1_0_eligible,
is_q2k_eligible,
is_q3_k_eligible,
is_q4_0_eligible,
lookup_imatrix,
read_imatrix,
target_quant_type,
)
from .pipeline import Q2KQuantizer, QuantizedTensor, TensorStats
from .q1_0 import Q1_0_BLOCK_BYTES, QK1_0, dequantize_q1_0_bytes, quantize_tensor_q1_0
from .q2k import Q2KBlock, QK_K, dequantize_params, pack_codes, unpack_codes
from .q3_k import Q3_K_BLOCK_BYTES, QK3_K, dequantize_q3_k_bytes, quantize_tensor_q3_k
from .q4_0 import QK4_0, dequantize_q4_0_bytes, quantize_tensor_q4_0
__all__ = [
"HPCConfig",
"cuda_device_name",
"cuda_is_available",
"quantize_cuda",
"FactorResult",
"Q2KBlock",
"Q2KQuantizer",
"QuantizedTensor",
"TensorStats",
"QK_K",
"build_block_analogs",
"subblock_isomoment_analog",
"subscale_lattice_analog",
"vesica_gram_analog",
"dequantize_params",
"factor_1d",
"factor_candidates",
"factor_only_solve",
"factor_q2k_block",
"GGUFReader",
"expand_importance",
"is_q1_0_eligible",
"is_q2k_eligible",
"is_q3_k_eligible",
"is_q4_0_eligible",
"lookup_imatrix",
"read_imatrix",
"target_quant_type",
"QK1_0",
"Q1_0_BLOCK_BYTES",
"dequantize_q1_0_bytes",
"quantize_tensor_q1_0",
"QK3_K",
"Q3_K_BLOCK_BYTES",
"dequantize_q3_k_bytes",
"quantize_tensor_q3_k",
"QK4_0",
"dequantize_q4_0_bytes",
"quantize_tensor_q4_0",
"pack_codes",
"unpack_codes",
]