Skip to content

[ROCM][inductor][UT] Enable Inductor-Triton debug asserts on ROCm - #186422

Closed
naromero77amd wants to merge 3 commits into
pytorch:mainfrom
naromero77amd:rocm-enable-hip-triton-debug-assert
Closed

naromero77amd wants to merge 3 commits into
pytorch:mainfrom
naromero77amd:rocm-enable-hip-triton-debug-assert

Conversation

@naromero77amd

@naromero77amd naromero77amd commented Jun 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Enable Triton debug/assert metadata for HIP Inductor kernels instead of dropping it on ROCm.
  • Remove the ROCm skip from MinifierIsolateTests.test_after_aot_gpu_runtime_error and make the test validate the ROCm assertion text.

Context

  • The HIP debug guard was introduced in [ROCM] Do not send "debug"=True down to triton.compile #99756 because ROCm Triton did not support tl.device_assert at the time.
  • ROCm Triton now supports device-side asserts when Triton debug is enabled.
  • Inductor already enables Triton debug from assert_indirect_indexing on CUDA; this makes HIP follow that same path.
  • Locally, the injected runtime assert now fires and the AOT minifier runtime-error test completes successfully on ROCm.

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @pragupta @jerrymannil @xinyazhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben

@pytorch-bot

pytorch-bot Bot commented Jun 5, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/186422

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 1 Unrelated Failure, 3 Unclassified Failures

As of commit 452b56d with merge base c35920b (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

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.

@pytorch-bot pytorch-bot Bot added ciflow/inductor ciflow/torchtitan Run TorchTitan integration tests module: inductor module: rocm AMD GPU support for Pytorch labels Jun 5, 2026
@naromero77amd naromero77amd added ciflow/inductor-rocm-mi300 Trigger "inductor" config CI on ROCm MI300/MI325 ciflow/inductor-rocm-mi355 Trigger "inductor" config CI on ROCm MI355 labels Jun 5, 2026
@naromero77amd naromero77amd changed the title [inductor] Enable Triton debug asserts on ROCm [ROCM][inductor] Enable Inductor debug asserts on ROCm Jun 5, 2026
@naromero77amd naromero77amd changed the title [ROCM][inductor] Enable Inductor debug asserts on ROCm [ROCM][inductor] Enable Inductor-Triton debug asserts on ROCm Jun 5, 2026
@naromero77amd

Copy link
Copy Markdown
Collaborator Author

@pytorchbot lint-fix

@pytorch-bot

pytorch-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: argument command: invalid choice: 'lint-fix' (choose from 'merge', 'revert', 'rebase', 'label', 'drci', 'lint', 'fix-lint', 'apply-lint', 'cherry-pick')

usage: @pytorchbot [-h]
                   
                   {merge,revert,rebase,label,drci,lint,fix-lint,apply-lint,cherry-pick}
                   ...

Try @pytorchbot --help for more info.

@naromero77amd

Copy link
Copy Markdown
Collaborator Author

@pytorchbot fix-lint

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Successfully applied lint patches in https://github.com/pytorch/pytorch/actions/runs/27042505463. Please pull locally before pushing more changes.

@naromero77amd naromero77amd changed the title [ROCM][inductor] Enable Inductor-Triton debug asserts on ROCm [ROCM][inductor][UT] Enable Inductor-Triton debug asserts on ROCm Jun 5, 2026
@naromero77amd

Copy link
Copy Markdown
Collaborator Author

@claude Please confirm that test_after_aot_gpu_runtime_error ran on MI300 and passed. Also, please confirm that there are no timeouts on the AMD workflows.

@claude

claude Bot commented Jun 8, 2026 •

Copy link
Copy Markdown

Claude finished @naromero77amd's task in 7m 34s —— View job


CI Results for AMD Workflows

  • Check CI status for AMD/ROCm workflows
  • Check for test_after_aot_gpu_runtime_error on MI300
  • Check for timeouts on AMD workflows

Findings

Overall CI status: Both inductor-rocm-mi300 and inductor-rocm-mi355 workflows passed (all jobs green).

Workflow Status Link
inductor-rocm-mi300 ✅ Success Run
inductor-rocm-mi355 ✅ Success Run

Timeouts: Zero timed-out runs across all workflows for this PR.

Regarding test_after_aot_gpu_runtime_error: After inspecting the MI300 job logs for both shards, I found that test_minifier_isolate was not selected for execution by target determination in this CI run. The shards ran:

  • Shard 1: test_torch, test_ops, test_modules, test_ops_gradients, then inductor/test_torchinductor, inductor/test_torchinductor_opinfo, inductor/test_aot_inductor, inductor/test_cpu_select_algorithm, inductor/test_origami
  • Shard 2: test_torch, test_ops, test_modules, test_ops_gradients, then inductor/test_torchinductor, inductor/test_torchinductor_opinfo, inductor/test_aot_inductor, inductor/test_cpu_select_algorithm

Target determination didn't include inductor/test_minifier_isolate in either shard, likely because the changed files (test/inductor/test_minifier_isolate.py and torch/_inductor/runtime/triton_heuristics.py) weren't mapped to that test file by the TD system in this particular run.

Summary: The AMD workflows all passed with no failures or timeouts, but test_after_aot_gpu_runtime_error specifically was not selected to run by target determination. To explicitly confirm the test passes on MI300, you could trigger a manual re-run with TD disabled, or use @pytorchbot rebase to force a full CI run.


@naromero77amd naromero77amd added the ci-no-td Do not run TD on this PR label Jun 8, 2026
@naromero77amd

Copy link
Copy Markdown
Collaborator Author

@pytorchbot rebase

@naromero77amd naromero77amd added the ciflow/inductor-rocm-mi200 Trigger "inductor" config CI on ROCm MI200 label Jun 8, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Successfully rebased rocm-enable-hip-triton-debug-assert onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout rocm-enable-hip-triton-debug-assert && git pull --rebase)

@ezyang ezyang added the topic: improvements topic category label Jun 10, 2026
@naromero77amd

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge -i

@naromero77amd

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge -i

@naromero77amd
naromero77amd deleted the rocm-enable-hip-triton-debug-assert branch June 10, 2026 17:07
jemitche1 pushed a commit to jemitche1/pytorch that referenced this pull request Jun 13, 2026
…torch#186422)

## Summary
- Enable Triton debug/assert metadata for HIP Inductor kernels instead of dropping it on ROCm.
- Remove the ROCm skip from `MinifierIsolateTests.test_after_aot_gpu_runtime_error` and make the test validate the ROCm assertion text.

## Context
- The HIP debug guard was introduced in pytorch#99756 because ROCm Triton did not support `tl.device_assert` at the time.
- ROCm Triton now supports device-side asserts when Triton debug is enabled.
- Inductor already enables Triton debug from `assert_indirect_indexing` on CUDA; this makes HIP follow that same path.
- Locally, the injected runtime assert now fires and the AOT minifier runtime-error test completes successfully on ROCm.

Pull Request resolved: pytorch#186422
Approved by: https://github.com/ezyang

Co-authored-by: Cursor <[email protected]>
Co-authored-by: PyTorch MergeBot <[email protected]>
@ezyang

ezyang commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

This is getting reverted because it makes Inductor incompatible with Triton versions that don't support debug assert. We need an appropriate version guard.

@ezyang ezyang mentioned this pull request Jun 23, 2026
@ezyang

ezyang commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

version guard:

So it should be this PR: triton-lang/triton#9055 which is Triton 3.7 (it just misses the Triton 3.6 cut point).

@meta-codesync

meta-codesync Bot commented Jun 23, 2026

Copy link
Copy Markdown

@pytorchbot revert -m="Diff reverted internally" -c="ghfirst"

This Pull Request has been reverted by a revert inside Meta. To re-land this change, please open another pull request, assign the same reviewers, fix the CI failures that caused the revert and make sure that the failing CI runs on the PR by applying the proper ciflow label (e.g., ciflow/trunk).)

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@naromero77amd your PR has been successfully reverted.

