Repository navigation
[test] Skip Inductor-on-CUDA tests when Triton is unavailable - #199447
nkhasbag-nv wants to merge 1 commit into
Conversation
PR Status: missing actionable issueAuto PR Triage did not find either of the following when it checked this PR:
Such PRs are a low priority for maintainers to review and might not get a response given the very high volume of PRs we receive. Please focus on If one of these applies, add the matching line to the PR description. If there is no 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/199447
Note: Links to docs will display an error until the docs builds have been completed.
|
|
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. |
The first day of shadow runs on pytorch/pytorch (347 runs, 01:53-14:10 UTC on 2026-10-02) found three problems. 1. Ten eligible PRs were never analyzed. The labeler adds several labels to a new PR in the same second, and every label event queued a run in the same per-PR concurrency group. GitHub keeps one pending run per group, so a later label's run replaced the pending `open source` run and then skipped itself. For example, "Remove unused parameters in autograd" got five runs at 07:12:28: both eligible runs were cancelled and the other three skipped. Now only entry events (the `open source` label and ready_for_review) share the per-PR group; every other event gets its own group keyed by run id. Entry events still run one at a time per PR. 2. Four runs (#199436, #199440, #199463, #199484) failed with Claude Code's `error_max_structured_output_retries`: the worker produced no schema-valid output within the default 5 attempts. Many successful runs also needed a retry (4 turns instead of 2). MAX_STRUCTURED_OUTPUT_RETRIES is now 25. Every attempt is a turn, so --max-turns goes from 5 to 30. A failed run cost about $0.02 per attempt, so --max-budget-usd goes from 0.50 to 1.50. When the SDK errors like this, the action writes no execution log and leaves `execution_file` empty. Stage 2c then opened `Path("")`, which is `.`, and recorded "IsADirectoryError" as the processing error. It now records "Claude action wrote no execution log". 3. Eight runs failed the evidence-excerpt check. One cut a long line short (the case that started this change, #199425). Five skipped lines inside an excerpt (#197857, #199447, #199471, #199472, #199497). Two turned an unchanged context line, which also appeared in the `@@` hunk header, into a fake `-`/`+` pair (#199453, #199461). The worker prompt now says to keep excerpts short by choosing a shorter run of adjacent lines, never by skipping or cutting lines, and never to turn unchanged lines or hunk-header text into changed lines. The validator stays strict: a mismatched excerpt can't be told apart from an invented one, and a failed run falls back to human triage. The replay below shows the wording fixes the hunk-header pattern but only partly helps the other two, so a structural follow-up is still needed. The same change is being made to pytorch/pytorch and pytorch/ciforge. Test Plan: ``` cd scripts/auto_pr_triage && python -m unittest discover -p 'test_*.py' actionlint .github/workflows/auto-pr-triage.yml ``` The worker was replayed locally (claude-sonnet-4-6, --effort low, the CI flags and the old 5-attempt limits) on the exact inputs of three failed runs: each run's patch at its analyzed head_sha and CODEOWNERS at its workflow_sha. Outputs were checked with validate_result. Evidence-excerpt failures: | PR (pattern) | old worker.md | new worker.md | |--------------------------------------|---------------|---------------| | #199461 (fake -/+ from hunk header) | 2/3 | 0/3 | | #197857 (skipped comment lines) | 4/4 | 2/3 | | #199425 (cut a long comment line) | 2/5 | 3/5 | The remaining failures still drop two comment lines from the middle of an excerpt (#197857) or stop a long comment line at the end of a sentence (#199425). This PR was authored with an AI assistant (Claude Code). ghstack-source-id: d937117 Pull-Request-resolved: #199428
The first day of shadow runs on pytorch/pytorch (347 runs, 01:53-14:10 UTC on 2026-10-02) found three problems. 1. Ten eligible PRs were never analyzed. The labeler adds several labels to a new PR in the same second, and every label event queued a run in the same per-PR concurrency group. GitHub keeps one pending run per group, so a later label's run replaced the pending `open source` run and then skipped itself. For example, "Remove unused parameters in autograd" got five runs at 07:12:28: both eligible runs were cancelled and the other three skipped. Now only entry events (the `open source` label and ready_for_review) share the per-PR group; every other event gets its own group keyed by run id. Entry events still run one at a time per PR. 2. Four runs (#199436, #199440, #199463, #199484) failed with Claude Code's `error_max_structured_output_retries`: the worker produced no schema-valid output within the default 5 attempts. Many successful runs also needed a retry (4 turns instead of 2). MAX_STRUCTURED_OUTPUT_RETRIES is now 25. Every attempt is a turn, so --max-turns goes from 5 to 30. A failed run cost about $0.02 per attempt, so --max-budget-usd goes from 0.50 to 1.50. When the SDK errors like this, the action writes no execution log and leaves `execution_file` empty. Stage 2c then opened `Path("")`, which is `.`, and recorded "IsADirectoryError" as the processing error. It now records "Claude action wrote no execution log". 3. Eight runs failed the evidence-excerpt check. One cut a long line short (the case that started this change, #199425). Five skipped lines inside an excerpt (#197857, #199447, #199471, #199472, #199497). Two turned an unchanged line, which also appeared in the `@@` hunk header, into a fake `-`/`+` pair (#199453, #199461). The worker prompt still asks for whole, adjacent lines, and now also says never to cut or skip lines or to turn unchanged lines or hunk-header text into changed lines. A local replay showed that wording alone does not stop the model from dropping comment lines or stopping a long line at the end of a sentence, so the validator is relaxed as a safety net. Every excerpt line must still come from the file's patch, in patch order, but lines may be skipped in between, and a line may stop early if it keeps some text after its marker. Every character shown still comes from the patch, so the model still cannot add text; what we give up is that an excerpt may show two lines without the lines between them. A fake `-`/`+` pair is still rejected, because it claims an unchanged line changed. We also considered having the model cite patch line ranges and extracting the excerpt in the controller, which removes these failures by construction. The relaxed check fixes almost all of them with a much smaller change. The same change is being made to pytorch/pytorch and pytorch/ciforge. Test Plan: ``` cd scripts/auto_pr_triage && python -m unittest discover -p 'test_*.py' actionlint .github/workflows/auto-pr-triage.yml ``` The worker was replayed locally (claude-sonnet-4-6, --effort low, the CI flags and the old 5-attempt limits) on the exact inputs of the eight runs that failed the excerpt check: each run's patch at its analyzed head_sha and CODEOWNERS at its workflow_sha. Outputs were checked with validate_result. | Prompt and check | Excerpt failures | |--------------------------------------|------------------| | old worker.md, old check (3 PRs) | 8/12 | | new worker.md, old check (3 PRs) | 5/11 | | new worker.md, relaxed check (8 PRs) | 1/21 | Re-checking the eight original CI outputs with the relaxed check, six pass. The two that still fail (#199453, #199461), and the one replay failure (#199453), are all the fake `-`/`+` pair, which stays rejected. An extra prompt example aimed at that pattern made it worse in a replay, so it is not included. This PR was authored with an AI assistant (Claude Code). ghstack-source-id: 546c754 Pull-Request-resolved: #199428
…99428) The first day of shadow runs on pytorch/pytorch (347 runs, 01:53-14:10 UTC on 2026-10-02) found three problems. 1. Ten eligible PRs were never analyzed. The labeler adds several labels to a new PR in the same second, and every label event queued a run in the same per-PR concurrency group. GitHub keeps one pending run per group, so a later label's run replaced the pending `open source` run and then skipped itself. For example, "Remove unused parameters in autograd" got five runs at 07:12:28: both eligible runs were cancelled and the other three skipped. Now only entry events (the `open source` label and ready_for_review) share the per-PR group; every other event gets its own group keyed by run id. Entry events still run one at a time per PR. 2. Four runs (#199436, #199440, #199463, #199484) failed with Claude Code's `error_max_structured_output_retries`: the worker produced no schema-valid output within the default 5 attempts. Many successful runs also needed a retry (4 turns instead of 2). MAX_STRUCTURED_OUTPUT_RETRIES is now 25. Every attempt is a turn, so --max-turns goes from 5 to 30. A failed run cost about $0.02 per attempt, so --max-budget-usd goes from 0.50 to 1.50. When the SDK errors like this, the action writes no execution log and leaves `execution_file` empty. Stage 2c then opened `Path("")`, which is `.`, and recorded "IsADirectoryError" as the processing error. It now records "Claude action wrote no execution log". 3. Eight runs failed the evidence-excerpt check. One cut a long line short (the case that started this change, #199425). Five skipped lines inside an excerpt (#197857, #199447, #199471, #199472, #199497). Two turned an unchanged line, which also appeared in the `@@` hunk header, into a fake `-`/`+` pair (#199453, #199461). The worker prompt still asks for whole, adjacent lines, and now also says never to cut or skip lines or to turn unchanged lines or hunk-header text into changed lines. A local replay showed that wording alone does not stop the model from dropping comment lines or stopping a long line at the end of a sentence, so the validator is relaxed as a safety net. Every excerpt line must still come from the file's patch, in patch order, but lines may be skipped in between, and a line may stop early if it keeps some text after its marker. Every character shown still comes from the patch, so the model still cannot add text; what we give up is that an excerpt may show two lines without the lines between them. A fake `-`/`+` pair is still rejected, because it claims an unchanged line changed. We also considered having the model cite patch line ranges and extracting the excerpt in the controller, which removes these failures by construction. The relaxed check fixes almost all of them with a much smaller change. The same change is being made to pytorch/pytorch and pytorch/ciforge. Test Plan: ``` cd scripts/auto_pr_triage && python -m unittest discover -p 'test_*.py' actionlint .github/workflows/auto-pr-triage.yml ``` The worker was replayed locally (claude-sonnet-4-6, --effort low, the CI flags and the old 5-attempt limits) on the exact inputs of the eight runs that failed the excerpt check: each run's patch at its analyzed head_sha and CODEOWNERS at its workflow_sha. Outputs were checked with validate_result. | Prompt and check | Excerpt failures | |--------------------------------------|------------------| | old worker.md, old check (3 PRs) | 8/12 | | new worker.md, old check (3 PRs) | 5/11 | | new worker.md, relaxed check (8 PRs) | 1/21 | Re-checking the eight original CI outputs with the relaxed check, six pass. The two that still fail (#199453, #199461), and the one replay failure (#199453), are all the fake `-`/`+` pair, which stays rejected. An extra prompt example aimed at that pattern made it worse in a replay, so it is not included. This PR was authored with an AI assistant (Claude Code). Pull Request resolved: #199428 Approved by: https://github.com/janeyx99
b425f30 to
ab31c4b
Compare
|
@liangel-02 Could you review this change please? |
…torch#199428) The first day of shadow runs on pytorch/pytorch (347 runs, 01:53-14:10 UTC on 2026-10-02) found three problems. 1. Ten eligible PRs were never analyzed. The labeler adds several labels to a new PR in the same second, and every label event queued a run in the same per-PR concurrency group. GitHub keeps one pending run per group, so a later label's run replaced the pending `open source` run and then skipped itself. For example, "Remove unused parameters in autograd" got five runs at 07:12:28: both eligible runs were cancelled and the other three skipped. Now only entry events (the `open source` label and ready_for_review) share the per-PR group; every other event gets its own group keyed by run id. Entry events still run one at a time per PR. 2. Four runs (pytorch#199436, pytorch#199440, pytorch#199463, pytorch#199484) failed with Claude Code's `error_max_structured_output_retries`: the worker produced no schema-valid output within the default 5 attempts. Many successful runs also needed a retry (4 turns instead of 2). MAX_STRUCTURED_OUTPUT_RETRIES is now 25. Every attempt is a turn, so --max-turns goes from 5 to 30. A failed run cost about $0.02 per attempt, so --max-budget-usd goes from 0.50 to 1.50. When the SDK errors like this, the action writes no execution log and leaves `execution_file` empty. Stage 2c then opened `Path("")`, which is `.`, and recorded "IsADirectoryError" as the processing error. It now records "Claude action wrote no execution log". 3. Eight runs failed the evidence-excerpt check. One cut a long line short (the case that started this change, pytorch#199425). Five skipped lines inside an excerpt (pytorch#197857, pytorch#199447, pytorch#199471, pytorch#199472, pytorch#199497). Two turned an unchanged line, which also appeared in the `@@` hunk header, into a fake `-`/`+` pair (pytorch#199453, pytorch#199461). The worker prompt still asks for whole, adjacent lines, and now also says never to cut or skip lines or to turn unchanged lines or hunk-header text into changed lines. A local replay showed that wording alone does not stop the model from dropping comment lines or stopping a long line at the end of a sentence, so the validator is relaxed as a safety net. Every excerpt line must still come from the file's patch, in patch order, but lines may be skipped in between, and a line may stop early if it keeps some text after its marker. Every character shown still comes from the patch, so the model still cannot add text; what we give up is that an excerpt may show two lines without the lines between them. A fake `-`/`+` pair is still rejected, because it claims an unchanged line changed. We also considered having the model cite patch line ranges and extracting the excerpt in the controller, which removes these failures by construction. The relaxed check fixes almost all of them with a much smaller change. The same change is being made to pytorch/pytorch and pytorch/ciforge. Test Plan: ``` cd scripts/auto_pr_triage && python -m unittest discover -p 'test_*.py' actionlint .github/workflows/auto-pr-triage.yml ``` The worker was replayed locally (claude-sonnet-4-6, --effort low, the CI flags and the old 5-attempt limits) on the exact inputs of the eight runs that failed the excerpt check: each run's patch at its analyzed head_sha and CODEOWNERS at its workflow_sha. Outputs were checked with validate_result. | Prompt and check | Excerpt failures | |--------------------------------------|------------------| | old worker.md, old check (3 PRs) | 8/12 | | new worker.md, old check (3 PRs) | 5/11 | | new worker.md, relaxed check (8 PRs) | 1/21 | Re-checking the eight original CI outputs with the relaxed check, six pass. The two that still fail (pytorch#199453, pytorch#199461), and the one replay failure (pytorch#199453), are all the fake `-`/`+` pair, which stays rejected. An extra prompt example aimed at that pattern made it worse in a replay, so it is not included. This PR was authored with an AI assistant (Claude Code). Pull Request resolved: pytorch#199428 Approved by: https://github.com/janeyx99
ab31c4b to
04ac777
Compare
|
All jobs have passed, could you review this please @liangel-02? |
These tests compile with Inductor on CUDA but only checked for a GPU. Without a working Triton, Inductor's scheduler raises TritonMissing, so they failed instead of skipping (seen in the Windows RTX OOT CI). Add Triton checks scoped to how each test is created: plain triton_utils decorators for tests that aren't per device or only run on GPUs, and CUDA-only skips for device-generic tests so the CPU versions, which don't need Triton, keep running. XPU behavior is unchanged. Test Plan: On CUDA without Triton these tests should skip: python test/higher_order_ops/test_invoke_subgraph.py -k test_return_none python test/test_precompile.py -k "TestPrecompileNumerics or test_cache_bundles_autotune_artifacts or test_cache_reload_without_eager_static_launcher_rehydration" python test/test_varlen_attention.py -k test_block_table_kv_cache python test/inductor/test_warnings.py -k test_trivial_matmul_compile_no_user_warning python test/test_reductions.py -k test_nansum_int_out_dtype_matches_inductor Authored with the help of an AI assistant.
04ac777 to
8e70592
Compare
These tests compile with Inductor on CUDA but only checked for a GPU. Without a working Triton, Inductor's scheduler raises
TritonMissing, so they failed instead of skipping (seen in the Windows RTX OOT CI).Add Triton checks scoped to how each test is created: plain triton_utils decorators for tests that aren't per device or only run on GPUs, and CUDA-only skips for device-generic tests so the CPU versions, which don't need Triton, keep running. XPU behavior is unchanged.
Test Plan:
On CUDA without Triton these tests should skip:
Fixes #199563
Authored with the help of an AI assistant.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo