cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[QST]How does the Tile in make_tile_mma work in 0t_mma_atom?

Open March-H opened this issue 1 year ago • 2 comments

What is your question? Confusion About the Generation of the Final Diagram in 0t_mma_atom

I am confused about the generation of the final diagram in 0t_mma_atom. I thought that making T0’s V0 to V7 next to each other would involve remapping the first mode’s Layout. The remapping provided in the document is:

Old m-coord: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

New m-coord: 0 1 2 3 8 9 10 11 16 17 18 19 24 25 26 27 4 5 6 7 12 13 14 15 20 21 22 23 28 29 30 31

However, the original position of T0V4 is at (16,0), isn't it? So, I thought the first 8 values in the new m-coord should be: 0 1 2 3 16 17 18 19. When I verified using the mapping I assumed, the first mode of the tile turned out to be Layout<Shape<_4,_2,_4>, Stride<_1,_16,_4>>. But when I used this to generate the result, I couldn't get the final diagram, and it turns out that after T0V3, the next values were T8V0. This seems to indicate that my mapping approach is incorrect.

What is more puzzling is that in another test, I tried to place V0-V7 next to each other for each thread and have the thread numbering increase sequentially. The result was T0V0-T0V7, T8V0-T8V7, T16V0-T16V7, T24V0-T24V7. Using the same mapping rule, I obtained Layout<Shape<_4,_2,_2,_2>, Stride<_1,_16,_8,_4>>. Surprisingly, this unexpectedly met my expectations, but it also raised more questions because it seems that T0V4 corresponds to both 16 and 8. How can this be explained?

The mapping I used to obtain the final diagram is:

Old m-coord: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

New m-coord: 0 1 2 3 16 17 18 19 4 5 6 7 20 21 22 23 8 9 10 11 24 25 26 27 12 13 14 15 28 29 30 31

but, it should be:

Old m-coord: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

New m-coord: 0 1 2 3 8 9 10 11 16 17 18 19 24 25 26 27 4 5 6 7 12 13 14 15 20 21 22 23 28 29 30 31

The successful mapping I used in my attempts is:

Old m-coord: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

New m-coord: 0 1 2 3 16 17 18 19 8 9 10 11 24 25 26 27 4 5 6 7 20 21 22 23 12 13 14 15 28 29 30 31

Could you please help clarify this? I would appreciate your insights on how the final diagram is generated.

March-H avatar Feb 12 '25 02:02 March-H

They're inverses of each other. This thread has a good discussion on it https://github.com/NVIDIA/cutlass/discussions/1345

ccecka avatar Feb 12 '25 04:02 ccecka

They're inverses of each other. This thread has a good discussion on it #1345

Thank you very much. I have already obtained the answer from the comments on this link, thank you.

March-H avatar Feb 12 '25 06:02 March-H