jax-ml/jax · error · NotImplementedError
B scale address calculation for multiple N tiles
Error message
B scale address calculation for multiple N tiles
What it means
Block-scale TMEM addressing for the B scale tensor across multiple N tiles is not implemented; when both scales are supplied, mma requires n_groups == 1.
Source
Thrown at jax/experimental/mosaic/gpu/tcgen05.py:601
assert a_desc_base is not None
a_offset = mi * a_m_group_stride + ki * a_k_group_stride
a_mk = (a_desc_base[0], a_desc_base[1] + mma_utils.encode_addr(a_offset))
b_offset = ni * b_n_group_stride + ki * b_k_group_stride
b_nk = (b_desc_base[0], b_desc_base[1] + mma_utils.encode_addr(b_offset))
if a_sparse_addr_base is not None:
if n_groups != 1 or m_groups != 1:
raise NotImplementedError("A sparse metadata address calculation for multiple tiles")
sparse_group_elems = 8 if utils.bitwidth(mma_a_element_type) == 4 else 4
# Each sparse group has 2 entries, each TMEM column holds 16 i2 entries.
cols_per_k_group = k_group_elems // sparse_group_elems * 2 // 16
a_sparse_addr = arith.addi(a_sparse_addr_base, utils.c(ki * cols_per_k_group, i32))
else:
a_sparse_addr = None
if a_scale_addr_base is not None and b_scale_addr_base is not None:
if m_groups != 1:
raise NotImplementedError("A scale address calculation for multiple M tiles")
if n_groups != 1:
raise NotImplementedError("B scale address calculation for multiple N tiles")
assert scale_block is not None # For type checkers.
assert k_group_elems % (scale_block * 4) == 0
assert m_group_elems % 32 == 0 and n_group_elems % (8 * num_cta) == 0
k_scales_per_group = k_group_elems // (scale_block * 4)
a_scale_addr = arith.addi(
a_scale_addr_base,
utils.c(ki * k_scales_per_group * a_scale_m_stride, i32),
)
b_scale_addr = arith.addi(
b_scale_addr_base,
utils.c(ki * k_scales_per_group * b_scale_n_stride, i32)
)
else:
a_scale_addr = b_scale_addr = None
acc = accumulate if ki == 0 else true
ni_lane_group, ni_col = ni // n_col_groups, ni % n_col_groups
d_offset = (
((ni_lane_group * lanes_per_n_group) << 16)View on GitHub (pinned to 1e1c6a8fc0)
Solutions
- Loop over N outside mma and issue one call per N tile
- Set per-call n so that n_groups == 1
Example fix
# before tcgen05.mma(a, b, d, a_scale=asc, b_scale=bsc, n=512) # n_groups=2 # after for ni in range(2): tcgen05.mma(a, b.slice(ni), d.slice(ni), a_scale=asc, b_scale=bsc, n=256)
Defensive patterns
Strategy: validation
Validate before calling
assert n_groups == 1 # block-scaled B scale addressing supports single N tile
Prevention
- Loop over N outside mma for scaled kernels
- Size per-call n to a single tile
When it happens
Trigger: Block-scaled mma() with a_scale/b_scale supplied and n_groups > 1 (N larger than one tile).
Common situations: Wide-N MXFP8 GEMMs where N > 256 per tile; auto-tiler choosing multiple N groups with scaling enabled.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- A scale address calculation for multiple M tiles
- Unsupported element type for block scaling: {a_element_type}
- A sparse metadata address calculation for multiple tiles
- D address calculation for multiple M tiles
- MMA with element type {elem_type_str} does not support block
AI-assisted analysis of jax-ml/jax@1e1c6a8fc0 (2026-08-27).
Data as JSON: /api/errors/fc8e13ccd65d7d9f.
Report an issue: GitHub.