The paper-spec MobileNetV2 at inference — all 17 bottlenecks, forward + graph + faithfulness #
The inference twin of MobileNetV2FullB.lean, the batch-BatchNorm training forward. This file
states the same seventeen-block [t,c,n,s] ladder at inference BatchNorm — frozen running
statistics at all 52 sites, one shared ε, as mobilenetv2_fwd_eval does
(mobilenetv2ForwardPaperEval) — and proves its typed SHlo graph denotes it
(mobilenetv2FwdGraphPaperEval_faithful). Both are stated for one example
(x : Vec (3 * 224 * 224)); frozen-statistics BatchNorm does not couple examples. The block
weight records are IVWEval / IVWNoExpEval below; the training records IVW / IVWNoExp are
MobileNetV2FullPaper.lean's.
Pure enumeration and chaining of MobileNetV2StagesPCEval.lean's four inference stage
abbreviations (ivExpandPCEval / ivDepthwisePCEval / ivDepthwiseStridedPCEval /
ivProjectPCEval) and its two bodies, generic in the class count. No new mathematics and no new
tokens: every BatchNorm node's den is bnPerChannelEvalTensor3, proved once.
The SSA names are the eval render's. The training graph (MobileNetV2FullB) names its
parameters %b{k}{e,d,p}{W,g,bt}, as the train-step render does. The eval render uses other
names, and this file's graph carries them verbatim: bnEvalSite's %stnmu/%stnvar for the
stem, %b{k}enmu,
%b{k}dnmu, %b{k}pnmu and their nvar peers per block, %hnmu/%hnvar for the head, around
irSig/irSigNoExp's %We{k}/%ge{k}/%bte{k}/%Wd{k}/%gd{k}/%btd{k}/%Wp{k}/%gp{k}/
%btp{k}, and every conv bias as %zb{c}, the zero constant the render binds it to at
convBias := false. Names are pretty-printing metadata and do not enter den.
FwdGraphTextTies checks the render's stem, head and one block of each kind against this file's
graphs, byte for byte.
Per example, and the artifact is batched. The render writes this graph's own per-example
constructors, printed at the artifact's batch B (mnv2FwdChain): each op takes a leading batch
dimension and none reduces across it — frozen-statistics BatchNorm reads its μ, σ² as inputs, and
the one reduction is the GAP over [2, 3], which FwdGraphTextTies also checks over the whole
rendered module. So the artifact computes this forward at every example of its batch.
What it is tied to. mobilenetv2_fwd_eval.mlir: 263 inputs — %x, 158 parameter tensors
(paperSig at convBias := false, so no bias slot has an argument: the render binds each conv
bias to the %zb{c} zero constant) and 104 statistic slots (52 sites × μ, var) — with mobilenetv2in_fwd_eval.mlir and
mobilenetv2in_fwd_eval_eps0001.mlir its 1000-class twins. The classifier here is generic in
nCls and ε is a binder, so one theorem covers all three.
The artifacts are the zero-bias instance. IVWEval / IVWNoExpEval and the stem and head
carry a conv-bias field per conv site, which den reads, while the graph spells each one as
%zb{c}. So the three artifacts are the instance with every conv bias 0. At inference
BatchNorm a conv bias does not cancel as it does under batch BN, so this is a restriction, not a
reparametrisation.
Paper [t,c,n,s] spec (stem 3×3-s2 3→32 at the XLA-SAME phase; head 1×1 320→1280 → GAP → dense):
(1, 16,1,1) (6, 24,2,2) (6, 32,3,2) (6, 64,4,2) (6, 96,3,1) (6,160,3,2) (6,320,1,1)
Weights and running statistics of one MobileNetV2 bottleneck at inference. No per-site ε:
the eval forward takes ONE shared ε, as the
render emits (a single eps constant), where the training bundle IVW carries one per site.
The conv biases eb, db, pb are fields, but the graph binds them to %zb{c}, so the
committed evals are the instance with all three 0.
- eW : Kernel4 mid ic 1 1
- eb : Vec mid
- eγ : Vec mid
- eβ : Vec mid
- eμ : Vec mid
- ev : Vec mid
- dW : DepthwiseKernel mid 3 3
- db : Vec mid
- dγ : Vec mid
- dβ : Vec mid
- dμ : Vec mid
- dv : Vec mid
- pW : Kernel4 oc mid 1 1
- pb : Vec oc
- pγ : Vec oc
- pβ : Vec oc
- pμ : Vec oc
- pv : Vec oc
Instances For
Weights and running statistics of the t=1 first bottleneck (no expand conv) at inference.
As in IVWEval, the committed evals are the instance with the conv biases 0.
- dW : DepthwiseKernel ic 3 3
- db : Vec ic
- dγ : Vec ic
- dβ : Vec ic
- dμ : Vec ic
- dv : Vec ic
- pW : Kernel4 oc ic 1 1
- pb : Vec oc
- pγ : Vec oc
- pβ : Vec oc
- pμ : Vec oc
- pv : Vec oc
Instances For
All paper-spec MobileNetV2 parameters and running statistics at inference: stem (3×3-s2 3→32)
- the 17 bottlenecks of the
[t,c,n,s]table + head (1×1 320→1280) + dense (1280→nCls). 52 BatchNorm sites, each with its frozenμandv.
- sW : Kernel4 32 3 3 3
- sb : Vec 32
- sγ : Vec 32
- sβ : Vec 32
- sμ : Vec 32
- sv : Vec 32
- b1 : IVWNoExpEval 32 16
- b2 : IVWEval 16 96 24
- b3 : IVWEval 24 144 24
- b4 : IVWEval 24 144 32
- b5 : IVWEval 32 192 32
- b6 : IVWEval 32 192 32
- b7 : IVWEval 32 192 64
- b8 : IVWEval 64 384 64
- b9 : IVWEval 64 384 64
- b10 : IVWEval 64 384 64
- b11 : IVWEval 64 384 96
- b12 : IVWEval 96 576 96
- b13 : IVWEval 96 576 96
- b14 : IVWEval 96 576 160
- b15 : IVWEval 160 960 160
- b16 : IVWEval 160 960 160
- b17 : IVWEval 160 960 320
- hW : Kernel4 1280 320 1 1
- hb : Vec 1280
- hγ : Vec 1280
- hβ : Vec 1280
- hμ : Vec 1280
- hv : Vec 1280
- fcW : Mat 1280 nCls
- fcb : Vec nCls
Instances For
t=1 bottleneck at inference (no expand, no skip): project ∘ depthwise.
Equations
Instances For
Stride-1 bottleneck WITHOUT skip (ic ≠ oc) at inference.
Equations
Instances For
Stride-1 bottleneck WITH the identity skip at inference.
Equations
Instances For
Stride-2 downsampling bottleneck at inference (XLA-SAME depthwise).
Equations
Instances For
The seventeen-block MobileNetV2 inference forward — the paper [t,c,n,s] ladder with
frozen running statistics at all 52 BatchNorm sites, at one shared ε. Nested-application
form (NOT ∘), as the training twin, so the faithfulness proof closes by simp and rfl.
Equations
- One or more equations did not get rendered due to their size.
Instances For
t=1 bottleneck inference graph: bnEval ∘ conv1×1 ∘ relu6 ∘ bnEval ∘ depthwise.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stride-1 no-skip bottleneck inference graph: expand → depthwise → project.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stride-1 skip bottleneck inference graph: the body + the addV identity skip.
Equations
- Proofs.StableHLO.ivResidGraphEvalW k epsStr h w ε p e = (Proofs.StableHLO.ivExpOnlyGraphEvalW k epsStr h w ε p e).addV e
Instances For
Stride-2 downsampling bottleneck inference graph: expand at 2h×2w → XLA-SAME strided
depthwise → project.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stem inference graph: 3×3/s2 XLA-SAME conv → BN (stn) → relu6.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Head inference graph: 1×1 conv → BN (hn) → relu6 → GAP → dense.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The full paper-spec MobileNetV2 inference forward graph (3×224² → nCls): XLA-SAME
strided stem → the 17 bottlenecks of the [t,c,n,s] table → 1×1 conv-bn-relu6 head → GAP →
dense, every one of the 52 BatchNorm sites reading frozen running statistics through
bnPerChannelEvalF. The typed form of the shipped mobilenetv2_fwd_eval.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Seventeen-block inference MobileNetV2 forward faithfulness. The typed graph denotes
mobilenetv2ForwardPaperEval, for every shared ε, weight record and input example.