Expand description
2026-09-25: The tier’s numerics contract, shared by the GPU microtest
(examples/native_fp8_ffn_m16_tc_microtest.rs) and the host simulation in
dense_ffn_m16_tc_m32_tests.rs.
2026-09-25: The numerics contract for the tensor-core decode tiers, graded against the scalar GEMV.
Owner: model-layers (dense FFN). Invariants: none beyond the types.
within_m16_tc_budget is the one predicate the GPU microtests (for example
examples/native_fp8_ffn_m16_tc_microtest.rs and
examples/native_bf16_lm_head_m16_microtest.rs) and the host tests
(dense_ffn_m16_tc_m32_tests.rs, ops/dense_gemm_m16_bf16_tests.rs,
ops/dense_gemm_m16_bf16_floor_tests.rs) import. An m16n8k16 MMA sums K in
a different order from the scalar GEMV, so the contract is a tolerance: an
ordinal-ULP budget plus an absolute floor scaled to the reduction
(m16_tc_acc_floor).
Structs§
- M16Tc
Diff - 2026-09-25: The result of comparing an
m x nBF16 block against the scalar reference. - M16Tc
Outlier - 2026-09-25: One element the comparison rejected: where it is, the two values, the ordinal distance and the row RMS the floor was evaluated at.
Constants§
- F32_
UNIT_ ROUNDOFF - 2026-09-25: FP32 unit roundoff,
2^-24. - M16_
TC_ ACC_ FLOOR_ MARGIN - 2026-09-25: Margin over the
u * sqrt(k) * row_rmsaccumulation scale inm16_tc_acc_floor. - M16_
TC_ MAX_ ULP - 2026-09-25: Ordinal BF16 ULP budget against the scalar GEMV reference.
- M16_
TC_ SIGN_ FLIP_ BAND - 2026-09-25: A sign change on a reference smaller than this in magnitude is
counted in
sign_flipsand not graded.
Functions§
- bf16_
ord - 2026-09-25: BF16 bits -> a monotone integer, so
|ord(a) - ord(b)|is the ULP distance and +0/-0 are the same point. - compare_
m16_ tc_ block - 2026-09-25: Compare an
m x nBF16 block against the scalar reference under the tier’s contract. Both slices arem * nlittle-endian BF16 elements;kis the reduction depth the kernel ran. - m16_
tc_ acc_ floor - 2026-09-25: Absolute error below which an ordinal-ULP budget says nothing,
for one output of a length-
kFP32 reduction whose row has RMSrow_rms. - within_
m16_ tc_ budget - 2026-09-25: The tier’s numerics contract as one predicate.