Skip to content

paro: per-module krot and fallback overrides do not reach the packed module #5659

Closed

Description

@Qubitium

Summary

Two defects found in the post-merge review of #5638 (#5638 (comment)). Per-module dynamic overrides are accepted and applied to the optimizer clone, but two of them never reach the packed module.

1. Per-module Paro krot is dropped

resolve_module_constructor_config() (gptqmodel/quantization/module_config.py) has branches for FP8, bitsandbytes, GGUF and MXFP4 but none for FORMAT.PARO, so a per-module krot override is not written into options:

resolve_module_constructor_config(..., format=FORMAT.PARO,
    init_kwargs={"krot": 8}, overrides={"krot": 1}).options_dict()
# -> {"krot": 8}   expected {"krot": 1}

ParoProcessor then packs with init_kwargs=self.qcfg.quant_linear_init_kwargs() (top-level krot) and copies the optimizer buffers in:

qmodule.pairs.copy_(pairs.to(...))

When the per-module krot differs from the top level, the copy either broadcasts the same Givens sweep across every stage (top=8, dyn=1) or raises RuntimeError (top=8, dyn=16; top=1, dyn=8; top=8, dyn=4). Checkpoint metadata also records the top-level krot, so the optimizer's setting is lost.

2. Per-module Paro fallback is cloned then ignored

clone_config_for_module() applies fallback to the clone, but ParoProcessor.preprocess() sets self.fallback from the processor-level value, and _module_fallback_requested() / _log_fallback() read self.fallback. Repro: top-level "0.5%", per-module "1.0%", 5 of 1000 calibration rows -> the clone says fall back, the processor does not.

Lower-severity items in the same area

  • explicit None (meaning "inherit") is rejected by _validate_dynamic_module_scope.
  • per-module kernel is cloned but packing uses the top-level quant_linear_init_kwargs(); damp_percent / static_groups are accepted and cloned with no Paro consumer.

Expected

  • The packed ParoLinear uses the module's resolved krot (and kernel), and packing never relies on a shape-compatible copy.
  • Fallback decisions use the module's resolved config.
  • Explicit None means inherit, not an error.

Repro

The regression tests added in #5638 stop before packing, so they do not catch either defect. A packing test with top=8, dyn=1 shows the broadcast; top=8, dyn=16 shows the RuntimeError.

Activity

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

    @Qubitium
    CollaboratorAuthor

    Agent claim released: agent-f7b500b8ed4c finished this issue.

    Pull request: #5675

    Fixing per-module Paro krot/fallback propagation from the post-merge review of #5638

  3. added 2 commits that reference this issue on Nov 20, 2026
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