Item A — the BATCHED EfficientNet-B0 forward graph (true batch-norm, matches the render) #
The EfficientNet peer of MobileNetV2RenderPC.lean / ResNet34RenderPC.lean — but EfficientNet's
operational render (tests/TestEfficientNetFwd.lean) emits true batch-norm (reduce μ/var over the
batch+spatial axes [0,2,3] per channel — bnBatchTensor4), which couples the batch. MNV2/r34
get away with a batch-1 den because their per-channel BN reduces [2,3] (per-example, separable);
EfficientNet's does not. So the forward graph here genuinely lives at the batched index
N·(c·h·w) (StableHLO.batchOp/StableHLO.bnBatchF, StableHLO.lean):
- every batch-separable op (conv / strided conv / depthwise / strided depthwise / dense / GAP / the
whole SE block) is
batchMap Nof the proven per-example op (SHlo.batchOp+BatchableOp/denOp); - the pointwise ops (swish, sigmoid, relu, residual
addV) reuse their EXISTING tokens at the batched index — they are already block-diagonal there, no new token needed; - the one batch-coupled op, true batch-norm, is
SHlo.bnBatchF, denotingbnBatchLA(= the provenbnBatchTensor4, reindexed to the network's left-assocN·(oc·h·w)flat layout).
We prove the FORWARD half — den (graph) = forward — for a representative EfficientNet-B0 that
structurally exercises every element of B0: the stride-2 stem conv-bn-swish, an MBConv1 (t=1,
no expand) SE block, an MBConv6 expand SE block with a stride-2 downsample (3×3 depthwise), an
MBConv6 expand SE block with a 5×5 depthwise and an identity residual skip, the 1×1 conv-bn-swish
head, GAP and the dense classifier — all with true batch-norm and the squeeze-excite gate
(seBlockFull). Squeeze-excite is the genuinely-new structure; here it enters as BatchableOp.seBlock
(= batchMap N seBlockFull).
Like ResNet34RenderPC, faithfulness is per-block (*GraphB_faithful: den (block graph) = block forward (den input)), then chained — so the kernel never reduces the whole net at once. 3-axiom clean.
(The full 16-MBConv [t,c,n,s,k] enumeration is mechanical repetition of these block abbreviations;
the structural + batched-infra content — the batched graph, true batch-norm, SE — is here. The
structured render is Item B; the SE/BN cotangent chain is Item D.)
Batched conv → bn → swish (1×1 expand / generic stride-1 conv).
Equations
- Proofs.cbsB N W b ε γ β = Proofs.swish (N * (oc * h * w)) ∘ Proofs.StableHLO.bnBatchLA N oc h w ε γ β ∘ Proofs.StableHLO.batchMap N (Proofs.flatConv W b)
Instances For
Batched strided (3×3 s2) stem conv → bn → swish (halves spatial). ⚠ At the XLA-SAME phase
(flatConvStride2Xla = decimateOddFlat ∘ flatConv): the TF-origin B0 pads its stem (0,1),
and the shipped render has emitted convStridedXla there since 2026-08-08. The symmetric
flatConvStride2 has the same type and output shape; nothing structural would notice the
wrong one (re-spelled 2026-09-05, planning/archive/xla_same_respell_and_blueprint_audit.md).
Equations
- Proofs.stemB N W b ε γ β = Proofs.swish (N * (oc * h * w)) ∘ Proofs.StableHLO.bnBatchLA N oc h w ε γ β ∘ Proofs.StableHLO.batchMap N (Proofs.flatConvStride2Xla W b)
Instances For
Batched depthwise (stride-1, k×k) → bn → swish.
Equations
- Proofs.dwbsB N W b ε γ β = Proofs.swish (N * (c * h * w)) ∘ Proofs.StableHLO.bnBatchLA N c h w ε γ β ∘ Proofs.StableHLO.batchMap N (Proofs.depthwiseFlat W b)
Instances For
Batched depthwise (stride-2 downsample, k×k) → bn → swish.
Equations
- Proofs.dwbsSB N W b ε γ β = Proofs.swish (N * (c * h * w)) ∘ Proofs.StableHLO.bnBatchLA N c h w ε γ β ∘ Proofs.StableHLO.batchMap N (Proofs.depthwiseStride2Flat W b)
Instances For
Batched squeeze-excite block x ⊙ gate(x) (the proven seBlockFull, per example).
Equations
- Proofs.seB N W₁ b₁ W₂ b₂ = Proofs.StableHLO.batchMap N (Proofs.seBlockFull W₁ b₁ W₂ b₂)
Instances For
Batched project: 1×1 conv → bn (no swish — the linear bottleneck).
Equations
- Proofs.projB N W b ε γ β = Proofs.StableHLO.bnBatchLA N oc h w ε γ β ∘ Proofs.StableHLO.batchMap N (Proofs.flatConv W b)
Instances For
MBConv1 (t=1, no expand): depthwise-bn-swish → SE → project-bn. No residual (ic ≠ oc).
Equations
- Proofs.mbNoExpFwdB N Wd bd εd γd βd Wz₁ bz₁ Wz₂ bz₂ Wp bp εp γp βp = Proofs.projB N Wp bp εp γp βp ∘ Proofs.seB N Wz₁ bz₁ Wz₂ bz₂ ∘ Proofs.dwbsB N Wd bd εd γd βd
Instances For
MBConv6 with a stride-2 downsample: expand-bn-swish (at 2h×2w) → strided depthwise-bn-swish
→ SE → project-bn. No residual (spatial changes).
Equations
- One or more equations did not get rendered due to their size.
Instances For
MBConv6 with an identity residual skip (s=1 ∧ ic=oc=c): x + (project ∘ SE ∘ depthwise ∘ expand)(x).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Head: 1×1 conv-bn-swish → global-avg-pool → dense classifier, all batched.
Equations
- Proofs.headFwdB N Wh bh εh γh βh Wfc bfc = Proofs.StableHLO.batchMap N (Proofs.dense Wfc bfc) ∘ Proofs.StableHLO.batchMap N (Proofs.globalAvgPoolFlat oc h w) ∘ Proofs.cbsB N Wh bh εh γh βh
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
MBConv1 (no expand): dw-bn-swish → SE → project-bn, batched.
Equations
- One or more equations did not get rendered due to their size.
Instances For
MBConv6 strided: expand-bn-swish (at 2h×2w) → strided dw-bn-swish → SE → project-bn, batched.
Equations
- One or more equations did not get rendered due to their size.
Instances For
MBConv6 with identity residual: addV body skip, body = project ∘ SE ∘ dw ∘ expand, batched.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Head: 1×1 conv-bn-swish → GAP → dense, batched.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The representative batched EfficientNet-B0 forward graph at the batched index N·(c·h·w):
stem → MBConv1(no-exp) → MBConv6(strided 3×3) → MBConv6(5×5, residual) → head. Every spatial op
is batchOp; true batch-norm is bnBatchF; pointwise swish is swishF; the residual is
addV. Built by composing the per-block graphs; denotes efficientnetForwardB.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Batched EfficientNet-B0 forward faithfulness. The batched render graph (true batch-norm + SE,
at index N·(c·h·w)) denotes efficientnetForwardB. Chained from the per-block *GraphB_faithful
lemmas (each fires as a simp rewrite, so the kernel never reduces the whole net at once) — the
ResNet34RenderPC recipe lifted to the batched index. The "text = render of a proven forward graph"
half for EfficientNet at the render's genuine (batch-coupled) BN flavor.