Skip to content

Commit 033d9ef

Browse files
author
Manish Gupta
authoredMay 2, 2024
[Documentation] Fixes the confusion between concatenated vs. composed layout in CuTe documentation (NVIDIA#1498)
* Update 02_layout_algebra.md * Update 02_layout_algebra.md
1 parent acc3ee1 commit 033d9ef

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

‎media/docs/cute/02_layout_algebra.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -191,21 +191,21 @@ Clearly, CuTe does not use arrays to store shapes or strides and the above code
191191
192192
#### Example 1 -- Reshape a layout into a matrix
193193
194-
`20:2 o (5,4):(4,1)`.
194+
`20:2 o (5,4):(4,1)`. Composition formulation.
195195
196196
This describes interpreting the layout `20:2`
197197
as a 5x4 matrix in a row-major order.
198198
199-
1. ` = 20:2 o (5:4,4:1)`. Concatenation of sublayouts.
199+
1. ` = 20:2 o (5:4,4:1)`. Layout `(5,4):(4,1)` as concatenation of sublayouts.
200200
201201
2. ` = (20:2 o 5:4, 20:2 o 4:1)`. Left distributivity.
202202
203203
* `20:2 o 5:4 => 5:8`. Trivial case.
204204
* `20:2 o 4:1 => 4:2`. Trivial case.
205205
206-
3. ` = (5:8, 4:2)`.
206+
3. ` = (5:8, 4:2)`. Composed Layout as concatenation of sublayouts.
207207
208-
4. ` = (5,4):(8,2)`. Concatenation of sublayouts.
208+
4. ` = (5,4):(8,2)`. Final composed layout.
209209
210210
#### Example 2 -- Reshape a layout into a matrix
211211
@@ -214,18 +214,18 @@ as a 5x4 matrix in a row-major order.
214214
This describes interpreting the layout `(10,2):(16,4)`
215215
as a 5x4 matrix in a column-major order.
216216
217-
1. ` = (10,2):(16,4) o (5:1,4:5)`. Concatenation of sublayouts.
217+
1. ` = (10,2):(16,4) o (5:1,4:5)`. Layout `(5,4):(1,5)` as concatenation of sublayouts.
218218
219219
2. ` = ((10,2):(16,4) o 5:1, (10,2):(16,4) o 4:5)`. Left distributivity.
220220
221221
* `(10,2):(16,4) o 5:1 => (5,1):(16,4)`. Mod out the shape `5`.
222222
* `(10,2):(16,4) o 4:5 => (2,2):(80,4)`. Div out the stride `5`.
223223
224-
3. ` = ((5,1):(16,4), (2,2):(80,4))`. Collect results.
224+
3. ` = ((5,1):(16,4), (2,2):(80,4))`. Composed Layout as concatenation of sublayouts.
225225
226226
4. ` = (5:16, (2,2):(80,4))`. By-mode coalesce.
227227
228-
5. ` = (5,(2,2))):(16,(80,4))`. Concatenation of sublayouts.
228+
5. ` = (5,(2,2))):(16,(80,4))`. Final composed layout.
229229
230230
We get exactly this result with CuTe
231231
if we use compile-time shapes and strides.

0 commit comments

Comments
 (0)
Please sign in to comment.