feat(quant): add GPTQ/AWQ quantized checkpoint support (fixes #70)#82
Open
drunkcoding wants to merge 2 commits intodevfrom
Open
feat(quant): add GPTQ/AWQ quantized checkpoint support (fixes #70)#82drunkcoding wants to merge 2 commits intodevfrom
drunkcoding wants to merge 2 commits intodevfrom
Conversation
added 2 commits
April 1, 2026 11:06
free_gpu_blocks was a no-op (two consecutive returns), causing scheduler preemption to fail — freed blocks were never returned to the allocator. Now releases physical blocks while preserving sequence table entry and CPU swap buffers for potential swap-in recovery.
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
Problem
MoE-Infinity unconditionally cast all checkpoint tensors to the model's float dtype during loading. This destroyed packed integer representations in quantized checkpoints (GPTQ
qweight/qzeros/g_idx, AWQqweight/scales), causing silent weight corruption. Issue #70 reported this for the HQQ-quantized Mixtral variant.Changes
New:
moe_infinity/utils/quantization.pydetect_quantization()— identifies quant format from config attributes or checkpoint files (quantize_config.json,quant_config.json,quantization_config.json,.gguffiles)validate_quantization_support()— raisesValueErrorwith actionable messages for unsupported formatsshould_cast_tensor()— decides per-tensor whether to cast to model dtype (skips packed quant tensors)QuantizationInfodataclass — carries method, bits, group_size, support statusModified:
moe_infinity/runtime/model_offload.pyqweight,qzeros,scales,g_idx)detect_quantization()instead of fragilehasattrcheck, handles file-based configautoawqdependency (clearImportErrorif missing)optimumnot installed for GPTQ modelsModified:
moe_infinity/entrypoints/big_modeling.pyAutoConfig.from_pretrained()— fails before expensivesnapshot_download()New:
requirements-optional.txtautoawq>=0.2.0as optional dependency for AWQ supportTest Coverage
test_quantization_detection.pytest_gptq_loading.pytest_awq_loading.pytest_unsupported_quant_errors.pytest_quant_regression.pytest_quantized_e2e.pyUnit tests: 248 passed, 4 skipped (CUDA), 0 failed
E2E tests: Scaffolded with auto-skip when checkpoints not available
Supported Quantized Models
Backward Compatibility
should_cast_tensor(name, None)returnsTruefor all tensors — existing full-precision path unchangeddetect_quantization()returnsNonefor standard models — no new code paths activatedfloat8_e4m3fnspecial case verified untouchedrequirements.txt