Skip to content

feat(tensors): add i-quant (IQ) storage types for GGUF tensor loading - #958

Merged
0xShug0 merged 1 commit into
0xShug0:mainfrom
Th-Underscore:pr/iq-tensor-support
Oct 17, 2026
Merged

0xShug0 merged 1 commit into
0xShug0:mainfrom
Th-Underscore:pr/iq-tensor-support

Conversation

@Th-Underscore

@Th-Underscore Th-Underscore commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add i-quant (IQ) storage types to the GGUF tensor source layer so IQ-quantized models can be loaded natively. The bundled ggml already defines GGML_TYPE_IQ2_XXS through GGML_TYPE_IQ4_XS; this wires them into the TensorStorageType enum and the five dtype-mapping functions in tensor_source.cpp, plus the name lookup in options.cpp.

Purely additive: no existing code path changes.

Validation

Tested against drama3-small-IQ3_XXS.gguf — passes the unsupported native tensor dtype: iq3_xxs gate (previously a hard stop). Alone, loading still fails at tensor shape mismatch (per-layer expert counts); full inference requires the companion per-layer-expert PR.

Validated with all three companion PRs (#958, #959, #960) merged in a combined branch on Linux / V100 (sm70) CUDA. The change here is a pure enum+mapping addition with no behavioral effect on existing dtypes, so the combined test is sufficient.

Limitations

  • Validated on Linux / V100 (sm70) CUDA only.

Credit

Derived from drama3-small-audiocpp.patch in the drama3-small-GGUF repo, based on JarodMica/audio.cpp drama-3-native branch work.

Add IQ2_XXS, IQ2_XS, IQ2_S, IQ3_XXS, IQ3_S, IQ4_NL, IQ4_XS to the
TensorStorageType enum and wire them through all five dtype mapping
functions in tensor_source.cpp plus the storage type name lookup in
options.cpp. The GGML types already exist in the bundled ggml; this
makes the tensor source layer aware of them so IQ-quantized GGUF
tensors can be loaded natively.
@0xShug0
0xShug0 merged commit 22e1318 into 0xShug0:main Oct 17, 2026
11 checks passed
@Th-Underscore
Th-Underscore deleted the pr/iq-tensor-support branch October 19, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants