Expand description
2026-09-25: SSOT for the narrow w4a16_gemv_batch{M} tier family (M = 4..8).
Owner: model-layers (NVFP4 GEMV dispatch). Invariants:
select_tiernever returns a tier narrower thanm, nor one that the loaded target did not resolve.
w4a16_gemv_batchm_impl<MAX_M> sizes acc[] and s_vl[] by MAX_M and
unrolls its row loop over MAX_M, so MAX_M also sizes the code. The
t >= M guard skips a dead row’s work at run time but not its
instructions, so M=5 on the MAX_M=8 tier carries three unused rows; the
exact-M tiers 5, 6 and 7 avoid that.
The width decision lives here once, as a pure function (select_tier)
over which tiers the loaded target resolved; every consumer holds a
W4a16BatchmTiers and calls kernel(m).
METRALE_NO_GEMV_EXACT_M_TIERS (presence-checked: any value, including
0, disables) hides widths 5/6/7 from the decision, leaving widths 4 and
8. It does not unload the kernels, so an A/B needs no rebuild.
Structs§
- W4a16
Batchm Tiers - 2026-09-25: Resolved handles for the narrow
w4a16_gemv_batch{M}family.
Constants§
- W4A16_
BATCHM_ WIDTHS - 2026-09-25: Tier widths in this family, narrowest first. Parallel to the
handlesfield ofW4a16BatchmTiersand to thepresentarray ofselect_tier.w4a16_gemv_batch16/_batch32are not in this table: they are held separately (wide,wide32) and handed out only above 8 rows, within the row edge (W4a16BatchmTiers::edge).
Functions§
- exact_
m_ tiers_ enabled - 2026-09-25: Are the exact-M tiers (5/6/7) allowed in the dispatch decision?
- select_
tier - 2026-09-25: Pure tier decision: index into
W4A16_BATCHM_WIDTHSof the narrowest tier that coversmrows and is present in the loaded target, orNonewhen no such tier exists (ormis 0).