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

Modify pass pipeline to allow lowering tt.load to 2DBlockRead #1061

Merged
merged 11 commits into from
May 10, 2024

Conversation

etiotto
Copy link
Contributor

@etiotto etiotto commented May 7, 2024

No description provided.

@etiotto etiotto self-assigned this May 7, 2024
@etiotto etiotto linked an issue May 7, 2024 that may be closed by this pull request
@etiotto etiotto requested a review from chengjunlu May 7, 2024 19:14
@etiotto etiotto marked this pull request as ready for review May 9, 2024 16:37
@@ -69,20 +69,6 @@ class XPUBackend(BaseBackend):
# Experimental pass pipeline for kernels using block pointers.
class Experimental:

@staticmethod
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: Now the experimental pass has the same implementation as the default path for make_ttir.

lib/Dialect/TritonGPU/Transforms/Coalesce.cpp Show resolved Hide resolved
@etiotto
Copy link
Contributor Author

etiotto commented May 9, 2024

Now, with this PR, the code generated for 09-experimental-block-pointer.py shows that the 2D block read operation is used:

TRITON_DISABLE_LINE_INFO=1  MLIR_ENABLE_DUMP=1  python 09-experimental-block-pointer.py >! log 2>&1 &  
grep "BlockRead" log| wc                                                                                                      ✔  10361  17:46:33 
    712   22416  158600

Signed-off-by: Tiotto, Ettore <[email protected]>
@etiotto
Copy link
Contributor Author

etiotto commented May 10, 2024

@whitneywhtsang @chengjunlu I'd like to land this PR asap. If there are concerns with relaxing the precision of the tests for flash attention we can open a issue defect to track that.

Opened #1085 to track the issue.

@etiotto etiotto merged commit 1e4fb64 into llvm-target May 10, 2024
2 checks passed
@etiotto etiotto deleted the etiotto.tt.load.to.2DBlockRead branch May 10, 2024 15:26
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.

Add passes to enable lowering tt.load using block ptrs to 2DBlockRead
2 participants