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

Blocksparse matmul error under specific block size #98

Closed
LinjianMa opened this issue May 5, 2021 · 2 comments
Closed

Blocksparse matmul error under specific block size #98

LinjianMa opened this issue May 5, 2021 · 2 comments

Comments

@LinjianMa
Copy link

I was looking at this test function: https://github.com/ptillet/triton/blob/master/python/test/test_blocksparse.py#L13,
when the blocksize is 16 or greater, it works fine. However, when the block size is set as 4 or 8, the error message looks like this:

Traceback (most recent call last):
  File "test_blocksparse.py", line 41, in <module>
    test_matmul("dds", TRANS_A=False, TRANS_B=False, BLOCK=8, DTYPE="float16", Z=3, H=2, M=512, N=384, K=256)
  File "test_blocksparse.py", line 30, in test_matmul
    rc = op(ra, rb)
  File "/home/ubuntu/triton/python/triton/ops/blocksparse/matmul.py", line 651, in __call__
    db_lut, db_num_locks, db_width, db_packs = self.make_lut(a.dtype, a.device)
  File "/home/ubuntu/triton/python/triton/ops/blocksparse/matmul.py", line 595, in make_lut
    c_lut, c_num_locks, c_width, c_packs = _matmul.make_dxx_lut(layout, block, step, self.trans_b, device)
  File "/home/ubuntu/triton/python/triton/ops/blocksparse/matmul.py", line 391, in make_dxx_lut
    xincs[:, 0] -= (div - 1) * step
IndexError: index 0 is out of bounds for dimension 1 with size 0

Any ideas about what's the reason? To reproduce the error, can run

test_matmul("dds", TRANS_A=False, TRANS_B=False, BLOCK=4, DTYPE="float16", Z=3, H=2, M=512, N=384, K=256)
@ptillet
Copy link
Collaborator

ptillet commented May 5, 2021

Hi! Blocksparse does not support BLOCK=4 or BLOCK=8. There is also no plan support it, as it wouldn't map well to tensor cores. We should have more explicit error message for it.

@LinjianMa
Copy link
Author

I see, thanks for the quick response!

ptillet pushed a commit that referenced this issue Sep 12, 2022
Based on the discussion in #53 , I just added the initial flow of CXX unittests for this repo, with providing two dummy UTs as placeholder to show the usage, feel free to add your own CXX unittests. 
@Superjomn  @ptillet 

@ptillet , in this PR, I also configure the integration-tests.yml to add the unittest into github CI check. 

Thanks
ptillet pushed a commit that referenced this issue Apr 1, 2024
Based on the discussion in #53 , I just added the initial flow of CXX unittests for this repo, with providing two dummy UTs as placeholder to show the usage, feel free to add your own CXX unittests. 
@Superjomn  @ptillet 

@ptillet , in this PR, I also configure the integration-tests.yml to add the unittest into github CI check. 

Thanks
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

No branches or pull requests

2 participants