Converting an FP8, GPTQ, AWQ or compressed-tensors checkpoint to GGUF: what each llama.cpp build does, and what the errors mean
Since build b6830 (2025-10-23) convert_hf_to_gguf.py reads pre-quantized FP8 and GPTQ checkpoints, and since b7002 compressed-tensors ones; AWQ, bitsandbytes and non-gpt-oss MXFP4 are still refused in b12830. Older builds stop with ValueError: Can not map tensor '…weight_scale_inv' (or …g_idx, …weight_packed, …input_scale): the converter did not know the quantizer's extra tensors. Most supported formats are dequantized to BF16 (F16 before b7506), so the GGUF is twice the size of the FP8 source until you run llama-quantize. Two newer changes matter: from b12000 per-tensor FP8 is kept as GGUF F8_E4M3 plus a scale, and from b12818 the default --outtype auto refuses block-scaled FP8 (DeepSeek-V3/R1, Qwen3-*-FP8, transformers FineGrainedFP8) with “has an unsupported block/group scale”. Pass --fp8-as-q8 (Q8_0) or --outtype bf16 to convert those. Every row below comes from converting tiny synthetic checkpoints with 18 llama.cpp builds (682 conversions) and checking every weight in the output against an independent dequantization.
Look up your checkpoint
The build number is the bNNNN tag of your checkout (git describe --tags). The converter is a Python script, so what matters is the checkout you run it from, not a binary you installed.
What each format becomes, by build
“Default” means no --outtype. Before b7506 the default was f16; from b7506 it is auto (BF16 for these checkpoints, and from b12000 “keep FP8 where supported”). --outtype bf16 and --outtype q8_0 always dequantize. --fp8-as-q8 exists from b9377 and stores what came from FP8 as Q8_0 and everything else as with the default.
Checkpoint format (quant_method, layout) | Typical models | ≤ b6829 | Then | b12830, default | b12830, works with |
|---|
Builds are release tags. A change is placed at the first tag that contains the commit; both neighbouring tags were converted to confirm it. Tested on a Llama-architecture toy model; MoE expert tensors, vision towers and other model classes were not converted (see limits).
The error messages, one by one
| Message | Builds | Meaning | Fix |
|---|---|---|---|
ValueError: Can not map tensor 'model.layers.0.mlp.down_proj.weight_scale_inv' | ≤ b6829 | Block-FP8 checkpoint (DeepSeek-V3/R1, Kimi K2, Qwen3-FP8). The scale tensor has no GGUF name. | Update to b6830+ (b12818+: add --fp8-as-q8 or --outtype bf16). |
Can not map tensor '….weight_scale', '….input_scale' | ≤ b6829 | compressed-tensors or ModelOpt FP8. | compressed-tensors per-channel/block: b7002+; per-tensor: b12000+; ModelOpt: b8372+. |
Can not map tensor '….weight_packed' | ≤ b6829 | compressed-tensors int4/int8 pack-quantized (W4A16). | b7002+. |
Can not map tensor '….g_idx' (or .qweight, .qzeros, .scales) | ≤ b6829 | GPTQ (.g_idx) or AWQ (no .g_idx). | GPTQ: b6830+. AWQ: not supported in any build. |
Can not map tensor '….weight.absmax' | ≤ b6829 | bitsandbytes 4-bit. | Not supported in any build; see below. |
NotImplementedError: Quant method is not yet supported: 'compressed-tensors' | b6830–b6999 | Recognised the field, no reader yet. | b7002+. |
NotImplementedError: Quant method is not yet supported: 'modelopt' | b6830–b8370 | NVIDIA ModelOpt (TensorRT Model Optimizer) export. | b8372+. |
NotImplementedError: Quant method is not yet supported: 'awq' / 'bitsandbytes' / 'mxfp4' | b6830–b12830 | No reader for this method. (MXFP4 is read only for gpt-oss.) | Use the unquantized model. |
AssertionError (bare, from dequant_model) | b7002–b11998 | compressed-tensors FP8 with "strategy": "tensor" (static per-tensor scales, e.g. FP8 W8A8 “static”). Only channel and block were accepted. | b12000+. |
ValueError: FP8 weight '…' has an unsupported block/group scale (scale shape [..], weight shape [..]); only per-tensor or per-output-channel scales are supported. Re-run with --fp8-as-q8 to dequantize instead. | b12818–b12830 | Default --outtype auto now tries to keep FP8 and cannot store a 128×128 block scale. | Add --fp8-as-q8 (Q8_0) or --outtype bf16. Both convert; b12816 converted the same file to BF16 with no flag. |
ValueError: Cannot convert FP8 weight '…': source weight scale is missing | b12818+ (source) | A float8_e4m3fn weight without any _scale / _scale_inv / qscale_weight tensor (often a partial download or a hand-edited checkpoint). | Check that all shards and the index file are present. |
error: unrecognized arguments: --fp8-as-q8 | < b9377 | The flag is newer than your checkout. | Update, or use --outtype bf16 / --outtype q8_0. |
tensor 'blk.0.attn_q.weight' has invalid ggml type 43. should be in [0, 43) | loader < b12000 | Loading a GGUF that kept FP8 (F8_E4M3, type 43) with an older llama.cpp. NVFP4 (type 40) needs b8297 or later the same way. | Update the runtime, or convert again with --outtype bf16 / --fp8-as-q8. |
The first five messages name whichever unknown tensor the converter met first; ours were from down_proj, yours may be another layer. The “source weight scale is missing” and “invalid ggml type” texts are read from the source (conversion/base.py and ggml/src/gguf.cpp), not reproduced.
Which command to run on a current build
# block-scaled FP8 (DeepSeek-V3/R1, Kimi K2, Qwen3-*-FP8, MiniMax, "weight_block_size": [128, 128])
python convert_hf_to_gguf.py ./model --fp8-as-q8 --outfile model-Q8_0.gguf # FP8 -> Q8_0, rest BF16
python convert_hf_to_gguf.py ./model --outtype bf16 --outfile model-BF16.gguf # then llama-quantize to Q4_K_M etc.
# per-tensor or per-channel FP8 (compressed-tensors FP8 / FP8_DYNAMIC, ModelOpt FP8)
python convert_hf_to_gguf.py ./model --outfile model-F8.gguf # keeps F8_E4M3 + scale; needs a b12000+ runtime
# GPTQ, compressed-tensors W4A16 / W8A16
python convert_hf_to_gguf.py ./model --outtype bf16 --outfile model-BF16.gguf
llama-quantize model-BF16.gguf model-Q4_K_M.gguf Q4_K_M
Re-quantizing an already 4-bit model to Q4_K_M rounds the weights a second time, onto a different grid. We did not measure the quality cost. If the original BF16 model is public, converting that is the cleaner path.
What the output size will be
FP8 is 8 bits per weight. Dequantized BF16 is 16, Q8_0 is 8.5 (a 16-bit scale per 32 weights), and kept F8_E4M3 is 8 plus one float per row or tensor. A 4-bit GPTQ model becomes a 16-bit GGUF, about four times its download, before llama-quantize. One detail: a --fp8-as-q8 file stores Q8_0 tensors but its general.file_type still says BF16 (32) in b12830, so tools that read only the header report the wrong type.
Silent outcomes: the conversion succeeds but you did not get FP8
- b12000–b12816, per-channel FP8 became BF16 with no message. The default only kept per-tensor scales. From b12818 (PR #28898) per-output-channel scales are kept too, for model classes that know how to reorder the scales with the weights. In b12830 those are
LlamaModel,Qwen2Model,Qwen2MoeModelandQwen3NextModeland their subclasses;DeepseekV2ModelandNemotronHModelmap names only. For other classes the weight is still dequantized (issue #33215). Master after b12849 prints a warning when this happens (PR #33312, 2026-11-29); released builds up to b12849 stay silent. Check the output (below). - Before b7506 every dequantized format came out F16, not BF16. F16 overflows above 65,504. Our toy weights were small, so we saw no difference beyond rounding; a real model with large activations-scaled weights could. Use
--outtype bf16on old builds. - GPTQ and W4A16 are never kept at 4 bits. The GGUF is 16-bit (or Q8_0 with
--outtype q8_0).
Check what your GGUF actually stores
python - model.gguf <<'EOF'
import sys, collections, gguf # pip install gguf, or use llama.cpp/gguf-py
r = gguf.GGUFReader(sys.argv[1])
print(collections.Counter(t.tensor_type.name for t in r.tensors if t.name.endswith(".weight") and len(t.shape) > 1))
print(sum(t.name.endswith(".scale") for t in r.tensors), "FP8 scale tensors")
EOF
A kept FP8 model shows F8_E4M3 and one .scale tensor per FP8 weight. BF16 with zero scale tensors means it was dequantized.
Does a kept-FP8 GGUF run?
On the CPU backend of b12830, yes. We built llama-perplexity and compared each converted toy model with an F32 conversion of the same checkpoint over 73 chunks of 128 tokens. Mean KL divergence: 0.000000 for kept per-channel and per-tensor F8_E4M3 (maximum 0.000002), 0.000013 for BF16, 0.000156 for --fp8-as-q8 (Q8_0) from block FP8. The FP8 files were 1.54 MB against 2.70 MB for BF16 (embeddings are BF16 in both). The weights are random, so these numbers show the file decodes to the right values, not anything about quality on a real model.
AWQ, bitsandbytes and MXFP4 checkpoints
No build up to b12830 reads them: the converter raises Quant method is not yet supported. The practical routes are:
- Convert the unquantized base model the quantized one was made from (usually linked in its model card).
- bitsandbytes: transformers can undo it in memory. Load the model with its quantization config, call
model.dequantize()(implemented for bitsandbytes 4- and 8-bit in transformers 4.57),save_pretrained(), then convert. This needs the bitsandbytes package and, for most versions, a GPU; we did not run it. - MXFP4 is read for gpt-oss only (kept as GGUF MXFP4 since b6835).
NVFP4 (read from source, not converted here)
GGUF has had an NVFP4 type since b8297 (2026-03-11). The converter repacks ModelOpt NVFP4 checkpoints since b8372 (PR #20539, mixed NVFP4/FP8), compressed-tensors nvfp4-pack-quantized since b9329 (PR #21095) and mixed-precision compressed-tensors NVFP4 since b11526 (PR #28636). Mistral 3 NVFP4 weight scales were attached in b9341 (PR #23629). b12818 changed how NVFP4 and FP8 scales are stored (PR #28898). We did not build NVFP4 toy checkpoints, so this section has no test behind it.
How this was tested
A script writes a two-layer Llama (hidden 256, intermediate 512, SentencePiece vocabulary of 320) with random weights, then stores the seven linear layers of each block in eleven on-disk layouts, each built from the format's description rather than copied from a model: plain BF16; quant_method: fp8 with weight_block_size [128, 128]; compressed-tensors FP8 with strategy tensor, channel and block; compressed-tensors int4 group-128 pack-quantized; GPTQ 4-bit group 128 (v1 zero points); ModelOpt FP8 with hf_quant_config.json; and AWQ, bitsandbytes NF4 and MXFP4 configs with plausible tensors. Each checkpoint was converted with each build in four modes (default, --outtype bf16, --outtype q8_0, and --fp8-as-q8 where the flag exists), 682 conversions in all. The lookup on this page reproduces all 620 non-baseline results exactly (a test script compares them). For every successful conversion, all 14 linear weights were read back with gguf-py, multiplied by their .scale tensor where present, undone from llama.cpp's Q/K row permutation, and compared with our own dequantization. The largest relative error was 4×10-8 for kept FP8, 0.0027 for BF16 and 0.0041 for Q8_0, i.e. only the rounding of the output type: every supported layout was decoded correctly. Builds: b6829, b6830, b6999, b7002, b7503, b7506, b8370, b8372, b9169, b9375, b9377, b11669, b11998, b12000, b12420, b12816, b12818 and master b12830.
Limits
- One architecture (Llama). MoE experts (fused or per-expert scales), vision towers, Mistral-format
qscale_weightcheckpoints, MXFP8 (MiniMax), NVFP4, GPTQ withdesc_act, 3-bit GPTQ and asymmetric W4A16 were not converted. The source raisesNotImplementedError: 3-bit gptq dequantization is not yet implementedandCan't handle multiple config groups for compressed-tensors yetfor two of them. - Speed was not measured, and the run check above used the CPU backend only; CUDA, Metal and Vulkan support for
F8_E4M3was not tested. - Ollama, LM Studio and other tools that bundle llama.cpp were not checked.
FAQ
- Why does convert_hf_to_gguf.py say "Can not map tensor ... weight_scale_inv"?
- Your llama.cpp checkout is b6829 or older and the checkpoint is block-scaled FP8 (DeepSeek-V3/R1, Kimi K2, Qwen3-FP8). The converter reads pre-quantized FP8 and GPTQ checkpoints from b6830 (PR #14810). On b12818 and later, also pass --fp8-as-q8 or --outtype bf16.
- Why does a current llama.cpp refuse block FP8 with "has an unsupported block/group scale"?
- From b12818 the default --outtype auto tries to keep FP8 weights as F8_E4M3, which can store per-tensor and per-channel scales but not 128x128 block scales. Pass --fp8-as-q8 to store them as Q8_0, or --outtype bf16 to dequantize. b12816 converted the same checkpoint to BF16 without a flag.
- Can llama.cpp convert AWQ or bitsandbytes checkpoints to GGUF?
- No. Up to b12849 the converter raises "Quant method is not yet supported" for awq, bitsandbytes and MXFP4 on models other than gpt-oss. Convert the unquantized base model, or for bitsandbytes dequantize in transformers first.
- Does converting a GPTQ model to GGUF keep it at 4 bits?
- No. GPTQ and compressed-tensors W4A16 are dequantized to BF16 (F16 before b7506), or Q8_0 with --outtype q8_0. Run llama-quantize afterwards to get a 4-bit GGUF.
- What does "invalid ggml type 43" mean when loading a GGUF?
- The file keeps FP8 weights as F8_E4M3 (type 43), which llama.cpp can load from b12000. Update the runtime or convert again with --outtype bf16 or --fp8-as-q8.
Related
- “unknown model architecture”: which llama.cpp build reads a GGUF
- “BPE pre-tokenizer was not recognized”: chkhsh and pre-tokenizer names by build
- Do I need to re-download a GGUF?
Sources
- llama.cpp conversion/base.py (
dequant_model,_prepare_fp8_e4m3_tensors) and convert_hf_to_gguf.py, read at3cadf644b - PR #14810 convert: handle pre-quantized models (b6830) · #17069 compressed-tensors (b7002) · #18214 rework ftype heuristics (b7506) · #20539 ModelOpt (b8372) · #23250 FP8 to Q8 (b9377) · #27512 OCP FP8 E4M3 (b12000) · #28898 quant scales for fp8 and nvfp4 (b12818) · #19769 NVFP4 type (b8297) · #21095, #28636, #23629, #16756
- Issues #14781 (weight_scale_inv, 2025-07), #15415 (DeepSeek-R1 FP4), #33215 (per-channel FP8 silently dequantized, 2026-11-27)
- transformers bitsandbytes documentation