EfficientNet-B0's data-parallel forward at SYNCHRONISED BatchNorm — replica r IS shard r #
EfficientNetFullB0.lean (T2) says the typed batch-BN graph denotes efficientnetForwardB_full N w
on one device. At replicas > 1 the data-parallel render normalises every one of B0's 49
BatchNorms with the GLOBAL batch's statistics — the sync-BN composition bnFwdSite emits: this
replica's mean all-reduced, then Chan's σ²_r + (μ_r − μ)² all-reduced, packed, then bnSyncF.
This file is T2's data-parallel twin: that forward graph, stated as a family over the R
replicas, denotes on replica r exactly batchShard r of the single-device forward at the global
batch R·N.
den (efficientnetFwdGraphSync_full R hR N epsStr w e r)
= batchShard R N 10 (efficientnetForwardB_full (R * N) w X) r
given that each replica's input is its shard of one global batch X. ⭐ The spec does not
move: the right-hand side is the committed efficientnetForwardB_full, at N := R·N.
How it is proved #
ResNet-34's recipe (ResNet34SyncB.lean), block by block, the shard hypothesis
∀ r, den (e r) = batchShard R N _ X r carried from each block into the next:
- every conv, depthwise, strided depthwise, squeeze-excite, GAP and dense node is a per-example
lift and commutes with sharding (
den_batchOp_shard) — the SE block included: its squeeze (GAP), both dense layers and the gate multiply all act on one example at a time, so it is onebatchMapand needs nothing new; - swish is pointwise (
den_swishF_shard), and so is the residualaddV(den_addV_shard); - every BatchNorm is
bnSyncSiteLA, whose shard lemmaden_bnSyncSiteLAis P1 on the graph.
The collectives are tagged as bnFwdSite tags them: a BN site whose γ is %{p}eg gathers
{p}egmu and {p}egvar, each over a [c] statistic. den ignores every string, so the tags fix
which graph is stated, not what it denotes.
What is NOT claimed here #
⚠ The backward and the parameter collectives are the T3 half (EfficientNetSyncStepTieG.lean).
⚠ That the R replicas' inputs ARE the shards of one batch is the driver's. ⚠ The emitted
artifact's stochastic-depth and classifier-dropout variants add per-example scalings T2 does not
state. ⚠ The lowerer's all_reduce is trusted as every other op's lowering is.
The MBConv identity skip (addV) on every replica is the shard of the global one.
MBConv1 (b1, no expand) at sync-BN, over the replica family: depthwise → sync-BN → swish → SE → 1×1 project → sync-BN.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The MBConv6 body at sync-BN — expand 1×1 → sync-BN → swish → depthwise → sync-BN → swish → SE → project 1×1 → sync-BN — shared by the residual (b3, b5, …) and the no-skip widening (b9, b16) blocks.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The no-skip widening block (b9, b16) is the body alone.
Equations
- Proofs.StableHLO.mbExpGraphSync p epsStr R hR N h w q e = Proofs.StableHLO.mbBodyGraphSync p epsStr R hR N h w q e
Instances For
The residual MBConv6 block (b3, b5, b7, b8, b10, b11, b13–b15): the body plus the identity skip,
addV body e, as mbResidGraphB orders it.
Equations
- Proofs.StableHLO.mbResidGraphSync p epsStr R hR N h w q e r = (Proofs.StableHLO.mbBodyGraphSync p epsStr R hR N h w q e r).addV (e r)
Instances For
The strided MBConv6 block (b2, b4, b6, b12): expand at the input grid 2h×2w, the strided
depthwise down to h×w, SE and project there. Three sync sites, the expand one at 2h×2w.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stem at sync-BN, over the replica family: 3×3/s2 conv (XLA-SAME) → sync-BN → swish.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Head at sync-BN, over the replica family: 1×1 conv → sync-BN → swish → GAP → dense.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The sync-BN data-parallel EfficientNet-B0 forward graph, over the replica family. T2's
efficientnetFwdGraphB_full with every one of the 49 BatchNorms a bnSyncSiteLA over all R
replicas, fed each replica's own input subgraph e r; block prefixes and collective tags are
EfficientNetRender's.
Equations
- One or more equations did not get rendered due to their size.
Instances For
⭐⭐ T2 at synchronised BatchNorm: replica r's forward IS shard r of the global-batch
forward. Given that the replicas' inputs are the shards of one batch X of R·N images, the
sync-BN graph on replica r denotes batchShard r of efficientnetForwardB_full (R * N) w X
— the committed batch-BN forward, at the global batch. One block lemma per stage, the shard
hypothesis threaded from each into the next.