The inverted-residual pieces every MBConv net's sync-BN step twin shares #
MobileNetV2 (MobileNetV2SyncStepTieB.lean) and EfficientNet-B0 (EfficientNetSyncStepTieG.lean)
both tie their sync-BN data-parallel step to the single-device step at R·N on
ResNet34SyncStepTieB.lean's four steps. Their blocks share the ops ResNet-34 does not have — the
depthwise conv and its symmetric-strided peer, the XLA-SAME strided stem conv, global average
pooling and the row-wise dense — and this file states each once, net-agnostically:
- §1 homogeneity — each input-VJP and weight-gradient node is linear in its cotangent;
- §2 sharding — each input-VJP is a per-example map, so it commutes with the batch cut;
- §3 the collectives — the replica mean of a weight-gradient node is
1/Rof the global node; - §4 the per-parameter DP ties — a replica family at
R ×the shards of a global cotangent gives the single-device node atR·N(*_of_scaled).
MobileNetV4's render uses the same three weight-gradient kinds. The XLA-SAME strided depthwise
is MobileNetV2's alone and stays in its twin.
The row-wise input-VJP dX = W·dy (the classifier's, and the SE excite dense's) is linear in
dy.
A HasVJP3 backward is linear in its cotangent — HasVJP.backward_smul's three-axis peer,
read off HasVJP3.correct. The stride-1 depthwise weight gradient is stated through one.
The row-wise input-VJP is batchMap of W·, so it shards like every per-example lift.
P4 at the depthwise weight — each replica's Σ_n over its own examples, averaged, is 1/R
of the global batch's Σ_n.
P4 at the strided depthwise weight.
P4 at the XLA-SAME strided conv weight (the stem) — den_allReduceMeanF_convWeightGradB_shard's
peer. Only the certificate differs from the symmetric strided one; the batch split is the same.
A depthwise weight, DP-tied — the collective over the [c, 1, kH, kW] kernel the render
all-reduces, against the single-device node at the global batch.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The strided depthwise weight, DP-tied.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The stem's XLA-SAME strided conv weight, DP-tied. Tags are the render's: the collective is
named for the parameter, over its [oc, ic, kH, kW] shape.
Equations
- One or more equations did not get rendered due to their size.