Skip to content

[release/2.11] [ROCm] Check AOTriton attention errors at the originating callsite - #3643

Open
sstamenk wants to merge 1 commit into
release/2.11from
sstamenk/port-194100-release-2.11
Open

sstamenk wants to merge 1 commit into
release/2.11from
sstamenk/port-194100-release-2.11

Conversation

@sstamenk

Copy link
Copy Markdown
Member

Cherry-pick of upstream PR pytorch#194100 for the release/2.11 branch.

…ytorch#194100)

Check the return values of AOTriton forward and backward attention calls with `AT_CUDA_CHECK`.

AOTriton returns a `hipError_t`, but the existing code stores it in a local variable and never checks it. A synchronous launch failure can therefore appear successful at the originating operation and surface during a later, unrelated HIP call.

This makes failures difficult to diagnose and can incorrectly attribute them to subsequent operations.

Add immediate error checking to all AOTriton attention callsites:

- Forward attention
- Variable-length forward attention
- Backward attention
- Variable-length backward attention

Launch failures are now reported at the operation that caused them using PyTorch’s standard accelerator error handling.

- Source lint checks passed.
- `git diff --check` passed.
- Verified that all four AOTriton forward/backward callsites are checked and no ignored `hipError_t` variables remain.

Pull Request resolved: pytorch#194100
Approved by: https://github.com/xinyazhang, https://github.com/jeffdaily

(cherry picked from commit 875d815)
@sstamenk
sstamenk requested a review from jeffdaily September 15, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant