Expand description
The tier’s NUMERICS CONTRACT — the one comparison the GPU oracle
(examples/native_fp8_ffn_m16_tc_microtest.rs) and the host simulation both
evaluate, so a receipt and a unit test cannot be grading different things.
The numerics contract for the tensor-core decode tiers (w8a16_gemm_m16,
#927; dense_gemm_m16_bf16, #927/#928) — ONE comparison, evaluated by the
GPU oracles (examples/native_fp8_ffn_m16_tc_microtest.rs,
examples/native_bf16_lm_head_m16_microtest.rs) and by the host simulations
(dense_ffn_m16_tc_m32_tests.rs, ops/dense_gemm_m16_bf16_tests.rs,
ops/dense_gemm_m16_bf16_floor_tests.rs), so a
receipt and a unit test cannot drift into grading different things.
The kernel REASSOCIATES the K reduction relative to the scalar GEMV (an
m16n8k16 MMA reduces 16 K-products in the tensor core’s own order before
they reach the FP32 accumulator), so the contract is a tolerance and always
was. What changed in round 6 is WHICH tolerance; what changed in round 9 is
how the tolerance’s absolute half is SCALED — see m16_tc_acc_floor.
Structs§
- M16Tc
Diff - The result of comparing an
m x nBF16 block against the scalar reference. - M16Tc
Outlier - One element the comparison rejected, with everything needed to say WHERE it is and WHY it failed.
Constants§
- F32_
UNIT_ ROUNDOFF - FP32 unit roundoff,
2^-24. Every rounding the accumulator performs is a multiple of this times the magnitude being rounded, so it is the only constant inm16_tc_acc_floorthat is not a judgement call. - M16_
TC_ ACC_ FLOOR_ MARGIN - Margin over the
u * sqrt(K)accumulation scale thatm16_tc_acc_flooradmits. - M16_
TC_ MAX_ ULP - BF16 ordinal-ULP budget this tier is held to, against the scalar GEMV. Unchanged since #927.
- M16_
TC_ SIGN_ FLIP_ BAND - Magnitude below which a SIGN change carries no information: one ULP across zero is a full sign flip, so those are counted separately rather than graded. Unchanged from #927.
Functions§
- bf16_
ord - 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 - 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 - 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 - The tier’s numerics contract, as ONE predicate every oracle and host simulation evaluates, so they cannot drift.