Skip to content

fix(studio): name removed ggml quant types and suggest llama-quantize --allow-requantize (#18722) - #18740

Open
Fahad090NP wants to merge 1 commit into
unslothai:mainfrom
Fahad090NP:fix/18722-gguf-quant-type-36-guidance
Open

Fahad090NP wants to merge 1 commit into
unslothai:mainfrom
Fahad090NP:fix/18722-gguf-quant-type-36-guidance

Conversation

@Fahad090NP

Copy link
Copy Markdown
Contributor

Fixes #18722

Summary

When a GGUF contains a tensor using a deprecated/removed or fork-specific ggml quantization type ID (such as type 36 = IQ4_NL_4_4, 37 = IQ4_NL_4_8, 38 = IQ4_NL_8_8, 34/35 = TQ1_0/TQ2_0, 39 = MXFP4, or 142/143 = PQ2_0/PTQ1_0), llama-server fails at startup with either has invalid ggml type <id> or of type <id> ((null)) ... not a multiple of block size (0).

Previously, _classify_start_failure only reported the raw integer (quantization type 36) without naming the quantization type or informing users with local/fine-tuned GGUFs that the bundled llama-quantize --allow-requantize <in.gguf> <out.gguf> Q4_K_M can convert those tensors into a loadable quantization.

Changes

  • studio/backend/core/inference/llama_cpp.py
    • Map known removed/special ggml quantization type IDs (34: TQ1_0, 35: TQ2_0, 36: IQ4_NL_4_4, 37: IQ4_NL_4_8, 38: IQ4_NL_8_8, 39: MXFP4, 142: PQ2_0, 143: PTQ1_0) so the diagnostic names both the numeric ID and symbol (e.g. quantization type 36 (IQ4_NL_4_4)).
    • Include actionable guidance for local/fine-tuned GGUFs to requantize with the bundled llama-quantize (--allow-requantize <in.gguf> <out.gguf> Q4_K_M).
  • studio/backend/tests/test_llama_cpp_start_failure_classification.py
    • Add a test case for type 36 (IQ4_NL_4_4) on blk.0.ffn_down.weight and assert that --allow-requantize guidance is included.

Verification

  • python -m py_compile studio/backend/core/inference/llama_cpp.py studio/backend/tests/test_llama_cpp_start_failure_classification.py: passed
  • Ran TestStartFailureClassification.test_unreadable_tensor_type_names_the_build_not_memory: 4/4 cases passed

danielhanchen added a commit that referenced this pull request Nov 21, 2026
## Problem

`Repo tests (CPU, rest-2)` fails on `main` since #18625 and on every PR
based on it (for example #17742, #18032, #18610, #18740):

```
test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding[3]
AssertionError: 1 file reads in the test trees touch a checked-in file with the platform default encoding,
so they break on Windows as soon as that file gains a non-ASCII byte. Pass encoding = "utf-8" ...
  'tests/test_tp_vocab_parallel_gloo.py:307: open()'
```

## Cause

#18625 added a source check to `tests/test_tp_vocab_parallel_gloo.py`
that reads `unsloth/models/llama.py` with a bare `open(...)`. On Windows
that uses the locale code page, so it would raise `UnicodeDecodeError`
once `llama.py` carries a non-ASCII byte. The guard is right; the new
read is missing its encoding.

## Fix

Pass `encoding = "utf-8"` to that `open()`. One line, test-only.

## Verification

- On `main`: `tests/test_source_read_encoding.py -k
checked_in_file_reads` fails (`[3]`, naming this line).
- With this change: 16 passed, and
`tests/test_tp_vocab_parallel_gloo.py` passes (11 passed).
@danielhanchen danielhanchen self-assigned this Nov 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot load a fine-tuned Q5_K_M GGUF: "quantization type 36 ... this build does not have"

2 participants