The bf16 gradient nodes — every *GradBBf16 kind the suite emits, folded once #
A bf16 render does NOT consume the f32 gradient node. It emits its own *GradBBf16 constructor,
whose den rounds the operands going in and — for every kind but one — rounds the result ONCE,
outside the batch sum: the emitted convolution contracts the batch inside a single op and stores
its bf16 result once, so a rounding per summand would claim a coarser computation than the
hardware performs. That is a different real number from the f32 node's, and it needs its own
certificate: the bf16 twins do not consume the f32 node.
This file is the whole bf16 op table, stated per op kind: each lemma says the node denotes the
certified Σ_n gradient at the ROUNDED operands, rounded. The proofs are the f32 fold's — congrArg rnd
peels the outer rounding, Finset.sum_congr the batch, and the inner equality is the per-example
certificate at rounded slices.
| kind | lemma | f32 peer | emitted by |
|---|---|---|---|
convWeightGradBBf16 | convWGradBBf16_den | GradNodeB.convWGradB_den | every net |
convStridedWeightGradBBf16 (symmetric) | convStridedWGradBBf16_den | GradNodeB.convStridedWGradB_den | ResNet-34/50, MobileNetV4's fused stage, ConvNeXt's downsamples |
convStridedXlaWeightGradBBf16 (XLA-SAME) | convStridedXlaWGradBBf16_den | GradNodeB.convStridedXlaWGradB_den | EfficientNet-B0's, MobileNetV2's and MobileNetV4's stems |
convStride4WeightGradBBf16 | convStride4WGradBBf16_den | GradNodeB.psWGradB_den | ConvNeXt's patchify stem |
depthwiseWeightGradBBf16 | depthwiseWGradBBf16_den | GradNodeB.depthwiseWGradB_den | B0, MobileNetV2, MobileNetV4, ConvNeXt |
depthwiseStridedWeightGradBBf16 (symmetric) | depthwiseStridedWGradBBf16_den | GradNodeB.depthwiseStridedWGradB_den | B0, MobileNetV4 |
depthwiseStridedXlaWeightGradBBf16 (XLA-SAME) | depthwiseStridedXlaWGradBBf16_den | GradNodeB.depthwiseStridedXlaWGradB_den | MobileNetV2 |
rowDenseWeightGradBBf16 | rowDenseWGradBBf16_den | ViTFoldGB.rowDenseWeightGradB_den | ViT's Q/K/V/O and MLP denses |
patchEmbedWeightGradBBf16 | patchEmbedWGradBBf16_den | ViTFoldGB.patchEmbedWeightGradB_den | ViT's patch embed |
Note: rowDenseWeightGradBBf16 has NO outer rounding, and that is the measurement rather than
an omission: its dot_general contracts batch and token in one op and keeps its f32-typed result
deliberately (StableHLO.Basic's constructor says why), so only the two leaf reads round.
Note: Padding rides along invisibly, as in the f32 folds: the symmetric and XLA-SAME strided kinds
have identical types and identical emitted shapes, and only the certificate tells them apart.
Note: BatchNorm, LayerNorm and the dense head have no bf16 twin here or anywhere: every bf16 net in the suite keeps them in f32, so their γ/β and weight nodes are the f32 folds' in both worlds.
bf16 conv weight GRADIENT denotes the certified Σ_n weight gradient at the rounded
operands, rounded once. Every 1×1 and 3×3 in every bf16 artifact.
bf16 SYMMETRIC strided conv weight GRADIENT, rounded once. ResNet's downsamples and 7×7 stem, MobileNetV4's fused 3×3/s2, ConvNeXt's 2×2/s2 downsamples.
bf16 XLA-SAME strided conv weight GRADIENT, rounded once. The TF-origin stems
(EfficientNet-B0, MobileNetV2, MobileNetV4). Note: flatConvStride2Xla, not flatConvStride2.
bf16 4×4/s4 patchify-stem weight GRADIENT, rounded once. ConvNeXt's stem.
bf16 depthwise weight GRADIENT, rounded once. Every stride-1 depthwise.
bf16 SYMMETRIC strided depthwise weight GRADIENT, rounded once. B0's stride-2 MBConvs and MobileNetV4's rows 1, 3, 11.
bf16 XLA-SAME strided depthwise weight GRADIENT, rounded once. MobileNetV2's four
stride-2 depthwises, and no other net's. Note: depthwiseStride2FlatXla.
bf16 per-token dense weight GRADIENT at the rounded operands — with NO outer rounding:
the emitted dot_general keeps its f32-typed result, so only the two leaf reads round.
ViT's Wq/Wk/Wv/Wo/Wfc1/Wfc2.
bf16 patch-embed conv weight GRADIENT at the rounded operands, rounded once. ViT's
16×16/s16 stem; the outer rnd wraps the whole batch sum because the emit contracts the
batch inside one bf16-typed convolution.