Repository navigation
feat(tensors): add i-quant (IQ) storage types for GGUF tensor loading - #958
Merged
Merged
Conversation
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.
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_XXSthroughGGML_TYPE_IQ4_XS; this wires them into theTensorStorageTypeenum and the five dtype-mapping functions intensor_source.cpp, plus the name lookup inoptions.cpp.Purely additive: no existing code path changes.
Validation
Tested against drama3-small-IQ3_XXS.gguf — passes the
unsupported native tensor dtype: iq3_xxsgate (previously a hard stop). Alone, loading still fails attensor 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
Credit
Derived from
drama3-small-audiocpp.patchin the drama3-small-GGUF repo, based on JarodMica/audio.cppdrama-3-nativebranch work.