Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/192375
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit a516fbe with merge base 3601a49 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
|
|
The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:
Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows. |
|
CLA now signed |
|
This fixes a user-visible warning on the MPS backend, so the MPS release-note category is the most relevant. @pytorchbot label "release notes: mps" |
kurtamohler
left a comment
There was a problem hiding this comment.
I don't know too much about inductor, but this seems reasonable to me
|
@claude review this, will it change the behavior of any non-MPS backends? |
|
Claude finished @jansel's task in 10m 42s —— View job Review: does this change behavior on non-MPS backends?Short answer: no functional change on any backend — the return values are identical. What changes on non-MPS backends is when the log lines fire (fewer/later warnings), plus one narrow edge case worth a look. Detailed analysisTasks
1. Return value: provably unchangedBoth edits are pure reorderings of operands in an
No operand mutates state that another operand reads, so for CUDA / ROCm / XPU / MTIA / CPU the boolean result is bit-identical in every configuration. The CPU branch ( 2. What does change on non-MPS backends: log side effects
Also: the 3. One edge case worth flagging (low risk)
In practice every device that reaches inductor lowering is registered (cpu/cuda/xpu/mps/mtia/tpu, plus return (
(config.max_autotune or config.max_autotune_gemm or not check_max_autotune)
and _use_autotune_backend("TRITON")
and (is_gpu(layout.device.type) or layout.device.type == "cpu")
and has_backend_feature(layout.device, BackendFeature.TRITON_TEMPLATES)
and (...)
)Minor perf note in the other direction: 4. TestsNothing in 5. Nits
VerdictReordering is sound; no non-MPS backend changes what it compiles. Non-MPS backends with small/unsupported GPUs stop seeing an SM warning they shouldn't have seen in default mode, and are more likely to see it when they do enable max-autotune. The only thing I'd ask you to consider is the |
|
@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 -r |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
use_triton_template and use_cutlass_template called _use_template_for_gpu before checking autotune configuration and backend support. On MPS this reached is_big_gpu and warned about the SM count even though no Triton or CUTLASS template could be selected. Reorder the eligibility checks so irrelevant paths short-circuit before the SM heuristic. Keep the heuristic unchanged when templates are actual candidates; changing min_sms is a separate issue. Test Plan: ```bash TORCHINDUCTOR_FORCE_DISABLE_CACHES=1 /Users/kylekelley/books/reasoning-from-scratch/.venv/bin/python /Users/kylekelley/projects/pytorch/.context/verify_sm_warning.py TORCHINDUCTOR_FORCE_DISABLE_CACHES=1 /Users/kylekelley/books/reasoning-from-scratch/.venv/bin/python /Users/kylekelley/projects/pytorch/.context/verify_sm_warning.py --patched PATH="$PWD/.venv/bin:$PATH" .venv/bin/lintrunner -a --skip PYREFLY torch/_inductor/utils.py git diff --check origin/main...HEAD ``` PYREFLY was skipped because its whole-project analysis requires a built PyTorch checkout; all other configured linters for the changed file passed. This change was authored with Claude under human direction and reviewed and verified with Codex.
Co-authored-by: kurtamohler <[email protected]>
|
Successfully rebased |
6321192 to
a516fbe
Compare
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 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
|
@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 |
…ay (pytorch#192375) On Apple silicon, using the MPS backend, torch.compile emits a “Not enough SMs” warning. That warning is confusing: MPS is running on an Apple GPU, and neither Triton nor CUTLASS templates are candidates. AI-generated summary, reviewed by me: use_triton_template and use_cutlass_template evaluated the GPU-size heuristic before checking whether autotuning and the relevant template backend were enabled. Consequently, default-mode MPS compilation could report “Not enough SMs” even though neither Triton nor CUTLASS templates were candidates. Reorder the eligibility checks so unsupported template paths short-circuit before is_big_gpu. The existing small-GPU heuristic still applies whenever a template is genuinely under consideration. Testing: - With Inductor caches disabled, stock PyTorch 2.10 emitted the warning. - Applying the reordered Triton predicate suppressed the warning and compilation succeeded. AI assistance disclosure: Claude prepared the implementation under human direction. Codex reviewed it against current main, verified the reproduction, and rebased the branch. Pull Request resolved: pytorch#192375 Approved by: https://github.com/kurtamohler, https://github.com/jansel Co-authored-by: kurtamohler <[email protected]>
…ay (pytorch#192375) On Apple silicon, using the MPS backend, torch.compile emits a “Not enough SMs” warning. That warning is confusing: MPS is running on an Apple GPU, and neither Triton nor CUTLASS templates are candidates. AI-generated summary, reviewed by me: use_triton_template and use_cutlass_template evaluated the GPU-size heuristic before checking whether autotuning and the relevant template backend were enabled. Consequently, default-mode MPS compilation could report “Not enough SMs” even though neither Triton nor CUTLASS templates were candidates. Reorder the eligibility checks so unsupported template paths short-circuit before is_big_gpu. The existing small-GPU heuristic still applies whenever a template is genuinely under consideration. Testing: - With Inductor caches disabled, stock PyTorch 2.10 emitted the warning. - Applying the reordered Triton predicate suppressed the warning and compilation succeeded. AI assistance disclosure: Claude prepared the implementation under human direction. Codex reviewed it against current main, verified the reproduction, and rebased the branch. Pull Request resolved: pytorch#192375 Approved by: https://github.com/kurtamohler, https://github.com/jansel Co-authored-by: kurtamohler <[email protected]>
On Apple silicon, using the MPS backend, torch.compile emits a “Not enough SMs” warning. That warning is confusing: MPS is running on an Apple GPU, and neither Triton nor CUTLASS templates are candidates.
AI-generated summary, reviewed by me:
use_triton_template and use_cutlass_template evaluated the GPU-size heuristic before checking whether autotuning and the relevant template backend were enabled. Consequently, default-mode MPS compilation could report “Not enough SMs” even though neither Triton nor CUTLASS templates were candidates.
Reorder the eligibility checks so unsupported template paths short-circuit before is_big_gpu. The existing small-GPU heuristic still applies whenever a template is genuinely under consideration.
Testing:
AI assistance disclosure: Claude prepared the implementation under human direction. Codex reviewed it against current main, verified the reproduction, and rebased the branch.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo