ykhrustalev commited on
Commit
3b85522
Β·
verified Β·
1 Parent(s): 78295c3

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +14 -6
README.md CHANGED
@@ -38,12 +38,19 @@ ONNX export of [LFM2.5-350M](https://huggingface.co/LiquidAI/LFM2.5-350M) for cr
38
  | Variant | Size | Description |
39
  |---------|------|-------------|
40
  | FP16 | ~692MB | All weights in FP16 |
41
- | Q4 | ~298MB | INT4 MatMul weights (including lm_head), FP16 embeddings and norms |
42
- | Q4F16 | ~298MB | INT4 MatMul weights, FP16 lm_head/embeddings and norms |
 
43
 
44
- Q4 and Q4F16 use symmetric block-wise quantization (block_size=32) via MatMulNBits.
45
- The difference is that Q4 also quantizes the lm_head projection to INT4, while Q4F16
46
- keeps it in FP16. Both store the token embedding (Gather) and normalization weights in FP16.
 
 
 
 
 
 
47
 
48
  ## Model Files
49
 
@@ -52,7 +59,8 @@ onnx/
52
  β”œβ”€β”€ model.onnx # FP32
53
  β”œβ”€β”€ model_fp16.onnx # FP16
54
  β”œβ”€β”€ model_q4.onnx # Q4
55
- └── model_q4f16.onnx # Q4F16
 
56
  ```
57
 
58
  ## Python
 
38
  | Variant | Size | Description |
39
  |---------|------|-------------|
40
  | FP16 | ~692MB | All weights in FP16 |
41
+ | Q4 | ~276MB | INT4 embedding (GatherBlockQuantized), INT4 lm_head (MatMulNBits, shared), INT4 MatMul weights |
42
+ | Q4F32 | ~459MB | INT4 MatMul weights, FP32 embedding and norms |
43
+ | Q8 | ~604MB | INT8 MatMul weights, FP32 embedding and norms |
44
 
45
+ Q4 uses GatherBlockQuantized for the token embedding and MatMulNBits for the lm_head,
46
+ reusing the same quantized weights and scales. All other linear layers are quantized to
47
+ INT4 via post-export MatMulNBitsQuantizer. Block size is 32.
48
+
49
+ Q4F32 keeps the embedding as a FP32 Gather and the lm_head as FP32 Transpose + MatMul.
50
+ Only the internal linear layers (attention projections, conv projections, MLP) are
51
+ quantized to INT4 via post-export MatMulNBitsQuantizer.
52
+
53
+ Q8 is the same structure as Q4F32 but with INT8 weights (asymmetric quantization).
54
 
55
  ## Model Files
56
 
 
59
  β”œβ”€β”€ model.onnx # FP32
60
  β”œβ”€β”€ model_fp16.onnx # FP16
61
  β”œβ”€β”€ model_q4.onnx # Q4
62
+ β”œβ”€β”€ model_q4f32.onnx # Q4F32
63
+ └── model_q8.onnx # Q8
64
  ```
65
 
66
  ## Python