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

[Research]: Evaluate enhanced AxisAnalysis for block ptr materialization #2375

Open
etiotto opened this issue Sep 27, 2024 · 1 comment
Open

Comments

@etiotto
Copy link
Contributor

etiotto commented Sep 27, 2024

The following analysis (thanks @ienkovich for pointing this one out):

https://github.com/Cambricon/triton-linalg/blob/master/include/triton-linalg/Dialect/Triton/Interfaces/InferAxisInfoInterface.h#L164

Might allow us to generate 2D block loads and prefetches for regular Triton ptrs.

@mfrancepillois
Copy link
Contributor

This analysis is used in the Cambricon project to help convert Triton pointers load/store operations into structured memref operations.
The objective is therefore the same as the triton-shared pass, we based on raising pass on (https://github.com/intel-sandbox/applications.python.intel-xpu-backend-for-triton/pull/33 )
In the Cambricon project, they have extended triton axis analysis to infer the strides of tensors.
As this info is based on DFA, it is more robust that the pattern matching based strategy we adopted in our pass.
That said, in the Cambricon project, the remaining information needed to raise pointer accesses to structured accesses (and. in our case. block pointers) such as offsets and mask are “tracked” using a pattern matching approach (see https://github.com/Cambricon/triton-linalg/blob/master/include/triton-linalg/Dialect/Triton/Utils/MaskTracker.h and https://github.com/Cambricon/triton-linalg/blob/master/include/triton-linalg/Dialect/Triton/Utils/PointerMetaInfoTracker.h ).
As a result, the tracking of these data suffer from similar limitations, and fragility to those we have encountered in our pass, as stated in these comments for example: https://github.com/Cambricon/triton-linalg/blob/d090db477f8d0ca67cf8cd220ef39b43de9183f9/lib/Dialect/Triton/Utils/MaskTracker.cpp#L337-L361
https://github.com/Cambricon/triton-linalg/blob/d090db477f8d0ca67cf8cd220ef39b43de9183f9/lib/Dialect/Triton/Utils/PointerMetaInfoTracker.cpp#L184-L196

So, my general view is that this analysis could be used to improve a robustness of our pass, given that using DFA for strides should reduce the fragility of our pass. However, the brittleness problem of this pass would not be fully solved by relying on this analysis, as pattern matching as is still needed to “track” offsets and masks at least.

@vlad-penkin vlad-penkin assigned etiotto and unassigned sommerlukas Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants