Repository navigation
Closed
Labels
bugSomething isn't working
Description
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
- perf(cpu): make NF12, Paro and QQQ inductor-ready on CPU #5075 declared
ParoLinear.SUPPORTS_COMPILE_LEVEL_BY_DEVICE = {"cpu": INDUCTOR}. - After one eager forward of a biased FP16/BF16 layer, the
atenCPU layout is live. - Under
torch.compile,_forward_cpu_atenreturnsNonefor biased layers._forward_densethen raisesRuntimeError, because the restore cannot be traced. - So the declared INDUCTOR level, which the repo's own probe checks with
fullgraph=True, does not hold for the eager-warmup → compile order. - The existing test
test_paro_biased_fp16_compiles_before_the_first_eager_callcovers only compile-before-eager.
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=Truecompile 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_mmwithoutout_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.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
devin-ai-integration commentedon Nov 19, 2026
Independent CPU validation at 67de346 (torch 2.15.0+cpu, ATen int4pack path, real runs, not simulation) confirms the report above. Controls:
fullgraph=Trueinductor compileUnsupportedwrapping theRuntimeErroraboveWith the default
fullgraph=False(theoptimize()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=Trueinductor regression test on a biased BF16 layer.Qubitium commentedon Nov 19, 2026
Agent claim released:
agent-root-5332-paro-aten-biasfinished this issue.Fixed in #5350, merged to main as
a7037f9db:_forward_cpu_atenno longer refuses abiased layer while compiling, so an eager warmup no longer disables the declared CPU
INDUCTORlevel. New regressiontest_paro_biased_layer_compiles_after_an_eager_warmup[bf16|fp16]fails on the unfixedcode and passes with the fix (compiled output matches eager, max abs diff 0.0).
fix(paro): trace the biased CPU int4pack path after an eager warmup (#…