Quantize and tie q4f16 input embedding

#1
by nico-martin HF Staff - opened
README.md CHANGED
@@ -56,14 +56,14 @@ Find more details in the original model card: https://huggingface.co/LiquidAI/LF
56
  | Precision | Size | Platform | Use Case |
57
  |-----------|-------|-----------------|----------|
58
  | Q4 | ~1.9 GB | WebGPU, Server | Recommended for most uses (quantized embedding) |
59
- | Q4F16 | ~2.1 GB | WebGPU | Optimized q4 weights with FP16 runtime and caches |
60
  | FP16 | ~2.1 GB | WebGPU, Server | Higher quality |
61
  | Q8 | ~2.1 GB | Server only | Balance of quality and size |
62
 
63
  - **WebGPU**: Use `Q4`, `Q4F16`, or `FP16` (`Q8` is not supported on WebGPU).
64
  - **Server (CPU/GPU)**: All variants supported.
65
 
66
- Q4 uses a quantized input embedding. Q4F16 keeps the input embedding in FP16 while quantizing the LM head and decoder linear weights to q4.
67
 
68
  ## Model Files
69
 
@@ -72,7 +72,7 @@ onnx/
72
  β”œβ”€β”€ model.onnx # FP32
73
  β”œβ”€β”€ model_fp16.onnx # FP16
74
  β”œβ”€β”€ model_q4.onnx # Q4, quantized embedding (WebGPU)
75
- β”œβ”€β”€ model_q4f16.onnx # Q4 weights, FP16 runtime and caches (WebGPU)
76
  └── model_q8.onnx # Q8
77
  ```
78
 
 
56
  | Precision | Size | Platform | Use Case |
57
  |-----------|-------|-----------------|----------|
58
  | Q4 | ~1.9 GB | WebGPU, Server | Recommended for most uses (quantized embedding) |
59
+ | Q4F16 | ~1.5 GB | WebGPU | Quantized embedding and q4 weights with FP16 runtime and caches |
60
  | FP16 | ~2.1 GB | WebGPU, Server | Higher quality |
61
  | Q8 | ~2.1 GB | Server only | Balance of quality and size |
62
 
63
  - **WebGPU**: Use `Q4`, `Q4F16`, or `FP16` (`Q8` is not supported on WebGPU).
64
  - **Server (CPU/GPU)**: All variants supported.
65
 
66
+ Q4 and Q4F16 use a quantized input embedding. Q4F16 uses FP16 runtime tensors and caches while quantizing the LM head and decoder linear weights to q4.
67
 
68
  ## Model Files
69
 
 
72
  β”œβ”€β”€ model.onnx # FP32
73
  β”œβ”€β”€ model_fp16.onnx # FP16
74
  β”œβ”€β”€ model_q4.onnx # Q4, quantized embedding (WebGPU)
75
+ β”œβ”€β”€ model_q4f16.onnx # Q4 embedding/weights, FP16 runtime and caches (WebGPU)
76
  └── model_q8.onnx # Q8
77
  ```
78
 
onnx/model_q4f16.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:34d1e9d9a5c72659e338c8de3c11302b27d78d009fe891e6c060bec8246767a1
3
- size 222663
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:871354d43abc0d718a7a089d2fe10ad5d1f83e08acbfb9f45e4d137b41a1e9a4
3
+ size 222160
onnx/model_q4f16.onnx_data CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:13bd61df0b2449c3bce67c12f1eed81dd27341add0eb9d4caa60e7804b46861b
3
- size 1072164864
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34537bf4a6d70ddf1627bd3709d31c8b7db8d5bcaee2098c45661be59476fbec
3
+ size 1063972864
onnx/model_q4f16.onnx_data_1 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5ad378ec208f81195cd482efc0d5f7b91c1342f6c73bfea05dbddd7c9302de31
3
- size 986054656
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b645b44902caccd406098c4dbef5724927c5fb2a2be4a087ae328989b111a7f
3
+ size 469958656