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

[TIR] Allow sync threads inside condition #16345

Merged
merged 2 commits into from
Jan 4, 2024
Merged

[TIR] Allow sync threads inside condition #16345

merged 2 commits into from
Jan 4, 2024

Conversation

spectrometerHBH
Copy link
Contributor

Originally, it is not allowed to sync threads inside a condition while, if.

This PR introduces tvm_thread_invariant op to annotate the condition to be thread id invariant and get around the check.

@junrushao junrushao merged commit 5308739 into apache:main Jan 4, 2024
6 checks passed
junrushao pushed a commit to junrushao/tvm that referenced this pull request Jan 7, 2024
Originally, it is not allowed to sync threads inside a condition `while, if`.

This PR introduces `tvm_thread_invariant` op to annotate the condition to be thread id invariant and get around the check.
junrushao added a commit to junrushao/tvm that referenced this pull request Jan 15, 2024
PR apache#16345 introduced a TIR intrinsic `tvm_thread_invariant` as a no-op
intrinsic that indicates that a condition is an invariant across
threads. It is a necessary change to support MoE group GEMM operations.

However, we noticed that the LLVM-ROCm backend has been broken since
then because this no-op intrinsic hasn't been properly handled in this
particular backend. This PR fixes this behavior by checking this no-op
in the LLVM backend.
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.

3 participants