Skip to content

[QUALITY] #4751 incomplete: AWQ still drops the norm group after an untagged absent sibling branch (Nemotron-H Mamba/MLP layers, Granite-4.0-H/LFM2 attention, Ling 2.0 query_key_value) #4759

Closed

Description

@Qubitium

Found on main @ 2b7a0b5 (includes #4751), RTX 4090 (sm_89, CUDA 13.2, torch 2.15, transformers 5.22.1).

What is wrong

#4751 (the fix for #4732) only exempts a block from refuse_last_module_fallback (#4708) when the block and the absent block before it share one :in= tag. The check is sibling_of_absent_block = shared_tag is not None and shared_tag in prev_absent_block_tags, at gptqmodel/models/base.py:5743-5745 and :5864-5866. The Qwen3.5 / MiniCPM-V / Intern-S2 trees declare those tags, so they are fixed.

Hybrid trees whose alternative branches carry no in= tag are still refused their norm source. In each case below, a branch this layer type does not own is "absent":

  • Granite-4.0-H: mamba on an attention layer;
  • LFM2: conv on an attention layer;
  • Nemotron-H: the mixer attention/mamba/MLP alternatives;
  • Ling 2.0 (bailing_moe): the self_attn branch before attention, in every layer.

The norm → projection group of the following block is still dropped. This was the comment on #4732, which #4751 did not cover.

Evidence

Real quantize(), AWQConfig(bits=4, group_size=128), 16 C4 rows, batch_size=1, layer-truncated real checkpoints. The groups listed are the (prev_op, #members, first member) x layers that reached _search_best_scale:

checkpoint e2a5ff6fa~1 (before #4708) main @ 2b7a0b5 (after #4751)
granite-4.0-h-350m (11 layers; layer 10 = attention) input_layernorm -> [q,k,v] x1 present missing: layer 10 using fallback quantization (no scaling group survived filtering)
LFM2.5-1.2B-Instruct (3 layers; layer 2 = full_attention) operator_norm -> [q,k,v] x1 present missing
NVIDIA-Nemotron-Nano-9B-v2 (15 layers: 8 Mamba, 6 MLP, 1 attention) norm -> [mixer.in_proj] x8, norm -> [mixer.up_proj] x6, norm -> [q,k,v] x1 only norm -> [q,k,v] x1. Every Mamba/MLP layer logs using fallback quantization (no AWQ scaling groups were generated / no scaling group survived filtering)
Ling-mini-2.0 (3 layers) input_layernorm -> [attention.query_key_value, attention.dense] x3 (the #4677 bug) no attention group at all. The correct result would be input_layernorm -> [attention.query_key_value]

On Nemotron-H this makes "AWQ" plain RTN for every Mamba and MLP layer, which is almost the whole model. On Ling 2.0, the model #4708 was written for, query_key_value has lost its AWQ scale in every layer. The only signal is one INFO/WARN fallback line per layer, or nothing at all (Ling).

Repro

from gptqmodel import GPTQModel
from gptqmodel.quantization.config import AWQConfig, CalibrationConfig
import gptqmodel.looper.awq_processor as AP
from gptqmodel.quantization.awq.utils.module import get_op_name
orig = AP.AWQProcessor._search_best_scale
def spy(self, module, prev_op, layers, *a, **k):
    print("GROUP", get_op_name(module, prev_op), [get_op_name(module, l) for l in (k.get("fold_layers") or layers)][:3])
    return orig(self, module, prev_op, layers, *a, **k)
AP.AWQProcessor._search_best_scale = spy
m = GPTQModel.load("NVIDIA-Nemotron-Nano-9B-v2 (num_hidden_layers=15)", AWQConfig(bits=4, group_size=128), dtype=torch.bfloat16)
m.quantize(CalibrationConfig(dataset=c4_rows[:16], batch_size=1))
# main: only "GROUP norm ['mixer.q_proj', 'mixer.k_proj', 'mixer.v_proj']"
# e2a5ff6fa~1: also 8x "GROUP norm ['mixer.in_proj']" and 6x "GROUP norm ['mixer.up_proj']"

Suggested fix

Do not make the exemption depend on optional in= tags. An absent block can only take away a fold source if it is a data-flow predecessor of the current block. For #4677's Ling MLA case, that predecessor is q_b/kv_b before dense, within the same branch. An absent sibling branch, meaning a different top-level key such as self_attn vs attention, mamba vs self_attn, or conv vs self_attn, never is. Possible approaches:

  • Restrict prev_block_absent to blocks under the same parent key as the current block.
  • Or derive the exemption from the module plan's parent, not from the tags.

Test that should have caught it

tests/module_tree/test_awq_fold_safety_4175.py covers only the tagged Qwen3.5-style trees. Add the same "the norm still folds" assertion for tiny granitemoehybrid (attention layer), lfm2 (attention layer), nemotron_h (M, - and * layers) and bailing_moe (input_layernorm -> query_key_value without dense).

Severity

High for Nemotron-H (AWQ silently becomes RTN for almost every layer). Medium for Granite-4.0-H / LFM2 attention layers and for Ling 2.0 query_key_value.

🤖 Generated with Claude Code

Activity

  1. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim released: agent-53ba17eb4d83 finished this issue.

    Pull request: #4800

    AWQ norm group dropped after untagged absent sibling; worktree /root/work-4759

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions