File size: 2,259 Bytes
1c35eef
 
 
 
 
 
 
 
56eff0f
 
 
 
 
 
1c35eef
de7e562
1c35eef
 
 
 
 
 
 
b8c96a1
 
 
dc0a265
b8c96a1
279a216
b8c96a1
 
 
 
 
1c35eef
dc0a265
1c35eef
279a216
b8c96a1
1c35eef
 
 
de7e562
 
 
1c35eef
 
 
 
 
 
56eff0f
 
 
 
1c35eef
 
 
 
 
4de4d5a
 
dc0a265
b8c96a1
279a216
b8c96a1
4de4d5a
 
b8c96a1
dc0a265
 
 
 
279a216
 
 
 
b8c96a1
 
 
1c35eef
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
"""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",
]