Archived
core/format, tools: GGUF Q8_0, Q4_K and Q6_K tensors import as their planes -- rad-convert writes them without a recipe
A GGUF tensor of block type Q8_0, Q4_K or Q6_K could only be dequantised, so rad-convert reached it through a recipe rule and re-quantised what was already quantised. ckpt_resolve now states the planes libquant's ggml quantiser writes for the same blocks and marks the weight imported, and ckpt_plane_rows splits each row's blocks into them bit for bit. The split is core/format/ggml_planes.h, the reader's copy of lq_ggml's unpack functions, since the core cannot call libquant; a type there is one table row, its planes and its split. Pieces of one block type joined along rows import, an expert's slices of a stacked tensor included; mixed types and column joins keep a GGUF reason. The weight is not trivial, so the loader refuses it with the hint to serve the container rad-convert writes, and ckpt_rows_f32 still dequantises it for a recipe. A rule that declines such a weight is an error in rad-convert, since keeping its planes would hide that the rule did not apply (spec.md §4.4). Tests: quant_ggml_test holds every type of the reader's table to the quantiser's encoding, checkpoint_test decodes the planes of Q8_0, Q4_K (one-block rows and a row join) and Q6_K against the block definition and holds an expert's gate|up, two slices of stacked Q4_K tensors, to the same blocks stored on their own, and convert_test runs a declining rule over a Q8_0 tensor, with the GGUF writer moved to tests/gguf_writer.h for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6f034d989f
commit
385318f81a
10 files changed
+602
-57
No files matched your search
@@ -520,6 +520,7 @@ dequantisation where the architecture's kernels read another form, and NVFP4 alw
|
||||
| `compressed-tensors` with an `nvfp4-pack-quantized` config group (`weights`: 4-bit float, group 16) | `fp4_e2m1*f32[1x16]` | the packed e2m1 codes beside an f32 scale per 16 of K, `weight_scale / weight_global_scale`: the global scale is a divisor, as compressed-tensors' dequantise and vLLM read it. Each piece keeps its own global, so a fused gate\|up reads both exactly. No kernel serves NVFP4, so every NVFP4 weight takes a recipe rule (`data/recipes/q38-27b-nvfp4-df2.recipe` makes it MXFP4) |
|
||||
| `compressed-tensors` whose config groups are all `float-quantized` with 8-bit `float` weights | `fp8_e4m3*<scale>[1x*]` or `[RxC]` | nothing is imported: each `X.weight` reads stock as FP8 with `X.weight_scale` beside it, one scale a row (`[N, 1]` or `[N]`, the channel strategy) or a block plane; a per-tensor scale (`[1]`) is written once a row, so it is imported rather than byte for byte. The quantisation is still the tool's, so the family's quantised plugin serves it |
|
||||
| `modelopt` (NVIDIA ModelOpt) with `quant_algo` `NVFP4`, `FP8`, or `MIXED_PRECISION` whose `quantized_layers` are each NVFP4 (group 16) or FP8 (e.g. ukisai's Swift 1.5 27B NVFP4) | NVFP4: `fp4_e2m1*f32[1x16]`; FP8: `fp8_e4m3*f32[1x*]` | NVFP4: `X.weight` (U8 `[N, K/2]`, the even k in the low nibble) beside an f32 scale per 16 of K, `float(X.weight_scale) * X.weight_scale_2`: ModelOpt's second level multiplies, where compressed-tensors' global scale divides. FP8: `X.weight` E4M3 with its one f32 `X.weight_scale`, written once a row. `X.input_scale` (a static activation scale) is not read: activations are quantised from their own values. Any other algorithm is refused by name. No kernel serves NVFP4, and none an FP8 scale per tensor, so both take recipe rules (`data/recipes/q38-27b-modelopt-nvfp4.recipe`) |
|
||||
| GGUF `Q8_0`, `Q4_K` and `Q6_K` tensors (a GGUF file, not a `quantization_config`) | `i8*f16[1x32]`, `affine:codes=u4[1x1],scale=u6[1x32],scale.1=f16[1x256],min=u6[1x32],min.1=f16[1x256]` and `i6*i8[1x16]*f16[1x256]` | the blocks split into their planes, bit for bit; a rule re-quantises from the exact dequantisation. Not served as they stand: the loader refuses them with the hint to serve the container `rad-convert` writes |
|
||||
|
||||
The width is read per tensor, so a release mixing int4 experts with int8 projections imports both.
|
||||
A mixed-precision release (NVFP4 MLPs beside FP8 or bf16 linears, the usual NVFP4 layout) reads
|
||||
|
||||
Reference in new issue
Block a user