Skip to content

[BUG] MoE quantize with fallback=None cannot be saved: experts that received no tokens keep their AUTO_NF12 packed source ("Save aborted: AUTO_NF12 source storage is still installed") #4349

Closed

Description

@Qubitium

Severity: medium. Status: confirmed by repro at 842d666 and at 9dad249 on a Radeon AI PRO R9700. The logic is device-independent. Kind: pre-existing bug.

Where

  • gptqmodel/looper/stage_subset.py:1445-1457: when prune_uncovered_modules is set, experts that never received input are popped from subset and processor.tasks.
  • Because they are popped, those experts never reach looper._prepare_named_module_for_quantization (stage_subset.py:1469). That is the quant-source step that turns the auto_dtype_cast="auto_nf12" packed wrapper back into the dense module.
  • Their nf12_* buffers therefore stay in the model tree, and save() refuses to write them in _validate_nf12_payload_ownership (gptqmodel/models/writer.py:603-640).

Repro

pytest tests/test_moe_config.py::TestMoEConfig::test_none_moe_config (1-layer truncation of Qwen/Qwen3-30B-A3B). Any small MoE model works:

from gptqmodel import GPTQModel, QuantizeConfig
m = GPTQModel.load(moe_model, QuantizeConfig(bits=4, group_size=128, fallback=None))
m.quantize(small_calib, batch_size=8)   # logs "`mlp.experts.N.*` was not invoked ..."
m.save(tmp)

Actual: ValueError: Save aborted: AUTO_NF12 source storage is still installed on modules the quantize config does not declare as NF12 (model.layers.0.mlp.experts.10.down_proj, ... 18 total).

Effect: with the default auto_dtype_cast=auto_nf12, any MoE run with fallback=None in which some experts get no calibration tokens cannot be saved at all.

Expected: pruned experts get their dense source restored, are recorded as dynamically excluded, and are saved as a plain weight.


Found during an AI-assisted review (Claude Code, round 11) of 842d666; repros were run at that commit on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.

Activity

  1. added
    bug
    on Nov 16, 2026
  2. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    Claimed. This issue is now owned by a dedicated worker; a fix PR referencing it will follow. Please avoid duplicating work on it in the meantime.

  3. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    Taking this. I'll investigate against current main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.

  4. self-assigned this
    on Nov 16, 2026
  5. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    Fixed in #4363: pruned uncovered experts now run the quant-source restoration so their dense source is restored before save().

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

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions