For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python function
interleaved_block_scales_shape
interleaved_block_scales_shape()
max.nn.moe.interleaved_block_scales_shape(rows, cols)
Returns the SM100 interleaved layout’s shape for [rows, cols] scales.
The layout is [rows / 128, cols / 4, 32, 4, 4], the shape
block_scales_interleave() produces. Scale row r,
column c is stored at
[r // 128, c // 4, r % 32, (r % 128) // 32, c % 4], so a range of whole
row granules or whole column granules of the interleaved tensor is the
interleave of the matching slice of the row-major scales.
-
Parameters:
-
Returns:
-
The rank-5 interleaved shape.
-
Raises:
-
ValueError – If
rowsis not a multiple of 128 orcolsis not a multiple of 4. -
Return type: