MobileNetV4-Conv-M's data-parallel forward at SYNCHRONISED BatchNorm — replica r IS shard r #
MobileNetV4FullB.lean (T2) says the typed batch-BN graph denotes mobilenetv4ForwardB_full N w
on one device. MobileNetV4RenderB's data-parallel step normalises with the GLOBAL batch's
statistics at replicas > 1: every one of the 77 BatchNorm sites is the sync-BN composition —
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 (mnv4FwdGraphSync_full R hR N epsStr w e r)
= batchShard R N nCls (mobilenetv4ForwardB_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 mobilenetv4ForwardB_full, at N := R·N.
How it is proved #
As ResNet34SyncB.lean and MobileNetV2SyncB.lean prove theirs: one block at a time, with the
shard hypothesis ∀ r, den (e r) = batchShard R N _ X r carried from block to block.
- every conv, depthwise (stride 1 and SYMMETRIC stride 2), XLA-
SAMEstrided stem conv, GAP and dense node is a per-example lift (den_batchOp_shard) — the padding lives inside the per-example map; - relu and swish are pointwise (
den_relu_shard,den_swish_shard); the identity skip isden_addVB_shard; - every BatchNorm site is
bnSyncSiteLA, whose shard lemmaden_bnSyncSiteLAis P1 on the graph read at the network index.
⭐ Same shape as T2, and for T2's reasons. The block lemmas are GENERIC IN THE ROW (s : UibSpec), so every width is a projection of a variable and nothing evaluates; each one closes on
the row-typed mnv4BodyOfRow (R * N) s p / mnv4PreStridedBodyOfRow by the dispatch hypotheses
T2 uses (s.preDWk ≠ 0, s.postDWk = 0, …), discharged by decide at the concrete rows. The
skip is one generic combinator (mnv4SkipGraphSync, the peer of mnv4SkipGraphB), which keeps
the whole-net term linear in the depth. The five resolution groups are proved against
mnv4Res*Layer (R * N) w through T2's _fwd_apply peels, and the whole net is a have-chain of
eight stage lemmas over mobilenetv4ForwardB_full's own prefixes — no CertLayer.comp is ever
peeled at a literal width.
The index seam #
The conv/relu chain runs at the left-assoc index N·(c·h·w); bnSyncF and its statistics nodes
at N·(c·(h·w)). As in ResNet-34's and MobileNetV2's twins the site is ResNet34SyncB's
bnSyncSiteLA, which carries the mul_assoc relabelling as castIdx on the AST value (the
emitted text does not change: skel never sees an index), and den_bnSyncSiteLA reads P1 back at
the network index through batchShard_castIdx. Nothing about the seam is MobileNetV4's own.
Names #
Parameter names are MobileNetV4FullB's, read off the row (%u{p}{q,e,d,p}{W,g,bt}, %f0cW,
%sW, %h1W, %hW, …), and every bias operand is the shared zero %zb{c}. A BatchNorm site with
γ %u{p}qg gathers its statistics as %arsum / %armean of u{p}qgmu and u{p}qgvar, each over
a [c] vector — the γ name without %, then mu / var, the tag bnFwdSite is handed.
What is NOT claimed here #
⚠ The backward and the parameter collectives are the T3 half (MobileNetV4SyncStepTieB.lean).
⚠ Every conv here is bias-free by construction: MobileNetV4RenderB has no convBias flag and
binds each bias slot to the zero %zb{c}, so no bias is trained and no bias gradient is emitted
(the statement is ∀ w, and zero biases are one instance). ⚠ The
statement is at the f32 nodes; the *bf16 artifact's bf16 conv twins are outside it. ⚠ That the
R replicas' inputs ARE the shards of one batch is the driver's, as in DataParallelSync.lean.
⚠ The lowerer's all_reduce is trusted as every other op's lowering is.
swish on every replica is the shard of the global swish — the fused stage's activation,
read cell by cell. The peer of den_relu_shard, stated at the whole-batch swish the
committed forward (fusedConvB) is written in.
Stem at sync-BN, over the replica family: 3×3/s2 XLA-SAME conv → sync-BN → relu.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Fused stage at sync-BN, over the replica family: 3×3/s2 SYMMETRIC conv → sync-BN → swish → 1×1 project → sync-BN. Two sync sites, no skip.
Equations
- One or more equations did not get rendered due to their size.
Instances For
ExtraDW body at sync-BN, over the replica family — both depthwises present: pre-DW →
sync-BN → relu → expand → sync-BN → relu → post-DW → sync-BN → relu → project → sync-BN. Four
sync sites. The body only; the identity skip is mnv4SkipGraphSync.
Equations
- One or more equations did not get rendered due to their size.
Instances For
⭐ The ExtraDW body at sync-BN is shard r of the row-typed body at R·N — generic in the
row, the dispatch hypotheses T2's mnv4ExtraDWBodyGraphB_faithful takes.
ConvNeXt-like body at sync-BN — pre-DW only (postDWk = 0): the absent depthwise emits no
tokens, exactly as in T2. Three sync sites.
Equations
- One or more equations did not get rendered due to their size.
Instances For
FFN body at sync-BN — neither depthwise: expand → sync-BN → relu → project → sync-BN.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pre-strided block at sync-BN — rows 1, 3 and 11: the leading depthwise carries the stride
(.depthwiseStrided, SYMMETRIC padding), everything after it at the reduced h. Four sync
sites; no skip (ic ≠ oc).
Equations
- One or more equations did not get rendered due to their size.
Instances For
⭐ One skip row at sync-BN: its body's family, plus the identity skip, replica by replica —
the peer of mnv4SkipGraphB, and a named combinator for the same reason: the add needs the
block's input family twice, and kept folded the whole-net term stays linear in the depth.
Equations
- Proofs.StableHLO.mnv4SkipGraphSync body e r = (body e r).addVB (e r)
Instances For
A skip row at sync-BN is shard r of residual of whatever its body shards to — generic in
the body, so one lemma serves all eighteen and the body's shard lemma is the only input.
Head at sync-BN, over the replica family: 1×1 conv → sync-BN → relu, a SECOND 1×1 conv → sync-BN → relu, GAP, dense — Conv-M's two head convs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Trunk group Res14b at sync-BN — rows 7–10: ExtraDW, ConvNeXt, FFN, ConvNeXt.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The fused stage's shard lemma, restated at mnv4FusedStack (R * N) w — so the whole-net proof
never unfolds the stack, for the reason mnv4FusedStack_graph_faithful records.
The head's, restated at mnv4HeadStack (R * N) w. Same reason.
The sync-BN data-parallel MobileNetV4-Conv-M forward graph, over the replica family. T2's
mnv4FwdGraphB_full with every one of its 77 BatchNorms a bnSyncSiteLA over all R replicas;
parameter names are read off the rows and collective tags are the render'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 mobilenetv4ForwardB_full (R * N) w X — the committed batch-BN forward, at the global batch. Eight stage lemmas — the stem, the
fused stage, the five resolution groups, the head — the shard hypothesis threaded from each
into the next, over the forward's own prefixes.