Skip to content

fix: align S[...] notation with address formula in Tile Layout section#141

Open
xush6528 wants to merge 1 commit into
mlc-ai:mainfrom
xush6528:patch-1
Open

fix: align S[...] notation with address formula in Tile Layout section#141
xush6528 wants to merge 1 commit into
mlc-ai:mainfrom
xush6528:patch-1

Conversation

@xush6528

@xush6528 xush6528 commented Jul 7, 2026

Copy link
Copy Markdown

The dimension names were listed as (tile_row, row_in_tile, tile_col, col_in_tile) but the address formula below computes in the order (tile_row, tile_col, row_in_tile, col_in_tile) with strides (16, 8, 4, 1).

Updated S[(4, 2, 2, 4) : (16, 4, 8, 1)] to S[(4, 2, 2, 4) : (16, 8, 4, 1)] and reordered the dimension names to match.

The dimension names were listed as (tile_row, row_in_tile, tile_col, col_in_tile)
but the address formula below computes in the order (tile_row, tile_col, row_in_tile, col_in_tile) with strides (16, 8, 4, 1).

Updated S[(4, 2, 2, 4) : (16, 4, 8, 1)] to S[(4, 2, 2, 4) : (16, 8, 4, 1)] and reordered the dimension names to match.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request corrects the coordinate order and corresponding strides for a 4-D layout representing tiled matrices in the documentation. Specifically, it changes the coordinate order from (tile_row, row_in_tile, tile_col, col_in_tile) to (tile_row, tile_col, row_in_tile, col_in_tile) and updates the strides accordingly to ensure the tiles remain contiguous. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@rock42069

rock42069 commented Jul 8, 2026

Copy link
Copy Markdown

You should make the change here as well.

<h1>S[(4, 2, 2, 4) : (16, 4, 8, 1)]</h1>

@tlopex

tlopex commented Jul 9, 2026

Copy link
Copy Markdown
Member

@xush6528 @rock42069 Thanks so much for catching this, we really appreciate it!
However, we think we should fix slightly different.

The intended convention follows the default tiling rule(like numpy,PyTorch and TIRx): each original dimension is split into an outer and inner coordinate before moving on to the next dimension, i.e.

(outer_dim0, inner_dim0, outer_dim1, inner_dim1, ...)

For a 2D matrix tiled by 2x4, this gives:

(tile_row, row_in_tile, tile_col, col_in_tile)

So the layout should remain:

S[(4, 2, 2, 4) : (16, 4, 8, 1)]

The issue is that the address demo currently displays the terms in a different order, which makes it look as if the layout were using:

(tile_row, tile_col, row_in_tile, col_in_tile)

Thanks again for pointing this out! We’ll fix it in the upcoming Chinese-version PR for the layout chapter.

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

Successfully merging this pull request may close these issues.

3 participants