Documentation

LeanMlir.Proofs.Nets.EfficientNet.EfficientNetSyncStepTieG

EfficientNet-B0's data-parallel step at SYNCHRONISED BatchNorm IS the single-device step at R·N #

EfficientNetStepTieG.lean threads the label-smoothed loss cotangent down the batch-BN backward chain on ONE device and ties every parameter gradient node to the certified gradient. This is its data-parallel twin, for the render EfficientNetRender.Basic emits at replicas > 1: R replicas at batch N, every one of the 49 BatchNorms synchronised (bnFwdSite / bnBackSite / bnGammaSite), every parameter gradient all-reduced by its mean. The capstone efficientnet_net_syncTiedG says that, for every parameter,

mean over the R replicas of replica r's gradient node, loss divided by B
  = the single-device gradient node at the global batch R·N, loss divided by R·B

— the gradient node EnetTieG.efficientnet_net_tiedG at N := R·N ties to the certified gradient. The spec it is stated against has not moved: the right-hand side is the single-device tie's chain at N := R·N — its forward prefixes, loss cotangent and block .backwards verbatim, and its in-block cotangents as named definitions (xCotEc, tCotDn, …) that unfold to enetExpTiedG's lets, so each right-hand node is the single-device tie's node by rfl.

Five steps #

ResNet-34's four (ResNet34SyncStepTieB.lean), and one B0 needs because of how its single-device tie is written.

  1. The block VJP is the chain (§ 0). The single-device tie threads each block's input cotangent as a certified VJP's .backward; a replica computes its own by the explicit chain, and only the explicit chain can be sharded. xCotIn_eq_vjp and its four peers say the two agree — the Batched.BackLinks stage graphs, read at an .operand leaf, with bnBatchLABack_faithful turning the one non-rfl link into bnBackB.
  2. Sharding (§§ 2, 5). Every non-BN link is per-example — conv, depthwise and strided depthwise input-VJPs, swish and sigmoid masks, and the squeeze-excite backward: the gate cotangent gateCotB (seReduceB's den) and the fused input-VJP seInB (seBackBatched's) both read one example at a time, so they shard like ResNet-34's pool backward. The BN link is bnSyncInB, P2 on the graph, read through bnInB_eq_bnBackB onto the single-device tie's bnBackB.
  3. The collectives. ResNet-34's conv, dense and BatchNorm ones, plus the depthwise, strided-depthwise and XLA-SAME stem conv weights from DataParallel.SyncKit, which also holds the depthwise, GAP and dense links of steps 1 and 3 that MobileNetV2 shares.
  4. Homogeneity (§§ 1, 4). Every link is linear in its cotangent; most are a certified VJP's .backward, so HasVJP.backward_smul is the whole proof.
  5. The divisor. Replica r's loss cotangent is R × its shard of the global one (replicaLossCot_eq), and steps 1–3 carry that R down to cancel each collective's 1/R.

What is covered, and what is NOT claimed #

The DP render runs convBias := false, so it emits 213 parameter collectives — stem 3, b1 10, fifteen MBConv6 blocks × 13, head 5 — and all 213 are tied. The single-device tie carries 49 more conjuncts, one per conv bias (a bnBetaGradB at the conv-output cotangent), for the convBias := true census; the DP artifacts do not emit them and they are not tied here.

Note: the replicas' saved forward activations enter as the shards of the single-device forward's; that the sync forward graph computes exactly those is EfficientNetSyncB's efficientnetFwdGraphSyncFull_shard, the forward half. Note: that the replicas' inputs are the shards of one batch is the driver's. Note: the lowerer's all_reduce is trusted as every other op's lowering is.

The training masks are optional sites on the statement, as in EfficientNetStepTieG: the capstone takes the GLOBAL masks sd : Option (Fin 9 → Vec (R * N)) (stochastic depth, nine blocks) and cd : Option (Vec ((R * N) * 1280)) (classifier dropout), and replica r runs its chain at shard r of each — exampleShard of a per-example scale, batchShard of the per-element mask — which is what the DP render's per-replica %dp<i> / %do inputs are. none is the drop-free DP artifacts' statement exactly as it was; some reaches efficientnetin_emarmsdp64dropdowxeps0001bf16's chain. Each site is linear in the cotangent and commutes with the batch cut (dropPathOpt_smul / _shard, dropoutOpt_smul / _shard, Foundation.DropSites), so the five steps are unchanged: a residual block's replica chain feeds its branch the family dropPathOptFam and the single-device one dropPathOpt … dy, the invariant passing the site by dropPathOptFam_scaled; the head's dense collective reads the dropped activation on every replica. The forward half with the sites is StableHLO.efficientnetFwdGraphSyncFullDrop_shard.

Precision is a flag on the statement. The ImageNet run the book reports trains from efficientnetin_emarmsdp64dropdowxeps0001bf16, whose conv and depthwise weight gradients are the bf16 kinds. Every conv and depthwise weight collective below is stated on the renderers' switch — ConvWSyncAt bf16 / ConvStridedXlaWSyncAt bf16 / DepthwiseWSyncAt bf16 / DepthwiseStridedXlaWSyncAt bf16 (Foundation.GradNodesBAt): the replicas' nodes and the batch-R·N node are the f32 kind at false and the bf16 kind at true — and the capstone takes bf16, so it covers the f32 DP artifacts and the *bf16 ones' step read over ℝ at the identity rounding (Bf16Erasure), where each bf16 collective is 1/R of the batch-R·N bf16 node exactly as at f32. At a real rounding the bf16 weight-gradient collective differs from the single-device node by the per-replica rounding of each partial sum, which DataParallel.SyncBf16 states and this file does not model, as the f32 tie does not model f32 rounding.

The tail's forward activations, from the depthwise conv output dc — enetExpTiedG's dn, dr, s, e1, z, e2, se, pc, definitionally.

noncomputable def Proofs.EnetSyncTieG.tS (N h w : ℕ) {mid oc rd : ℕ} (t : EnTail mid oc rd) (dc : Vec (N * (mid * h * w))) :
Vec (N * mid)
Equations
Instances For

    The tail's backward chain from the block-output cotangent dy — enetExpTiedG's cotPbn … cotDc, definitionally.

    noncomputable def Proofs.EnetSyncTieG.tCotDc (N h w : ℕ) {mid oc rd : ℕ} (t : EnTail mid oc rd) (hd : 0 < t.dε) (hp : 0 < t.pε) (dc : Vec (N * (mid * h * w))) (dy : Vec (N * (oc * h * w))) :
    Vec (N * (mid * h * w))
    Equations
    Instances For

      The stride-1 expand front (b3, b5, …, and the widenings b9 / b16).

      noncomputable def Proofs.EnetSyncTieG.xCotIn (N h w : ℕ) {ic mid oc rd kh kw : ℕ} (p : MBW ic mid oc rd kh kw) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (xin : Vec (N * (ic * h * w))) (dy : Vec (N * (oc * h * w))) :
      Vec (N * (ic * h * w))

      The widening block's input cotangent — the expand conv's input-VJP.

      Equations
      Instances For
        noncomputable def Proofs.EnetSyncTieG.rCotIn (N h w : ℕ) {c mid rd kh kw : ℕ} (p : MBW c mid c rd kh kw) (s : Option (Vec N)) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (xin dy : Vec (N * (c * h * w))) :
        Vec (N * (c * h * w))

        The residual block's input cotangent — the body's at the branch cotangent (the block-output cotangent through the drop site when it is rendered), plus the identity skip's raw one.

        Equations
        Instances For

          The strided front (b2, b4, b6, b12): expand at the input grid 2h×2w.

          noncomputable def Proofs.EnetSyncTieG.sCotIn (N h w : ℕ) {ic mid oc rd kh kw : ℕ} (p : MBW ic mid oc rd kh kw) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dy : Vec (N * (oc * h * w))) :
          Vec (N * (ic * (2 * h) * (2 * w)))

          The strided block's input cotangent.

          Equations
          Instances For

            The MBConv1 front (b1): the depthwise runs on the block input.

            noncomputable def Proofs.EnetSyncTieG.nDc (N h w : ℕ) {ic oc rd kh kw : ℕ} (p : MBWNoExp ic oc rd kh kw) (xin : Vec (N * (ic * h * w))) :
            Vec (N * (ic * h * w))
            Equations
            Instances For
              noncomputable def Proofs.EnetSyncTieG.nCotIn (N h w : ℕ) {ic oc rd kh kw : ℕ} (p : MBWNoExp ic oc rd kh kw) (hd : 0 < p.dε) (hp : 0 < p.pε) (xin : Vec (N * (ic * h * w))) (dy : Vec (N * (oc * h * w))) :
              Vec (N * (ic * h * w))

              The MBConv1 block's input cotangent — the depthwise's input-VJP.

              Equations
              Instances For

                The stem (enetStemTiedG's chain) and the head (enetHeadTiedG's).

                noncomputable def Proofs.EnetSyncTieG.hdCotIn (N h w : ℕ) {c oc nC : ℕ} (Wh : Kernel4 oc c 1 1) (bh : Vec oc) (εh : ℝ) (hεh : 0 < εh) (γh βh : Vec oc) (Wfc : Mat oc nC) (cd : Option (Vec (N * oc))) (xin : Vec (N * (c * h * w))) (g : Vec (N * nC)) :
                Vec (N * (c * h * w))

                The head's input cotangent — the 1×1 conv's input-VJP.

                Equations
                Instances For

                  Each block's input cotangent IS its certified VJP #

                  The single-device tie threads the block-output cotangents by the block VJPs' .backward; the replicas compute theirs by the explicit chain. These say the two agree, so the sharding argument (which needs the explicit chain) lands on the single-device tie's own .backward terms. HasVJP.backward_unique swaps the bundle-level witness for the unfolded one, a vjpComp of the stage VJPs, which vjpComp_backward takes apart into the stage backwards.

                  theorem Proofs.EnetSyncTieG.xCotIn_eq_vjp (N h w : ℕ) {ic mid oc rd kh kw : ℕ} (p : MBW ic mid oc rd kh kw) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (xin : Vec (N * (ic * h * w))) (dy : Vec (N * (oc * h * w))) :
                  (mbExpWHasVJP N h w p he hd hp).backward xin dy = xCotIn N h w p he hd hp xin dy
                  theorem Proofs.EnetSyncTieG.rCotIn_eq_vjp (N h w : ℕ) {c mid rd kh kw : ℕ} (p : MBW c mid c rd kh kw) (s : Option (Vec N)) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (xin dy : Vec (N * (c * h * w))) :
                  (mbResidDropWHasVJP N h w p s he hd hp).backward xin dy = rCotIn N h w p s he hd hp xin dy
                  theorem Proofs.EnetSyncTieG.sCotIn_eq_vjp (N h w : ℕ) {ic mid oc rd kh kw : ℕ} (p : MBW ic mid oc rd kh kw) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (xin : Vec (N * (ic * (2 * h) * (2 * w)))) (dy : Vec (N * (oc * h * w))) :
                  (mbStridedWHasVJP N h w p he hd hp).backward xin dy = sCotIn N h w p he hd hp xin dy
                  theorem Proofs.EnetSyncTieG.nCotIn_eq_vjp (N h w : ℕ) {ic oc rd kh kw : ℕ} (p : MBWNoExp ic oc rd kh kw) (hd : 0 < p.dε) (hp : 0 < p.pε) (xin : Vec (N * (ic * h * w))) (dy : Vec (N * (oc * h * w))) :
                  (mbNoExpWHasVJP N h w p hd hp).backward xin dy = nCotIn N h w p hd hp xin dy
                  theorem Proofs.EnetSyncTieG.hdCotIn_eq_vjp (N h w : ℕ) {c oc nC : ℕ} (Wh : Kernel4 oc c 1 1) (bh : Vec oc) (εh : ℝ) (hεh : 0 < εh) (γh βh : Vec oc) (Wfc : Mat oc nC) (bfc : Vec nC) (cd : Option (Vec (N * oc))) (xin : Vec (N * (c * h * w))) (g : Vec (N * nC)) :
                  (headDoFwdBHasVJP N Wh bh εh hεh γh βh Wfc bfc cd).backward xin g = hdCotIn N h w Wh bh εh hεh γh βh Wfc cd xin g
                  theorem Proofs.EnetSyncTieG.tCotDc_smul (N h w : ℕ) {mid oc rd : ℕ} (t : EnTail mid oc rd) (hd : 0 < t.dε) (hp : 0 < t.pε) (dc : Vec (N * (mid * h * w))) :
                  IsHomog (tCotDc N h w t hd hp dc)

                  The tail, on the replicas #

                  noncomputable def Proofs.EnetSyncTieG.tsCotDc (R : ℕ) (hR : 0 < R) (N h w : ℕ) {mid oc rd : ℕ} (t : EnTail mid oc rd) (DC : Vec (R * N * (mid * h * w))) (dys : Fin R → Vec (N * (oc * h * w))) (r : Fin R) :
                  Vec (N * (mid * h * w))
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem Proofs.EnetSyncTieG.tsCotDc_shard (R : ℕ) (hR : 0 < R) (N h w : ℕ) {mid oc rd : ℕ} (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (t : EnTail mid oc rd) (hd : 0 < t.dε) (hp : 0 < t.pε) (DC : Vec (R * N * (mid * h * w))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) DY r) (r : Fin R) :
                    tsCotDc R hR N h w t DC dys r = batchShard R N (mid * h * w) (tCotDc (R * N) h w t hd hp DC DY) r

                    The fronts, on the replicas #

                    noncomputable def Proofs.EnetSyncTieG.xsCotIn (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic mid oc rd kh kw : ℕ} (p : MBW ic mid oc rd kh kw) (XIN : Vec (R * N * (ic * h * w))) (dys : Fin R → Vec (N * (oc * h * w))) (r : Fin R) :
                    Vec (N * (ic * h * w))

                    A replica's input cotangent at a widening block (b9, b16).

                    Equations
                    Instances For
                      noncomputable def Proofs.EnetSyncTieG.rsCotIn (R : ℕ) (hR : 0 < R) (N h w : ℕ) {c mid rd kh kw : ℕ} (p : MBW c mid c rd kh kw) (s : Option (Vec (R * N))) (XIN : Vec (R * N * (c * h * w))) (dys : Fin R → Vec (N * (c * h * w))) (r : Fin R) :
                      Vec (N * (c * h * w))

                      A replica's input cotangent at a residual block — the body's at the branch cotangents (each replica's block-output cotangent through its shard of the site's mask, dropPathOptFam) plus the skip's raw one.

                      Equations
                      Instances For
                        noncomputable def Proofs.EnetSyncTieG.ssCotIn (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic mid oc rd kh kw : ℕ} (p : MBW ic mid oc rd kh kw) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin R → Vec (N * (oc * h * w))) (r : Fin R) :
                        Vec (N * (ic * (2 * h) * (2 * w)))

                        A replica's input cotangent at a strided block (b2, b4, b6, b12).

                        Equations
                        Instances For
                          noncomputable def Proofs.EnetSyncTieG.nsCotIn (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic oc rd kh kw : ℕ} (p : MBWNoExp ic oc rd kh kw) (XIN : Vec (R * N * (ic * h * w))) (dys : Fin R → Vec (N * (oc * h * w))) (r : Fin R) :
                          Vec (N * (ic * h * w))

                          A replica's input cotangent at the MBConv1 block (b1).

                          Equations
                          Instances For
                            noncomputable def Proofs.EnetSyncTieG.hdsCotIn (R : ℕ) (hR : 0 < R) (N h w : ℕ) {c oc nC : ℕ} (Wh : Kernel4 oc c 1 1) (bh : Vec oc) (εh : ℝ) (γh βh : Vec oc) (Wfc : Mat oc nC) (cd : Option (Vec (R * N * oc))) (XIN : Vec (R * N * (c * h * w))) (gs : Fin R → Vec (N * nC)) (r : Fin R) :
                            Vec (N * (c * h * w))

                            A replica's input cotangent at the head.

                            Equations
                            Instances For

                              The scaled-shard invariant across each block #

                              Replicas at R × the shards of the single-device block-output cotangent DY hand the next block up R × the shards of the single-device tie's own .backward — sharding, then the explicit chain IS the VJP (§ 0), then HasVJP.backward_smul.

                              theorem Proofs.EnetSyncTieG.xsCotIn_scaled (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic mid oc rd kh kw : ℕ} (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : MBW ic mid oc rd kh kw) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (XIN : Vec (R * N * (ic * h * w))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => ↑R * DY i) r) (r : Fin R) :
                              xsCotIn R hR N h w p XIN dys r = batchShard R N (ic * h * w) (fun (i : Fin (R * N * (ic * h * w))) => ↑R * (mbExpWHasVJP (R * N) h w p he hd hp).backward XIN DY i) r
                              theorem Proofs.EnetSyncTieG.rsCotIn_scaled (R : ℕ) (hR : 0 < R) (N h w : ℕ) {c mid rd kh kw : ℕ} (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : MBW c mid c rd kh kw) (s : Option (Vec (R * N))) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (XIN : Vec (R * N * (c * h * w))) (dys : Fin R → Vec (N * (c * h * w))) (DY : Vec (R * N * (c * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (c * h * w) (fun (i : Fin (R * N * (c * h * w))) => ↑R * DY i) r) (r : Fin R) :
                              rsCotIn R hR N h w p s XIN dys r = batchShard R N (c * h * w) (fun (i : Fin (R * N * (c * h * w))) => ↑R * (mbResidDropWHasVJP (R * N) h w p s he hd hp).backward XIN DY i) r
                              theorem Proofs.EnetSyncTieG.ssCotIn_scaled (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic mid oc rd kh kw : ℕ} (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : MBW ic mid oc rd kh kw) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => ↑R * DY i) r) (r : Fin R) :
                              ssCotIn R hR N h w p XIN dys r = batchShard R N (ic * (2 * h) * (2 * w)) (fun (i : Fin (R * N * (ic * (2 * h) * (2 * w)))) => ↑R * (mbStridedWHasVJP (R * N) h w p he hd hp).backward XIN DY i) r
                              theorem Proofs.EnetSyncTieG.nsCotIn_scaled (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic oc rd kh kw : ℕ} (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (p : MBWNoExp ic oc rd kh kw) (hd : 0 < p.dε) (hp : 0 < p.pε) (XIN : Vec (R * N * (ic * h * w))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => ↑R * DY i) r) (r : Fin R) :
                              nsCotIn R hR N h w p XIN dys r = batchShard R N (ic * h * w) (fun (i : Fin (R * N * (ic * h * w))) => ↑R * (mbNoExpWHasVJP (R * N) h w p hd hp).backward XIN DY i) r
                              theorem Proofs.EnetSyncTieG.hdsCotIn_scaled (R : ℕ) (hR : 0 < R) (N h w : ℕ) {c oc nC : ℕ} (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (Wh : Kernel4 oc c 1 1) (bh : Vec oc) (εh : ℝ) (hεh : 0 < εh) (γh βh : Vec oc) (Wfc : Mat oc nC) (bfc : Vec nC) (cd : Option (Vec (R * N * oc))) (XIN : Vec (R * N * (c * h * w))) (gs : Fin R → Vec (N * nC)) (G : Vec (R * N * nC)) (hgs : ∀ (r : Fin R), gs r = batchShard R N nC (fun (i : Fin (R * N * nC)) => ↑R * G i) r) (r : Fin R) :
                              hdsCotIn R hR N h w Wh bh εh γh βh Wfc cd XIN gs r = batchShard R N (c * h * w) (fun (i : Fin (R * N * (c * h * w))) => ↑R * (headDoFwdBHasVJP (R * N) Wh bh εh hεh γh βh Wfc bfc cd).backward XIN G i) r
                              def Proofs.EnetSyncTieG.tailSyncTiedG (R : ℕ) (hR : 0 < R) (N h w : ℕ) {mid oc rd : ℕ} (pfx xN cotN vN epsStr : String) (t : EnTail mid oc rd) (hp : 0 < t.pε) (bf16 : Bool) (DC : Vec (R * N * (mid * h * w))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) :

                              The tail, DP-tied — nine collectives: the depthwise BatchNorm's γ and β, the SE reduce and excite dense layers' weight and bias, the project conv weight, the project BatchNorm's γ and β. Each equals the single-device gradient node at the global batch, at the single-device tie's chain cotangents.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                theorem Proofs.EnetSyncTieG.tail_syncTiedG (R : ℕ) (hR : 0 < R) (N h w : ℕ) {mid oc rd : ℕ} (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (pfx xN cotN vN epsStr : String) (t : EnTail mid oc rd) (hp : 0 < t.pε) (bf16 : Bool) (DC : Vec (R * N * (mid * h * w))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => ↑R * DY i) r) :
                                tailSyncTiedG R hR N h w pfx xN cotN vN epsStr t hp bf16 DC dys DY
                                def Proofs.EnetSyncTieG.expSyncTiedG (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic mid oc rd kh kw : ℕ} (pfx xN cotN vN epsStr : String) (p : MBW ic mid oc rd kh kw) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (bf16 : Bool) (XIN : Vec (R * N * (ic * h * w))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) :

                                A stride-1 MBConv6 block, DP-tied (the nine residual blocks and the two widenings) — thirteen collectives: the expand conv weight, the expand BatchNorm's γ and β, the depthwise weight, then the tail's nine. The body is the same with or without the identity skip; the skip lives in the cotangent thread (rsCotIn).

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  theorem Proofs.EnetSyncTieG.exp_syncTiedG (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic mid oc rd kh kw : ℕ} (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (pfx xN cotN vN epsStr : String) (p : MBW ic mid oc rd kh kw) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (bf16 : Bool) (XIN : Vec (R * N * (ic * h * w))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => ↑R * DY i) r) :
                                  expSyncTiedG R hR N h w pfx xN cotN vN epsStr p he hd hp bf16 XIN dys DY
                                  def Proofs.EnetSyncTieG.stridedSyncTiedG (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic mid oc rd kh kw : ℕ} (pfx xN cotN vN epsStr : String) (p : MBW ic mid oc rd kh kw) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (bf16 : Bool) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) :

                                  A strided MBConv6 block, DP-tied (b2, b4, b6, b12) — thirteen collectives, the expand pair at the input grid 2h×2w and the depthwise strided.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    theorem Proofs.EnetSyncTieG.strided_syncTiedG (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic mid oc rd kh kw : ℕ} (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (pfx xN cotN vN epsStr : String) (p : MBW ic mid oc rd kh kw) (he : 0 < p.eε) (hd : 0 < p.dε) (hp : 0 < p.pε) (bf16 : Bool) (XIN : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => ↑R * DY i) r) :
                                    stridedSyncTiedG R hR N h w pfx xN cotN vN epsStr p he hd hp bf16 XIN dys DY
                                    def Proofs.EnetSyncTieG.noExpSyncTiedG (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic oc rd kh kw : ℕ} (pfx xN cotN vN epsStr : String) (p : MBWNoExp ic oc rd kh kw) (hd : 0 < p.dε) (hp : 0 < p.pε) (bf16 : Bool) (XIN : Vec (R * N * (ic * h * w))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) :

                                    The MBConv1 block, DP-tied (b1) — ten collectives: the depthwise weight, then the tail's nine.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      theorem Proofs.EnetSyncTieG.noExp_syncTiedG (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic oc rd kh kw : ℕ} (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (pfx xN cotN vN epsStr : String) (p : MBWNoExp ic oc rd kh kw) (hd : 0 < p.dε) (hp : 0 < p.pε) (bf16 : Bool) (XIN : Vec (R * N * (ic * h * w))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => ↑R * DY i) r) :
                                      noExpSyncTiedG R hR N h w pfx xN cotN vN epsStr p hd hp bf16 XIN dys DY
                                      def Proofs.EnetSyncTieG.stemSyncTiedG (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic oc kHs kWs : ℕ} (xN cotN vN epsStr : String) (Ws : Kernel4 oc ic kHs kWs) (bs : Vec oc) (εs : ℝ) (hεs : 0 < εs) (γs βs : Vec oc) (bf16 : Bool) (X : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) :

                                      The stem, DP-tied — three collectives: the 3×3/s2 XLA-SAME conv weight and its BatchNorm's γ and β.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        theorem Proofs.EnetSyncTieG.stem_syncTiedG (R : ℕ) (hR : 0 < R) (N h w : ℕ) {ic oc kHs kWs : ℕ} (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (xN cotN vN epsStr : String) (Ws : Kernel4 oc ic kHs kWs) (bs : Vec oc) (εs : ℝ) (hεs : 0 < εs) (γs βs : Vec oc) (bf16 : Bool) (X : Vec (R * N * (ic * (2 * h) * (2 * w)))) (dys : Fin R → Vec (N * (oc * h * w))) (DY : Vec (R * N * (oc * h * w))) (hdys : ∀ (r : Fin R), dys r = batchShard R N (oc * h * w) (fun (i : Fin (R * N * (oc * h * w))) => ↑R * DY i) r) :
                                        stemSyncTiedG R hR N h w xN cotN vN epsStr Ws bs εs hεs γs βs bf16 X dys DY
                                        def Proofs.EnetSyncTieG.headSyncTiedG (R : ℕ) (hR : 0 < R) (N h w : ℕ) {c oc nC : ℕ} (xN cotN vN epsStr dN : String) (Wh : Kernel4 oc c 1 1) (bh : Vec oc) (εh : ℝ) (hεh : 0 < εh) (γh βh : Vec oc) (Wfc : Mat oc nC) (bf16 : Bool) (cd : Option (Vec (R * N * oc))) (XIN : Vec (R * N * (c * h * w))) (gs : Fin R → Vec (N * nC)) (G : Vec (R * N * nC)) :

                                        The head, DP-tied — five collectives: the 1×1 conv weight, its BatchNorm's γ and β, and the classifier's weight and bias, the last two at the loss cotangent itself.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          theorem Proofs.EnetSyncTieG.head_syncTiedG (R : ℕ) (hR : 0 < R) (N h w : ℕ) {c oc nC : ℕ} (hN : 0 < N) (hh : 0 < h) (hw : 0 < w) (xN cotN vN epsStr dN : String) (Wh : Kernel4 oc c 1 1) (bh : Vec oc) (εh : ℝ) (hεh : 0 < εh) (γh βh : Vec oc) (Wfc : Mat oc nC) (bf16 : Bool) (cd : Option (Vec (R * N * oc))) (XIN : Vec (R * N * (c * h * w))) (gs : Fin R → Vec (N * nC)) (G : Vec (R * N * nC)) (hgs : ∀ (r : Fin R), gs r = batchShard R N nC (fun (i : Fin (R * N * nC)) => ↑R * G i) r) :
                                          headSyncTiedG R hR N h w xN cotN vN epsStr dN Wh bh εh hεh γh βh Wfc bf16 cd XIN gs G
                                          def Proofs.EnetSyncTieG.enetNetSyncTiedG (R : ℕ) (hR : 0 < R) (N : ℕ) (xN vN epsStr cotN dN : String) {nCls : ℕ} (w : B0Weights nCls) (hεw : w.EpsPos) (bf16 : Bool) (sd : Option (Fin 9 → Vec (R * N))) (cd : Option (Vec (R * N * 1280))) (x : Vec (R * N * (3 * 224 * 224))) (g : Vec (R * N * nCls)) (gs : Fin R → Vec (N * nCls)) :

                                          The whole-net statement, named — so the capstone (cotangents bound) and its smoothed-CE corollary (cotangents instantiated) state exactly one thing. The forward prefixes a0 … a16 and the block-output cotangents dy16 … dy0 are EnetTieG.efficientnet_net_tiedG's chain at N := R·N, driven by the global cotangent g; e16 … e0 are the replicas' sync-BN chain, driven by the family gs; the 18 conjuncts are one per stage.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            theorem Proofs.EnetSyncTieG.efficientnet_net_syncTiedG (R : ℕ) (hR : 0 < R) (N : ℕ) (hN : 0 < N) (xN vN epsStr cotN dN : String) {nCls : ℕ} (w : B0Weights nCls) (hεw : w.EpsPos) (bf16 : Bool) (sd : Option (Fin 9 → Vec (R * N))) (cd : Option (Vec (R * N * 1280))) (x : Vec (R * N * (3 * 224 * 224))) (g : Vec (R * N * nCls)) (gs : Fin R → Vec (N * nCls)) (hgs : ∀ (r : Fin R), gs r = batchShard R N nCls (fun (i : Fin (R * N * nCls)) => ↑R * g i) r) :
                                            enetNetSyncTiedG R hR N xN vN epsStr cotN dN w hεw bf16 sd cd x g gs

                                            The synchronised-BN data-parallel EfficientNet-B0 step IS the single-device step at the global batch. R replicas at batch N, each running the render's sync-BN backward chain from its own cotangent gs r, with gs r the R-scaled shard of a global cotangent g; every parameter's all-reduced mean gradient — stem 3, b1 10, fifteen MBConv6 blocks × 13, head 5: the 213 the render emits at convBias := false — equals the single-device batch-BN gradient node at batch R·N, at the cotangent the single-device tie's chain delivers there from g.

                                            The right-hand chain is EnetTieG.efficientnet_net_tiedG's at N := R·N: verbatim for the forward prefixes a0 … a16 and the block-output cotangents dy16 … dy0 threaded by the certified block VJPs' .backward; by rfl for the in-block cotangents, which are this file's named chain. That capstone ties those nodes to the certified gradient, so the two together say the DP step's update is the certified gradient of the global-batch step. It takes hεw (w.EpsPos), because the single-device chain does, and the global masks sd / cd of the two optional sites (the module's Scope), none the drop-free DP artifacts and some the dropdo one the book's run trains. efficientnet_net_syncTiedG_smoothedCE discharges the hypothesis for the label-smoothed chain the artifacts emit.

                                            The left-hand chain is the replicas' own: sync-BN backward at every one of the 49 BatchNorms (bnSyncInB, a collective each), per-example conv / depthwise / squeeze-excite / swish / head links. bf16 selects the conv and depthwise weight collectives' kind on both sides — true is the *bf16 renders', read at the identity rounding (Bf16Erasure).

                                            theorem Proofs.EnetSyncTieG.efficientnet_net_syncTiedG_smoothedCE (R : ℕ) (hR : 0 < R) (N : ℕ) (hN : 0 < N) (xN vN epsStr cotN dN : String) {nCls : ℕ} (w : B0Weights nCls) (hεw : w.EpsPos) (bf16 : Bool) (sd : Option (Fin 9 → Vec (R * N))) (cd : Option (Vec (R * N * 1280))) (aStr negAK bStr logN ohN : String) (α B : ℝ) (x : Vec (R * N * (3 * 224 * 224))) (t : Vec (R * N * (1 * nCls))) :
                                            enetNetSyncTiedG R hR N xN vN epsStr cotN dN w hεw bf16 sd cd x (BackLinks.unrowB (R * N) nCls (StableHLO.den (smoothedLossCotGraph (R * N) nCls α (↑R * B) aStr negAK bStr logN ohN (BackLinks.rowB (R * N) nCls (efficientnetForwardBFullDrop (R * N) w sd cd x)) t))) fun (r : Fin R) => BackLinks.unrowB N nCls (StableHLO.den (smoothedLossCotGraph N nCls α B aStr negAK bStr logN ohN (BackLinks.rowB N nCls (batchShard R N nCls (efficientnetForwardBFullDrop (R * N) w sd cd x) r)) (batchShard R N (1 * nCls) t r)))

                                            …and at the loss the artifacts emit. efficientnet_net_syncTiedG with its cotangent hypothesis discharged by replicaLossCot_eq: each replica runs the label-smoothed softmax chain (smoothedLossCotGraph) on its shard of the logits and targets with divisor B; the single-device step runs it on the whole R·N batch with divisor R·B. Then every all-reduced gradient the DP render emits, at either precision, IS the single-device node at batch R·N, loss divided by R·B.