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

Add a Conversion from tt.load to genx.matrix.2Dblockload for 2D blocked tensor pointer cases #413

Closed
LiyangLingIntel opened this issue Jan 31, 2024 · 5 comments · Fixed by #959 or #958

Comments

@LiyangLingIntel
Copy link
Contributor

This issue is the first stage of task [DPAS]: Use 2d-loads instruction to load the operand of tt.dot #146

Triton CUDA pipeline lower 2d-load to TMALoadTiledOp which does not have limitation on the last dim strides.
For Triton XPU pipeline, if we want to leverage GenISA_LSC2DBlockRead, it requires last dim (stride[-1]=1) continuous for each block pointer.

So, in the first stage, in the pass of 2d load conversion lowering, we will check the stride attr type. If the type is a constant, and meets the 2d block load case, we can leverage genx.matrix.2Dblockload. Otherwise, it will fallback to regular loads.

@LiyangLingIntel
Copy link
Contributor Author

Besides the stride limitation, there are still restrictions because of HW limitation.:

  • The base_pitch must be a multiple of QW (8 bytes)
  • Should pay attention to the size of tile_width, tile_height, they are mulitiplied by the element size (bytes) must be a multiple of 4 bytes, no greater than 63.

@LiyangLingIntel
Copy link
Contributor Author

For cases in 08-experimental-block-pointer and test_block_pointer.py, they produce IR with constant last dim stride.
So these cases can be covered in the situation talked in this issue.

@LiyangLingIntel
Copy link
Contributor Author

LiyangLingIntel commented Apr 22, 2024

Based on the previous discussion, submitted #941, we have 2 ways of implementation. The idea is similar, differences would be

@LiyangLingIntel
Copy link
Contributor Author

@etiotto
Copy link
Contributor

etiotto commented Apr 29, 2024

Helping with refactoring & code review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment