Skip to content

[ROCM] Do not send "debug"=True down to triton.compile - #99756

Closed
dllehr-amd wants to merge 4 commits into
pytorch:mainfrom
dllehr-amd:disable_triton_debug
Closed

dllehr-amd wants to merge 4 commits into
pytorch:mainfrom
dllehr-amd:disable_triton_debug

Conversation

@dllehr-amd

@dllehr-amd dllehr-amd commented Apr 21, 2023 •

Copy link
Copy Markdown
Contributor

ROCm's version of triton does not currently support tl.device_assert.

This operator among others is effectively a no-op unless "debug" = True is passed in the triton.compile function.

Until we have full suport for tl.device_assert, avoid enabling the debug flag in triton.compile, so we do not have to find every possible location tl.device_assert may be used.

Fixes #99725

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @soumith @voznesenskym @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire

@pytorch-bot

pytorch-bot Bot commented Apr 21, 2023 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit d1cba11:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@dllehr-amd
dllehr-amd force-pushed the disable_triton_debug branch 2 times, most recently from 085a117 to 3f9a3fe Compare April 22, 2023 20:20
@dllehr-amd dllehr-amd changed the title Do not send "debug"=True down to triton.compile [ROCM] Do not send "debug"=True down to triton.compile Apr 24, 2023
@pytorch-bot pytorch-bot Bot added the module: rocm AMD GPU support for Pytorch label Apr 24, 2023
Pull Request resolved: pytorch#99725
ROCm's version of triton does not currently support tl.device_assert.

This operator among others is effectively a no-op unless
"debug" = True is passed in the triton.compile function.

Until we have full suport for tl.device_assert, avoid enabling
the debug flag in triton.compile, so we do not have to find every
possible location tl.device_assert may be used.
@dllehr-amd
dllehr-amd force-pushed the disable_triton_debug branch from 3f9a3fe to 3a5ae81 Compare April 24, 2023 13:48

@lezcano lezcano left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough

Comment thread torch/_inductor/triton_heuristics.py Outdated
Comment on lines +108 to +113

if torch.version.hip is None:
compile_meta["debug"] = config.triton.assert_indirect_indexing
else:
compile_meta["debug"] = False

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be golfed as

Suggested change
if torch.version.hip is None:
compile_meta["debug"] = config.triton.assert_indirect_indexing
else:
compile_meta["debug"] = False
compile_meta["debug"] = config.triton.assert_indirect_indexing and torch.version.hip is None

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I wasn't in the right mindset...I'll take your more elegant suggestion. Thanks!!

@lezcano

lezcano commented Apr 24, 2023

Copy link
Copy Markdown
Collaborator

If you want to disable the generation of device_asserts in this case, you can also add a similar guard in codegen/triton.py

@dllehr-amd

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Apr 24, 2023
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: This PR needs a label
If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Details for Dev Infra team Raised by workflow job

@jithunnair-amd

Copy link
Copy Markdown
Collaborator

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: 1 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@lezcano

lezcano commented Apr 25, 2023

Copy link
Copy Markdown
Collaborator

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot added a commit that referenced this pull request Jun 10, 2026
…86422)

## 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 #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: #186422
Approved by: https://github.com/ezyang

Co-authored-by: Cursor <[email protected]>
Co-authored-by: PyTorch MergeBot <[email protected]>
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]>
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]>
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RuntimeError: Triton Error [HIP]: Code: 200, Messsage: device kernel image is invalid

5 participants