Skip to content

[BUG] Paro CPU declares INDUCTOR, but fullgraph compile after an eager warmup raises for biased FP16/BF16 layers on the ATen int4pack path (#5075) #5332

Closed

Description

@devin-ai-integration

Found on main @ 67de346. Reproduced on CPU (Torch 2.15.0+cpu, host without AVX512-BF16, so the ATen int4pack path is used).

What is wrong

Reproduction (CPU)

# cd tests && PYTHONPATH=.. python paro_eager_then_compile.py
import sys, torch; sys.path.insert(0, "kernels")
from test_kernel_compile_levels_cpu import _pack_awq, IN_FEATURES
from gptqmodel.nn_modules.qlinear.paro import ParoLinear
for dt in (torch.float16, torch.bfloat16):
    m = _pack_awq(ParoLinear, bias=True).to(dt).eval()
    x = torch.randn(4, IN_FEATURES, dtype=dt)
    with torch.no_grad():
        m(x)                                  # eager warmup -> live layout 'aten'
        torch._dynamo.reset()
        torch.compile(m, backend="inductor", fullgraph=True)(x)

Observed for both FP16 and BF16:

declared: {'cpu': COMPILE_LEVEL.INDUCTOR}
eager ok; live CPU layout after warmup: aten
torch._dynamo.exc.Unsupported: ... raised exception RuntimeError('ParoLinear: a CPU runtime layout is live and no traceable fused path was selected (a biased FP16/BF16 layer needs the #4068 FP32 cast). Compile the layer before its first eager forward, or run this layer eagerly.')

Expected: the compile succeeds and matches eager, as the INDUCTOR declaration promises.

Scope correction from the original analysis: with the default fullgraph=False, the same sequence compiles. Dynamo graph-breaks and runs the layer eagerly, and the max abs diff against eager is 0.0. So the failure is limited to fullgraph=True (and to callers that rely on the declared level). The fallback otherwise costs a graph break per biased projection.

Impact

  • Low severity.
  • fullgraph=True compile of a warmed-up Paro model fails on CPUs without AVX512-BF16 for biased projections (for example Qwen q/k/v).
  • The default compile mode silently graph-breaks on those layers, so they run eagerly.

Suggested mitigation / fix (untested)

  • Workaround: compile before the first eager forward, or use fullgraph=False. Both work today: the first is covered by the existing test, the second was observed above.
  • Fix: make the biased ATen case traceable. Call int4pack_mm without out_dtype, then add the bias in FP32 after a widening cast.
  • Alternatives: wrap the dense restore in torch.compiler.disable, or narrow the CPU declaration for biased ATen-path layers.
  • Regression test: eager warmup → torch.compile(fullgraph=True) for a biased FP16 and BF16 layer on the ATen layout.

Duplicate check

Searched open issues and PRs, including drafts. None covers this. #3857 touches paro.py for the stable-ABI migration, which is unrelated.

Activity

  1. added
    bug
    on Nov 19, 2026
  2. devin-ai-integration commented on Nov 19, 2026

    @devin-ai-integration
    ContributorAuthor

    Independent CPU validation at 67de346 (torch 2.15.0+cpu, ATen int4pack path, real runs, not simulation) confirms the report above. Controls:

    Case fullgraph=True inductor compile
    biased FP16/BF16, one eager forward first raises Unsupported wrapping the RuntimeError above
    no bias, after eager warmup compiles
    biased, compiled before the first eager forward compiles
    eager only runs

    With the default fullgraph=False (the optimize() path) there is no crash. It takes 2 graph breaks and drops the ATen layout, so it falls back to the dense dequant path. The output is correct; the performance cost is unmeasured.

    Mitigation is unchanged and untested: make the biased FP16/BF16 ATen path traceable (the FP32 cast from #4068), or downgrade the CPU INDUCTOR declaration for that case. Then add an eager-warmup + fullgraph=True inductor regression test on a biased BF16 layer.

  3. Qubitium commented on Nov 19, 2026

    @Qubitium
    Collaborator

    Agent claim released: agent-root-5332-paro-aten-bias finished this issue.

    Fixed in #5350, merged to main as a7037f9db: _forward_cpu_aten no longer refuses a
    biased layer while compiling, so an eager warmup no longer disables the declared CPU
    INDUCTOR level. New regression
    test_paro_biased_layer_compiles_after_an_eager_warmup[bf16|fp16] fails on the unfixed
    code and passes with the fix (compiled output matches eager, max abs diff 0.0).

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions