Expand description
2026-09-25: Routing of the narrow NVFP4 batched GEMV to its tensor-core kernels (w4a16_gemv_tc8 / w4a16_gemv_tc16 in kernels/gb10/common/w4a16_gemv_tc.cu).
Owner: model-layers ops. Invariants:
- The tensor-core entries take the same arguments as the CUDA-core
w4a16_gemv_batch*kernels, with their own grid (ceil(N / cols_per_cta)) and a 256-thread block. - A launch routes only when
K % 128 == 0and1 <= m <= 16; otherwise the caller keeps its CUDA-core kernel (tc_route). super::w4a16_gemv_batchmandtc_fixed_mboth route throughtc_kernel.METRALE_NO_W4A16_TCset to any non-empty value, read once per process, turns the tensor-core path off (tc_enabled). The bench crate’sPERF_CONTROLSdiscloses it, andrecord_env_testsreadstc_enabledandwide_rows_enabledfrom this file.
Enums§
- TcKind
- 2026-09-25: Which tensor-core entry serves a launch.
Constants§
- NARROW_
MAX_ ROWS - 2026-09-25: Row edges of the narrow-GEMV dispatch arms:
NARROW_MAX_ROWSby default, andWIDE_MAX_ROWS(thetc16reach) whenwide_rows_enabled. Read throughnarrow_gemv_max_rows. - TC8_
COLS_ PER_ CTA - 2026-09-25: Columns per CTA,
8 * NT: tc8 hasNT = 1, tc16 hasNT = 2. - TC8_
MAX_ M - 2026-09-25: Rows the
w4a16_gemv_tc8entry covers (itsMTis 8). - TC16_
COLS_ PER_ CTA - TC16_
MAX_ M - 2026-09-25: Rows the
w4a16_gemv_tc16entry covers (itsMTis 16). - TC_
BLOCK - 2026-09-25: Threads per CTA,
TC_WARPS * 32withTC_WARPS = 8in the .cu; the warps split K. - WIDE_
MAX_ ROWS
Functions§
- narrow_
gemv_ max_ rows - 2026-09-25: Row edge of the narrow-GEMV dispatch arms (see
wide_rows_enabled). - tc_
enabled - 2026-09-25: True when
METRALE_NO_W4A16_TCis unset or empty. Any non-empty value,0included, turns the tensor-core path off. Read once per process, so every launch, including one captured in a CUDA graph, sees the same choice. - tc_
fixed_ m - 2026-09-25: The tensor-core route of the fixed-M launchers, taken only when
wide_rows_enabled:Ok(true)when it launched,Ok(false)to keep the CUDA-core kernel. - tc_
kernel - 2026-09-25: The tensor-core kernel and grid x for this launch, or
Noneto keep the CUDA-core kernel. It does not consultwide_rows_enabled; the callers’ row edges do. - tc_
route - 2026-09-25: The routing decision, without I/O.
Nonekeeps the caller’s CUDA-core kernel. - wide_
rows_ enabled - 2026-09-25: The opt-in widening: true when
METRALE_W4A16_TC_WIDEis set to a non-empty value andtc_enabled. Read once per process. It raisesnarrow_gemv_max_rowsto 16 and letstc_fixed_mroute the fixed-M launchers (w4a16_gemv_batch2/3,w4a16_gemv_dual_batch2/3) to the tensor-core kernels.