Views
No views yet
| Property | NF4 (4-bit) | Int8 (this repo) |
|---|---|---|
| File size | ~660 MB | ~850 MB |
| Dequant complexity | NF4 lookup table + double-quant | Single multiply per row |
| C code needed | ~40 lines | ~5 lines |
| SIMD acceleration | Requires nibble unpacking | Native int8 SIMD on all ARM cores |
| Accuracy vs fp16 | ~0.3% degradation | ~0.1% degradation |
<layer>.weight.int8 # int8 [out_features, in_features]
<layer>.weight.scale # fp16 [out_features] (one scale per output row)1// Dequantize row `row` of a weight matrix into float32 buffer `out`
2void dequant_row(const int8_t* W, const float* scale, float* out,
3 int row, int in_features) {
4 for (int i = 0; i < in_features; i++)
5 out[i] = (float)W[row * in_features + i] * scale[row];
6}1model = AutoModelForSeq2SeqLM.from_pretrained(
2 "facebook/nllb-200-distilled-600M",
3 torch_dtype=torch.float16, device_map="cpu"
4)
5# per-channel int8 quantization — see upload script in repo