Repository navigation
Conversation
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - OUTDATED (earlier commit) - Ready for human review:
Findings (1): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/205740
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit c7292bf with merge base 768d194 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot review |
There was a problem hiding this comment.
Automated review of 427fd32: nothing blocking; ready for human review.
The PR realizes the addmm bias once, before mm_args, so on max-autotune a MultiTemplateBuffer finalized to the extern ATen choice no longer reads a buffer removed as dead code; the earlier blocking cpp_wrapper FileCheck failure is fixed. Recommendation: Approve the one remaining point is non-blocking test hardening.
⚪ 1 non-blocking finding
pytorch/test/inductor/test_max_autotune.py
Line 1219 in 427fd32
Non-blocking: in test_addmm_strided_bias_extern_fallback, the FileCheck shows the ATen addmm kernel was emitted, but not that a MultiTemplateBuffer was created and then finalized to it. test_configs.force_extern_kernel_in_multi_template is only read in Scheduler.finalize_multi_template_buffers. Without a MultiTemplateBuffer the extern choice reads its own input and the bug can't occur, yet the FileCheck still passes. No MultiTemplateBuffer is created if only one choice remains (select_algorithm.py:4561-4565), TORCHINDUCTOR_BENCHMARK_TEMPLATE_FUSION=0 is set, or deterministic is set. Fix: also assert the MultiTemplateBuffer exists, like test_mutation_rename does (~lines 1850-1899): check "MultiTemplateBuffer" in the ir_pre_fusion log and "ExternKernelSchedulerNode" in the ir_post_fusion log. Mitigation: in today's CI the test does exercise the bug, because the suite only runs under is_big_gpu() and the Triton template adds a second choice.
This review is AI-generated and advisory. Each new automated review replaces the previous one. Report a bad review
Withdrawn: the automated review of 427fd32 found nothing blocking.
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: Remote end closed connection without response Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 2 jobs have failed, first few of them are: trunk / win-vs2022-cpu-py3 / test (default, 9, 12, windows.4xlarge.nonephemeral), trunk / win-vs2022-cpu-py3 / test (default, 11, 12, windows.4xlarge.nonephemeral) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
427fd32 to
c7292bf
Compare
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Linked issue or supporting maintainer
Fixes #204950
BC-breaking?
No
Summary (human written only)
Compiling with
max_autotunecrashes on the first call (NameError: buf3) when anaddmmhas a non-contiguous bias.The reporter hit it through a 1x1 convolution.
The change makes the bias realized once, and in the autotune path the ATen candidates read the same buffer the templates do.
The plain non-autotune path is unchanged, and so is
beta == 0without autotuning.Agent details (if applicable)
Used tool is Cursor with Claude Opus 5.5: produced repro that showed
buf3being dropped as dead code, initial patch draft, the regression test, and the GPU verification scripts.Since #180270,
tuned_addmmrealizes the bias twice: the GEMM templates read the copymm_argsexpands, and the ATen choices read a separaterealize_inputs(inp)copy. TheMultiTemplateBufferdepends only on the first, so the second is eliminated as dead, and finalizing to the ATen choice (forced in the issue by a layout conflict on the weight) emitsextern_kernels.addmm(buf3, ...)withbuf3never computed.inp_expandedis now a stride-0 view of the realized bias, and withbeta == 0the autotune-path ATen choices read the zeros the templates read. That keeps an[N]zeros fill even when ATen is the only choice; switching ATen to the zeros only when a template is added, astuned_baddbmmdoes, is left for a follow-up.Test results
Run on H100 and GB200 against a nightly at cb41f4e (Triton 3.9.0), with the new test added before the fix:
The 4 failures before the fix are
test_addmm_strided_bias_extern_fallback(beta0 and 1, inTestMaxAutotuneandTestMaxAutotuneAsyncPipelined); no other test changes result. The reproducer from #204950 raisesNameErrorbefore the fix and matches eager after it on both GPUs, as do its variants with contiguous inputs, ATen-only and Triton-only GEMM backends,benchmark_template_fusion=False, and anaddmmwhose bias is a view of a Triton GEMM input.