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

How to implement blockwise fill? #2488

Open
void-main opened this issue Oct 13, 2023 · 0 comments
Open

How to implement blockwise fill? #2488

void-main opened this issue Oct 13, 2023 · 0 comments

Comments

@void-main
Copy link
Contributor

void-main commented Oct 13, 2023

Hi team, I'm writing a kernel that has the following requirement:

I have a range tensor with values: [0, 10, 20, 30] and another range tensor with values: [0, 1, 2, 3, 4, 5, 6, 7], the expected tensor should be: [0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37].

I've tried the following code:

row_idxes = tl.arange(0, 4)
col_idxes = tl.arange(0, 8)
block_offs = row_idxes[:, None] * 10 + col_idxes[None, :] * 1
block_offs = tl.view(block_offs, [BLOCK_N])

Logically the code works, but the tl.view operations seems to be not working as expected (like #2210 #2157 ), how could I fix this?

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

1 participant