Views
No views yet
| Variant of this repo | cos_min | cos_mean |
|---|---|---|
model.int8.onnx (SmoothQuant α=0.8) | 0.987 | 0.992 |
model.int8.vanilla.onnx (kept for archive) | 0.639 | 0.846 |
quantize_dynamic) artifact collapsed on Qwen3-class decoder LLMs because of activation outliers: matrix multiplies with a small number of large-magnitude activations exceed INT8 dynamic range, and per-tensor / per-channel naive quantization has nowhere to put them. The German "Klimawandel" sentence in our probe set was the worst case (cos≈0.64 on F2LLM, ≈0.64 on Octen).Y = (X / s) · (s · W). After scaling, the outliers live in s · W, and the now-balanced X / s quantizes cleanly. α=0.8 was the LLM-class recommendation; smaller α moves more outliers into weights at the cost of weight quantization quality.| File | Description |
|---|---|
model.int8.onnx | Current SmoothQuant α=0.8 INT8 weights graph (use this). |
model.int8.onnx.data | External data sidecar for the above (use_external_data_format=True). |
model.int8.vanilla.onnx | Archived original vanilla quantize_dynamic INT8 — DO NOT use for retrieval; kept only for reproducibility of historical reports. |
model.int8.vanilla.onnx.data | External data sidecar for the archived vanilla artifact. |
tokenizer.json, tokenizer_config.json, special_tokens_map.json, added_tokens.json, config.json, merges.txt, vocab.json | Tokenizer + config copied from the upstream PyTorch repo. |
1# 1. SmoothQuant pre-processing (migrate outliers into weights)
2python smoothquant_onnx.py \
3 --fp32 model.onnx --output model.smoothed.fp32.onnx \
4 --tokenizer <upstream snapshot> --alpha 0.8
5
6# 2. Standard per-channel dynamic INT8 quantize on the smoothed FP32
7python -c "from onnxruntime.quantization import quantize_dynamic, QuantType; \
8 quantize_dynamic('model.smoothed.fp32.onnx', 'model.smoothed.int8.onnx', \
9 per_channel=True, op_types_to_quantize=['MatMul'], \
10 weight_type=QuantType.QInt8, use_external_data_format=True)"tools/dump_reference.py (validation) and the wip/validation branch's
/scripts/smoothquant_onnx.py + /scripts/quant_smoothed_int8.py.cstr/Octen-Embedding-0.6B-ONNX-INT8 with model_file = "model.int8.onnx". Direct ORT usage (ONNX Runtime ≥ 1.17) is straightforward — load the .onnx and ORT will discover the .data sidecar automatically as long as both files sit in the same directory.model.int8.onnx with the SmoothQuant α=0.8 export. Original vanilla INT8 archived as model.int8.vanilla.onnx. Reason: vanilla quantize_dynamic produced cos_min=0.64 on this Qwen3-class decoder LLM (catastrophic outlier collapse on multilingual inputs); SmoothQuant recovers cos_min=0.99.quantize_dynamic per-channel INT8 export. Now archived.Octen.apache-2.0. This repository redistributes under the same terms; it grants no rights the upstream licence does not.