@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Jun 23, 2026
pytorchmergebot added a commit that referenced this pull request Jun 30, 2026
…ROCm (#188075)

## Summary
- Reland the ROCm Inductor-Triton debug assert enablement from #186422.
- Guard the HIP path on Triton 3.7+, which is the first Triton release with the required debug assert support.
- Gate the ROCm minifier test on the same Triton version check and add a focused heuristic unit test for the guard.

## Context
- The previous version of this change was reverted because it broke compatibility with Triton versions that predate debug assert support on ROCm.
- This reland keeps the ROCm path disabled on older Triton builds while preserving the intended behavior on supported Triton versions.
- This branch cherry-picks the original PR commits with `-x` and layers the ROCm Triton version guard on top.

## Old PR
- Previous attempt: #186422

Made with [Cursor](https://cursor.com)

Pull Request resolved: #188075
Approved by: https://github.com/ezyang, https://github.com/jansel

Co-authored-by: Cursor <[email protected]>
Co-authored-by: PyTorch MergeBot <[email protected]>
Co-authored-by: Edward Z. Yang via mergedog <[email protected]>
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…torch#186422)

## Summary
- Enable Triton debug/assert metadata for HIP Inductor kernels instead of dropping it on ROCm.
- Remove the ROCm skip from `MinifierIsolateTests.test_after_aot_gpu_runtime_error` and make the test validate the ROCm assertion text.

## Context
- The HIP debug guard was introduced in pytorch#99756 because ROCm Triton did not support `tl.device_assert` at the time.
- ROCm Triton now supports device-side asserts when Triton debug is enabled.
- Inductor already enables Triton debug from `assert_indirect_indexing` on CUDA; this makes HIP follow that same path.
- Locally, the injected runtime assert now fires and the AOT minifier runtime-error test completes successfully on ROCm.

Pull Request resolved: pytorch#186422
Approved by: https://github.com/ezyang

Co-authored-by: Cursor <[email protected]>
Co-authored-by: PyTorch MergeBot <[email protected]>
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
vishalgoyal316 pushed a commit to vishalgoyal316/pytorch that referenced this pull request Jul 16, 2026
…ROCm (pytorch#188075)

## Summary
- Reland the ROCm Inductor-Triton debug assert enablement from pytorch#186422.
- Guard the HIP path on Triton 3.7+, which is the first Triton release with the required debug assert support.
- Gate the ROCm minifier test on the same Triton version check and add a focused heuristic unit test for the guard.

## Context
- The previous version of this change was reverted because it broke compatibility with Triton versions that predate debug assert support on ROCm.
- This reland keeps the ROCm path disabled on older Triton builds while preserving the intended behavior on supported Triton versions.
- This branch cherry-picks the original PR commits with `-x` and layers the ROCm Triton version guard on top.

## Old PR
- Previous attempt: pytorch#186422

Made with [Cursor](https://cursor.com)

Pull Request resolved: pytorch#188075
Approved by: https://github.com/ezyang, https://github.com/jansel

Co-authored-by: Cursor <[email protected]>
Co-authored-by: PyTorch MergeBot <[email protected]>
Co-authored-by: Edward Z. Yang via mergedog <[email protected]>
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…torch#186422)

## Summary
- Enable Triton debug/assert metadata for HIP Inductor kernels instead of dropping it on ROCm.
- Remove the ROCm skip from `MinifierIsolateTests.test_after_aot_gpu_runtime_error` and make the test validate the ROCm assertion text.

## Context
- The HIP debug guard was introduced in pytorch#99756 because ROCm Triton did not support `tl.device_assert` at the time.
- ROCm Triton now supports device-side asserts when Triton debug is enabled.
- Inductor already enables Triton debug from `assert_indirect_indexing` on CUDA; this makes HIP follow that same path.
- Locally, the injected runtime assert now fires and the AOT minifier runtime-error test completes successfully on ROCm.

Pull Request resolved: pytorch#186422
Approved by: https://github.com/ezyang

Co-authored-by: Cursor <[email protected]>
Co-authored-by: PyTorch MergeBot <[email protected]>
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…ROCm (pytorch#188075)

## Summary
- Reland the ROCm Inductor-Triton debug assert enablement from pytorch#186422.
- Guard the HIP path on Triton 3.7+, which is the first Triton release with the required debug assert support.
- Gate the ROCm minifier test on the same Triton version check and add a focused heuristic unit test for the guard.

## Context
- The previous version of this change was reverted because it broke compatibility with Triton versions that predate debug assert support on ROCm.
- This reland keeps the ROCm path disabled on older Triton builds while preserving the intended behavior on supported Triton versions.
- This branch cherry-picks the original PR commits with `-x` and layers the ROCm Triton version guard on top.

## Old PR
- Previous attempt: pytorch#186422

Made with [Cursor](https://cursor.com)

Pull Request resolved: pytorch#188075
Approved by: https://github.com/ezyang, https://github.com/jansel

Co-authored-by: Cursor <[email protected]>
Co-authored-by: PyTorch MergeBot <[email protected]>
Co-authored-by: Edward Z. Yang via mergedog <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR ciflow/inductor ciflow/inductor-rocm-mi200 Trigger "inductor" config CI on ROCm MI200 ciflow/inductor-rocm-mi300 Trigger "inductor" config CI on ROCm MI300/MI325 ciflow/inductor-rocm-mi355 Trigger "inductor" config CI on ROCm MI355 ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 ciflow/rocm-mi355 Trigger "default" config CI on ROCm MI355 runners ciflow/torchtitan Run TorchTitan integration tests ciflow/trunk Trigger trunk jobs on your pull request Merged module: inductor module: rocm AMD GPU support for Pytorch open source release notes: inductor release notes: rocm mandatorylabel Reverted topic: improvements topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants