Repository navigation
Conversation
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
With
auto_dtype_cast=auto_nf12, the calibration forward replaces each eligible projection with an NF12 packed wrapper and records anauto_dtype_cast_source_spec. The dense source is only restored byModuleLooper._prepare_named_module_for_quantization. Whenfallback=None,prune_uncovered_modulespops experts that received no calibration tokens, so those experts never reached that step: theirnf12_*buffers stayed in the model tree and_validate_nf12_payload_ownershipabortedsave().What Changed
gptqmodel/looper/stage_subset.py: before a pruned/uncovered module leaves the subset loop, runlooper._prepare_named_module_for_quantizationwhen it still carries a deferred quant source (auto_dtype_cast_source_specorquant_source_module). This restores the dense source and releases the packed buffers. Modules without a deferred source are already dense and are left untouched. Existing dynamic-exclusion recording is unchanged; the NF12 ownership validation is not relaxed.tests/test_moe_prune_nf12_save_4349.py: drives the real_run_single_subset_passprune path with stub AUTO_NF12 packed modules and asserts every pruned expert is restored and_validate_nf12_payload_ownershippasses. A negative test asserts a leftovernf12_*buffer is still rejected even when the module is recorded as dynamically excluded.Tests
Pre-fix confirmation: the new regression test fails on unmodified
origin/mainbecause the pruned experts are never passed to_prepare_named_module_for_quantization.Not run: real AUTO_NF12 packing needs a supported CUDA/HIP device (
nf12_supported_deviceis false on CPU), so the packed wrapper is simulated on CPU. The full Qwen3-30B-A3B repro (tests/test_moe_config.py::TestMoEConfig::test_none_moe_config) was not run (model download/network + GPU).tests/test_subset_plan.py::test_build_layer_subset_plans_merges_groups_for_single_pass_processorsfails identically on unmodifiedorigin/mainand is unrelated.Model Support / Module Plan
N/A — no new model types or registry entries.
Fixes #4349