Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace if/else statement with tl.where #545

Open
wants to merge 1 commit into
base: triton-mlir
Choose a base branch
from

Conversation

Sara-KS
Copy link

@Sara-KS Sara-KS commented Mar 22, 2024

While running the flash attention benchmark in a python environment, I encountered the following error
is_mqa = hq != hk
off_h_k = off_h_q % hk if is_mqa else off_h_q
^
Triton does not support if expressions (ternary operators) with dynamic conditions, use if statements instead

Version information
ROCm: 5.7.3
python: 3.11
Triton: pytorch-triton-rocm: 2.2.0
System: MI250 (gfx90a)

Solution: Replaced the if/else statement with tl.where function. With this replacement, the benchmark runs without error message.

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