Skip to content

[BUG] Per-module dynamic overrides accepted, validated (#5531) and saved but never applied: Paro krot/opt_* (bit-identical), RTN mse, GPTQ damp_auto_increment #5573

Closed

Description

@Qubitium

Found on main @ 8c71625, CPU + ROCm gfx1201 (torch 2.16 dev, transformers 5.23.0).

What is wrong

dynamic accepts any field of any known quantize config (_validate_dynamic_layer_keys allows _known_quantize_config_field_names()), #5531 now even range-checks Paro/MACaQ per-module values (opt_rotation_lr, opt_pair_ratio, ...), and the rule is written to quantize_config.json. But each processor only applies a hard-coded subset per module. Everything else is accepted, validated, saved, and then ignored:

Config Applied per module Accepted + saved, never applied (examples) Where
ParoConfig bits, group_size, sym, format krot, opt_rotation_epochs, opt_finetune_epochs, opt_rotation_lr, opt_weight_lr, opt_quantizer_lr, opt_batch_size, opt_train_samples, opt_pair_ratio, ... looper/paro_processor.py _module_quant_params() (l.452) reads 3 fields; the optimizer calls (l.626-680, 873-882, 2449, 2577) read self.qcfg.*
RTNConfig bits, sym, group_size, desc_act, smoother mse (scalar or {"norm": ...}) quantization/config.py clone_weight_only_config_for_module() (l.9219) never reads mse
GPTQConfig apply_scalar_module_overrides fields + fallback/hessian/gptaq/foem/gsq damp_auto_increment (explicitly range-checked per module by #5531) clone_gptq_config_for_module() (looper/gptq_processor.py l.134) does not copy it; gptq.py l.2360 reads self.qcfg.damp_auto_increment

(MACaQ is fine: macaq_processor.preprocess setattr's every override.)

Repro

Paro, Qwen2.5-0.5B-Instruct truncated to 2 layers, ROCm, 32 C4 rows, opt_rotation_epochs=1, opt_finetune_epochs=1, opt_train_samples=128, opt_validation_samples=16. sha1 of the saved layers.0.self_attn.q_proj.* tensors:

ParoConfig(**base)                                                              # base
ParoConfig(**base, dynamic={r"+:.*q_proj": {"opt_rotation_epochs": 0, "opt_finetune_epochs": 0, "krot": 1}})
ParoConfig(**base, dynamic={r"+:.*q_proj": {"opt_rotation_lr": 10.0, "opt_weight_lr": 10.0}})
ParoConfig(**base, krot=1)                                                      # top-level, for contrast
base               q_proj.qweight f6372214c2  scales 70ee36ab17  theta 9a06212597  pairs cf95d1575e   dynamic_saved=null
dyn_epochs0_krot1  q_proj.qweight f6372214c2  scales 70ee36ab17  theta 9a06212597  pairs cf95d1575e   dynamic_saved={"+:.*q_proj": {"opt_rotation_epochs": 0, "opt_finetune_epochs": 0, "krot": 1}}
dyn_lr_huge        q_proj.qweight f6372214c2  scales 70ee36ab17  theta 9a06212597  pairs cf95d1575e   dynamic_saved={"+:.*q_proj": {"opt_rotation_lr": 10.0, "opt_weight_lr": 10.0}}
top_krot1          q_proj.qweight 8c309245c7  scales 1087ba1572  theta 9f0e9c97de  pairs a769c2f2fc

Zero epochs, a different krot and a 10.0 LR on q_proj are bit-identical to the base run, and the checkpoint claims they were used.

RTN, same 2-layer model, CPU:

RTNConfig(bits=4, group_size=128)                                                   # none
RTNConfig(bits=4, group_size=128, dynamic={r"+:.*q_proj": {"mse": {"norm": 2.0}}})  # dyn_norm2
RTNConfig(bits=4, group_size=128, dynamic={r"+:.*q_proj": {"mse": 2.0}})            # dyn_scalar2
RTNConfig(bits=4, group_size=128, mse=2.0)                                          # top_norm2
none        q_proj.qweight 7184ed87 scales f5d4f09d
dyn_norm2   q_proj.qweight 7184ed87 scales f5d4f09d
dyn_scalar2 q_proj.qweight 7184ed87 scales f5d4f09d
top_norm2   q_proj.qweight 9134c6b0 scales 1514d92a

Suggested fix

Do one of these per method. Either build the per-module config by applying every override and re-running __post_init__, as MACaQ does, and have the processors read the clone (Paro: pass the clone into the optimizer calls; RTN: apply mse; GPTQ: copy damp_auto_increment). Or narrow the per-method allowed dynamic key set to the fields the processor actually applies and reject the rest at construction, with a message that names the supported keys. Today the #5531 range checks validate keys that do nothing.

Test that should have caught it

tests/test_config_numeric_validation_5437.py only checks that construction rejects bad values. It needs a functional companion: for each method, quantize a tiny model with one per-module override per allowed key and assert the module's packed tensors differ from the no-override run, or that the key is rejected.

Severity: medium. Silent: a user tuning Paro per module (fewer epochs or rotations on cheap modules) or RTN MSE on sensitive modules gets the global settings, and the checkpoint metadata says otherwise.

🤖 Generated with Claude Code

Activity

  1. added
    unsafe
    scanned
    safe
    and removed
    unsafe
    on Nov 20, 2026
  2. Qubitium commented on Nov 20, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim released: agent-f7b500b8ed4c finished this issue.

    Pull request: #5638

    Draft PR open; fix applies full per-module dynamic config in Paro, RTN and GPTQ.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    safescanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions