Repository navigation
Conversation
gh-194490 was a 2.13 Inductor regression: a gather/scatter pair around a loop reduction produced Triton whose epilogue read a temporary defined only inside the reduction body, failing with `NameError: tmp19 is not defined`. It was found by a user training Dion3 through vllm-project/speculators, not by CI. The fix (gh-194786) added test_loop_epilogue_indirect_load_scope to test/inductor/test_indexing.py, which remains the authoritative test. That test compiles with `dynamic=True`, though, while the reported failure only appeared on the *second* compile, once a differing shape triggered automatic dynamic shapes. This check covers that path: two trials with different row counts and no `dynamic=` flag, so the first compiles statically and the second generalizes. Kept faithful to the reproducer where it matters. The `torch.where` over a tensor predicate is retained because the failure surfaced inside a `tl.where` in the epilogue; simplifying it to a plain lerp may not regenerate the same codegen. Shapes are shrunk from the reproducer's (6, 4096, 4096) to 2 x k x 4096, but the 4096-wide reduction dim is preserved deliberately so the reduction stays non-persistent and the loop path is actually emitted. Runs under the existing torch-compile gate (skipped on Python 3.15+ and on non-Linux/macOS targets) and additionally returns early without CUDA, so CPU and Windows wheels are unaffected. Tolerances are loose (rtol/atol 1e-4). The assertion that matters is that codegen succeeds at all; a 4096-wide reduction over bf16 inputs differs between eager and Inductor by reduction order alone, and a wheel check must not fail on that. Known limitation: coverage depends on the reduction staying non-persistent. If Inductor's persistent-reduction heuristic changes, this silently stops exercising the bug rather than failing -- noted in the docstring, with a pointer to the inductor test that does not have that dependency.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/195024
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 11 PendingAs of commit b53ef47 with merge base 14fb825 ( GREEN LIGHT - OUTDATED (earlier commit) - PR requires human review:
reason: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
- Removed `assert len(actual) == len(expected)` -- RUFF S101 flags bare asserts, and it was defensive noise over two fixed-length tuples. - Collapsed the `torch.stack(...)` call onto one line to satisfy PYFMT. - Cut the commentary down to the docstring plus two one-liners.
|
@pytorchmergebot merge -f "lint is green and infra failures are not related" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
test-infra's Release Binaries Validations checks out smoke_test.py from pytorch main but installs the published stable wheel. The regression check added in #195024 covers gh-194490, whose fix (#194786) landed after the 2.13 branch cut, so it reds all six linux CUDA 12.6 legs against the immutable 2.13.0 artifact with NameError('tmp19 is not defined'). Gate on the first release series containing the fix: 2.14, which has it via cherry-pick #194833. Reverting #195024 was the alternative, but it drops nightly coverage and leaves the next regression test added here to hit the same trap. Test Plan: 2.13.0 skips; 2.14.0, main and nightly run. ``` python -c " from torch.torch_version import TorchVersion for v in ['2.13.0+cu126','2.14.0+cu130','2.15.0a0+gitabc','2.15.0.dev20260829+cu126']: print(v, TorchVersion(v) < (2, 14)) " lintrunner -a --paths-cmd 'echo .ci/pytorch/smoke_test/smoke_test.py' ``` Authored with assistance from Claude Code. Pull Request resolved: #195306 Approved by: https://github.com/pytorchgreenlight, https://github.com/atalman
… (pytorch#195024) Adds a wheel-level regression check for pytorchgh-194490. ## What it covers that the existing test doesn't pytorchgh-194490 was a 2.13 Inductor regression — a gather/scatter pair around a loop reduction produced Triton whose epilogue read a temporary defined only inside the reduction body: ``` tmp41 = tl.where(tmp38, tmp40, tmp19) ^ NameError: tmp19 is not defined ``` It was found by a user training Dion3 through vllm-project/speculators, not by CI. The fix (pytorchgh-194786) added `test_loop_epilogue_indirect_load_scope` to `test/inductor/test_indexing.py`, and **that remains the authoritative test** — it asserts codegen structure via FileCheck, which this cannot. But it compiles with `dynamic=True`, whereas the reported failure only appeared on the **second** compile, once a differing shape triggered *automatic* dynamic shapes. Those are different paths. So this check does two trials with different row counts and no `dynamic=` flag: the first compiles statically, the second generalizes. That's the route users actually hit. ## Fidelity to the reproducer The `torch.where` over a tensor predicate is kept deliberately — the failure surfaced *inside* a `tl.where`, so simplifying it to a plain lerp risks not regenerating the same codegen. I had simplified it initially and put it back for that reason. Shapes shrink from the reproducer's `(6, 4096, 4096)` to `2 x k x 4096`, but the **4096-wide reduction dim is preserved on purpose** so the reduction stays non-persistent and the loop path is actually emitted. Smaller and it becomes a persistent reduction and stops covering the bug. ## Blast radius Runs under the existing torch-compile gate (already skipped on Python 3.15+ and non-Linux/macOS), and returns early without CUDA — so CPU and Windows wheels are unaffected. Roughly two `torch.compile` invocations on ~128K-element tensors. Tolerances are loose (`rtol/atol 1e-4`). The assertion that matters is that codegen succeeds at all; a 4096-wide reduction over bf16 inputs differs between eager and Inductor by reduction order alone, and a wheel check must not fail on that. ## Caveats, stated plainly **I could not run this** — no GPU on the machine I authored it on. Syntax and wiring are verified; the codegen behaviour is not. It needs one real run on a CUDA wheel before it's trusted. If it turns out the reduction goes persistent at these shapes, the test passes while covering nothing, and the reduction dim needs raising. **Coverage is heuristic-dependent.** If Inductor's persistent-reduction threshold changes, this silently stops exercising the bug rather than failing. That's noted in the docstring with a pointer to the inductor test, which has no such dependency. **On placement:** my own view is that compiler-codegen regressions belong in `test/inductor/`, not in the release smoke test — the smoke test validates that the binary works, and this adds a GPU-only, Triton-dependent, config-sensitive path to every wheel check. Adding it here anyway at @atalman's direction, since the escape happened on a release binary and the release gate is where he wants the net. Recording the tradeoff so the next person editing this file knows why it's here. --- Filed with the help of Claude Code. Pull Request resolved: pytorch#195024 Approved by: https://github.com/eellison, https://github.com/karthickai
…ch#195306) test-infra's Release Binaries Validations checks out smoke_test.py from pytorch main but installs the published stable wheel. The regression check added in pytorch#195024 covers pytorchgh-194490, whose fix (pytorch#194786) landed after the 2.13 branch cut, so it reds all six linux CUDA 12.6 legs against the immutable 2.13.0 artifact with NameError('tmp19 is not defined'). Gate on the first release series containing the fix: 2.14, which has it via cherry-pick pytorch#194833. Reverting pytorch#195024 was the alternative, but it drops nightly coverage and leaves the next regression test added here to hit the same trap. Test Plan: 2.13.0 skips; 2.14.0, main and nightly run. ``` python -c " from torch.torch_version import TorchVersion for v in ['2.13.0+cu126','2.14.0+cu130','2.15.0a0+gitabc','2.15.0.dev20260829+cu126']: print(v, TorchVersion(v) < (2, 14)) " lintrunner -a --paths-cmd 'echo .ci/pytorch/smoke_test/smoke_test.py' ``` Authored with assistance from Claude Code. Pull Request resolved: pytorch#195306 Approved by: https://github.com/pytorchgreenlight, https://github.com/atalman
… (pytorch#195024) Adds a wheel-level regression check for pytorchgh-194490. ## What it covers that the existing test doesn't pytorchgh-194490 was a 2.13 Inductor regression — a gather/scatter pair around a loop reduction produced Triton whose epilogue read a temporary defined only inside the reduction body: ``` tmp41 = tl.where(tmp38, tmp40, tmp19) ^ NameError: tmp19 is not defined ``` It was found by a user training Dion3 through vllm-project/speculators, not by CI. The fix (pytorchgh-194786) added `test_loop_epilogue_indirect_load_scope` to `test/inductor/test_indexing.py`, and **that remains the authoritative test** — it asserts codegen structure via FileCheck, which this cannot. But it compiles with `dynamic=True`, whereas the reported failure only appeared on the **second** compile, once a differing shape triggered *automatic* dynamic shapes. Those are different paths. So this check does two trials with different row counts and no `dynamic=` flag: the first compiles statically, the second generalizes. That's the route users actually hit. ## Fidelity to the reproducer The `torch.where` over a tensor predicate is kept deliberately — the failure surfaced *inside* a `tl.where`, so simplifying it to a plain lerp risks not regenerating the same codegen. I had simplified it initially and put it back for that reason. Shapes shrink from the reproducer's `(6, 4096, 4096)` to `2 x k x 4096`, but the **4096-wide reduction dim is preserved on purpose** so the reduction stays non-persistent and the loop path is actually emitted. Smaller and it becomes a persistent reduction and stops covering the bug. ## Blast radius Runs under the existing torch-compile gate (already skipped on Python 3.15+ and non-Linux/macOS), and returns early without CUDA — so CPU and Windows wheels are unaffected. Roughly two `torch.compile` invocations on ~128K-element tensors. Tolerances are loose (`rtol/atol 1e-4`). The assertion that matters is that codegen succeeds at all; a 4096-wide reduction over bf16 inputs differs between eager and Inductor by reduction order alone, and a wheel check must not fail on that. ## Caveats, stated plainly **I could not run this** — no GPU on the machine I authored it on. Syntax and wiring are verified; the codegen behaviour is not. It needs one real run on a CUDA wheel before it's trusted. If it turns out the reduction goes persistent at these shapes, the test passes while covering nothing, and the reduction dim needs raising. **Coverage is heuristic-dependent.** If Inductor's persistent-reduction threshold changes, this silently stops exercising the bug rather than failing. That's noted in the docstring with a pointer to the inductor test, which has no such dependency. **On placement:** my own view is that compiler-codegen regressions belong in `test/inductor/`, not in the release smoke test — the smoke test validates that the binary works, and this adds a GPU-only, Triton-dependent, config-sensitive path to every wheel check. Adding it here anyway at @atalman's direction, since the escape happened on a release binary and the release gate is where he wants the net. Recording the tradeoff so the next person editing this file knows why it's here. --- Filed with the help of Claude Code. Pull Request resolved: pytorch#195024 Approved by: https://github.com/eellison, https://github.com/karthickai
…ch#195306) test-infra's Release Binaries Validations checks out smoke_test.py from pytorch main but installs the published stable wheel. The regression check added in pytorch#195024 covers pytorchgh-194490, whose fix (pytorch#194786) landed after the 2.13 branch cut, so it reds all six linux CUDA 12.6 legs against the immutable 2.13.0 artifact with NameError('tmp19 is not defined'). Gate on the first release series containing the fix: 2.14, which has it via cherry-pick pytorch#194833. Reverting pytorch#195024 was the alternative, but it drops nightly coverage and leaves the next regression test added here to hit the same trap. Test Plan: 2.13.0 skips; 2.14.0, main and nightly run. ``` python -c " from torch.torch_version import TorchVersion for v in ['2.13.0+cu126','2.14.0+cu130','2.15.0a0+gitabc','2.15.0.dev20260829+cu126']: print(v, TorchVersion(v) < (2, 14)) " lintrunner -a --paths-cmd 'echo .ci/pytorch/smoke_test/smoke_test.py' ``` Authored with assistance from Claude Code. Pull Request resolved: pytorch#195306 Approved by: https://github.com/pytorchgreenlight, https://github.com/atalman
Adds a wheel-level regression check for gh-194490.
What it covers that the existing test doesn't
gh-194490 was a 2.13 Inductor regression — a gather/scatter pair around a loop reduction produced Triton whose epilogue read a temporary defined only inside the reduction body:
It was found by a user training Dion3 through vllm-project/speculators, not by CI.
The fix (gh-194786) added
test_loop_epilogue_indirect_load_scopetotest/inductor/test_indexing.py, and that remains the authoritative test — it asserts codegen structure via FileCheck, which this cannot. But it compiles withdynamic=True, whereas the reported failure only appeared on the second compile, once a differing shape triggered automatic dynamic shapes. Those are different paths.So this check does two trials with different row counts and no
dynamic=flag: the first compiles statically, the second generalizes. That's the route users actually hit.Fidelity to the reproducer
The
torch.whereover a tensor predicate is kept deliberately — the failure surfaced inside atl.where, so simplifying it to a plain lerp risks not regenerating the same codegen. I had simplified it initially and put it back for that reason.Shapes shrink from the reproducer's
(6, 4096, 4096)to2 x k x 4096, but the 4096-wide reduction dim is preserved on purpose so the reduction stays non-persistent and the loop path is actually emitted. Smaller and it becomes a persistent reduction and stops covering the bug.Blast radius
Runs under the existing torch-compile gate (already skipped on Python 3.15+ and non-Linux/macOS), and returns early without CUDA — so CPU and Windows wheels are unaffected. Roughly two
torch.compileinvocations on ~128K-element tensors.Tolerances are loose (
rtol/atol 1e-4). The assertion that matters is that codegen succeeds at all; a 4096-wide reduction over bf16 inputs differs between eager and Inductor by reduction order alone, and a wheel check must not fail on that.Caveats, stated plainly
I could not run this — no GPU on the machine I authored it on. Syntax and wiring are verified; the codegen behaviour is not. It needs one real run on a CUDA wheel before it's trusted. If it turns out the reduction goes persistent at these shapes, the test passes while covering nothing, and the reduction dim needs raising.
Coverage is heuristic-dependent. If Inductor's persistent-reduction threshold changes, this silently stops exercising the bug rather than failing. That's noted in the docstring with a pointer to the inductor test, which has no such dependency.
On placement: my own view is that compiler-codegen regressions belong in
test/inductor/, not in the release smoke test — the smoke test validates that the binary works, and this adds a GPU-only, Triton-dependent, config-sensitive path to every wheel check. Adding it here anyway at @atalman's direction, since the escape happened on a release binary and the release gate is where he wants the net. Recording the tradeoff so the next person editing this file knows why it's here.Filed with the help of Claude Code.