StableHLOPretty — the printer: SHlo terms → StableHLO text #
The syntactic half of StableHLO:
pretty B g renders a term of the AST whose denotation den the proofs are about. SSA names are
annotations den ignores, and skel erases the ℝ values, so the rendered text depends on the
graph's shape and names only.
| part | what |
|---|---|
ty / tyI1 / tyBf16 / tyF8, fresh, the ShapeTbl helpers | type strings, SSA names, the name ↦ shape table |
Raw, skel | the value-erased skeleton of an SHlo term |
Tok, toToks | the post-order token stream |
emitContract, emitTok, serializeToks | StableHLO text per token (f32 / bf16 / fp8) |
pretty, prettyAdamW, prettyAllReduceMean, renderModule | whole graphs and modules |
fmt6 / fmt12, RmsHyper, bias-slot helpers | the literal and constant blocks the renderers share |
*ModuleV, linTrainStepText | the chapter 1–3 renderers |
A module that states den facts imports StableHLO alone; one that renders text imports this.
Trusted: the text emitTok prints for each token (operand order and arity, types, the lexical
syntax) is not proved. scripts/gates/parse_verified_mlir.py parses every committed
verified_mlir/*.mlir as StableHLO, and the trainers execute the artifacts they load under PJRT;
StableHLOParse.roundtrip covers only the token encoding toToks, not the text.
Tensor-type string tensor<d₀x…xf32>.
Equations
- Proofs.StableHLO.ty dims = "tensor<" ++ "x".intercalate (List.map toString dims ++ ["f32"]) ++ ">"
Instances For
Boolean (i1) tensor-type string, for compare/select masks.
Equations
- Proofs.StableHLO.tyI1 dims = "tensor<" ++ "x".intercalate (List.map toString dims ++ ["i1"]) ++ ">"
Instances For
fp8 peer of tyBf16. E4M3 only — f8E5M2 compiles, lowers to a plain
__cublas$lt$matmul, and leaves ZERO f8e5m2 values in the optimized HLO: the type is
silently widened away. Only E4M3 reaches the fp8 units on sm_89, so there is deliberately no
E5M2 spelling here.
Equations
- Proofs.StableHLO.tyF8 dims = "tensor<" ++ "x".intercalate (List.map toString dims ++ ["f8E4M3FN"]) ++ ">"
Instances For
SSA name ↦ the [c,h,w] the value bound to that name really carries. See liftPointwise.
Keyed by NAME, not by flat width — and that is not a refinement, it is the whole
correctness of the table. A width table collides whenever two layers have the same element
count, and on the real nets they do: ConvNeXt-T's stage-2 MLP is 1536·14·14 = 301056 and its
stage-0 block is 96·56·56 = 301056; stage 3's 3072·7·7 equals stage 1's 192·28·28. First
writer won, so 24 of ConvNeXt's pointwise blocks unflattened to a shape with the right element
count and the wrong layout — which is not a wrong program (the bracket is still an inverse
reshape pair) but is exactly the relayout the bracket exists to remove. Keying by name cut
ConvNeXt-T's transpose traffic by an order of magnitude and shortened its step
(planning/archive/next_session_execution_and_parity.md).
Newest entry first, and no dedup: fresh never reuses a name, so a lookup for a value the
previous token produced hits the head of the list.
The Bool is the value's LAYOUT: true means this is the map's row view [h·w, c]
rather than the map [c, h, w]. It is not bookkeeping — it is what makes ConvNeXt's channel-LN
transparent. That chain is transpose → lnRow → rowScale → rowBias → transpose, a layout ROUND
TRIP whose two ends are the same [c,h,w] map; without the flag the closing transpose's result
has no entry, the drop-path multiply that consumes it falls back to flat, and every pointwise op
after it on the residual chain goes with it, which measurably grows ConvNeXt-T's relayout
traffic (the same plan doc). And liftPointwise must NOT fire on a row view: [h·w, c] reshaped to
[B,c,h,w] is a DIFFERENT permutation, not an inverse pair, so that one would be a wrong
program rather than a slow one.
Instances For
Emitter state: the fresh-name counter, plus the name ↦ [c,h,w] table.
The table lives in the STATE rather than in a pretty argument because a net renderer
calls pretty once per graph FRAGMENT — a conv and the activation that consumes it land in
different calls — and only the state is threaded across them.
Equations
Instances For
The row-max shift both max-shifted softmax emits share: {mx} = each row's max of the
[B,m,n] scores {xn} (reduce maximum over [2] from -inf), broadcast back and subtracted, so
{sh} = xn − max has every entry ≤ 0 and the exp that follows cannot overflow.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The 3×3/s2 pool's emitted forward text, given already-freshened names.
It is a shared helper rather than two copies for the reason sWGradGeom is: the
per-example .maxPool3s2F and the batched BatchableOp.maxPool3s2 are two emitTok arms
emitting one program, and a window or padding that drifted between them would be a pair of
renders that agree on every structural check and compute different functions — which is the
exact failure this whole op exists to fix. With one writer they cannot drift, and
TestBatchedEmitTie then measures rather than assumes it.
window_dimensions = 3, window_strides = 2, padding = [[1,1],[1,1]] on the spatial axes: He
et al./torchvision MaxPool2d(3, stride=2, padding=1), window i = input [2i−1, 2i+1].
NOT XLA 'SAME', which pads (0,1) and slides the grid one input position — the two are
different functions everywhere.
Instances For
The 3×3/s2 pool's emitted backward text, from the saved input xN and the cotangent r;
returns the text and the output's name. Shared by the per-example and batched arms, for
maxPool3s2FwdText's reason. It draws its own fresh names because it emits some fifty values.
This is maxPool3s2BackFlat written without stablehlo.select_and_scatter. No IREE
release lowers that op when the windows OVERLAP — upstream StableHLO's linalg legalization
handles only window = stride — so until 2026-10-28 neither ResNet compiled through the second
lowerer at all (maxPoolBack's 2×2 windows tile, so it keeps the op). XLA lowers both
spellings. The same function, as nine strided slices:
- pad the input with
-infby one on each spatial side: window(oh, ow)is then the 3×3 block at[2oh, 2oh+2] × [2ow, 2ow+2]of the padded map, and a pad cell never wins a max because every window holds a real cell; - slice the padded map at each window offset
(i, j)with stride 2 —s_ij[oh, ow]is the cell at offset(i, j)of window(oh, ow)— so onemaximumover the nine is the forward's maxm; - the first-max mask, in ROW-MAJOR window order:
mask_ij = (s_ij = m) ∧ ¬claimed, withclaimedthe OR of the earlier equalities. That is theGEselect's choice, a later equal never displacing an earlier one, and thewindowArgmaxthe denotation names; - route:
c_ij = select mask_ij dy 0; - scatter: pad
c_ijwith interior 1 and edges(i, 3−i)/(j, 3−j), which putsc_ij[oh, ow]at padded cell(2oh+i, 2ow+j), the cell it was read from; - SUM the nine — an input is the argmax of up to four windows and the cotangent accumulates,
which is what the scatter region's
adddid — and slice the pad border off.
Checked at the stem shape (32×64×112×112) with ties forced: against XLA's own
select_and_scatter (JAX CPU) and against an independent argmax/bincount reference, identical
to 5e-7 — fp32 summation order, nothing else (atlas, 2026-10-28).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The 2×2/s2 pool's emitted forward text on the flat input r; returns the text and the
output's name. One writer for the per-example .maxPoolF token and the batched "maxPool"
descriptor, for maxPool3s2FwdText's reason. The windows tile, so there is no padding.
The region block arguments %pa/%pb/%pm are spelled out, so they are reserved SSA names.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The 2×2/s2 pool's emitted backward text, from the saved input xN and the cotangent r;
returns the text and the output's name. One writer for the .maxPoolBack token and the batched
"maxPoolBackP" tag. The windows tile, so stablehlo.select_and_scatter lowers in both
compilers and stays (contrast maxPool3s2BackText).
NOTE the region block arguments %sa/%sb/%sc/%sd (and %sge/%ss) are HARDCODED, so
they are reserved SSA names: a top-level value of the same name is a redefinition error, and it
only surfaces at XLA compile time.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The stochastic-depth mask input name for ramp index i — the mName a dropPathB carries,
and the tensor<Bxf32> the signature declares for it.
It lives HERE, beside the emitter, rather than in one net's renderer, because the spelling is
load-bearing in three places that must agree and only one of them is Lean: dropPathP's emit
reads it as an operand, every SD render's signature declares it, and
scripts/probes/misplace_drop_sites.py matches %dp\d+ textually to build the placement control.
A second definition would be the double-writer disease with a committed shell script as the
third writer.
Equations
- Proofs.StableHLO.dpName i = toString "%dp" ++ toString i
Instances For
The classifier-dropout mask input name — the mName a dropoutB carries, and the
tensor<B×n×f32> the signature declares for it.
IT IS DELIBERATELY NOT %dp{i}-SHAPED, and that is not cosmetic.
scripts/probes/misplace_drop_sites.py builds the stochastic-depth placement control by matching
%dp\d+ textually; a dropout input spelled %dp9 would be swept into that rewrite, silently
changing a control's meaning on a render it was never written for. A control that quietly
does nothing reads exactly like a control that ran, and the cheap defence is a name the SD
tooling cannot match.
grep -c '%do' verified_mlir/*.mlir is 0 across every committed artifact.
Equations
- Proofs.StableHLO.doName = "%do"
Instances For
The renderable skeleton of an SHlo graph: opcodes + shapes + leaf SSA
names, with ℝ operand values and the shape index erased — exactly what
reaches the emitted text.
- operand (name : String) (n : ℕ) : Raw
- dotIn (w : String) (m n : ℕ) : Raw → Raw
- dotInBf16 (w : String) (m n : ℕ) : Raw → Raw
- dotOut (w : String) (m n : ℕ) : Raw → Raw
- addBcast (b : String) (n : ℕ) : Raw → Raw
- expe (n : ℕ) : Raw → Raw
- softmaxDiv (n : ℕ) : Raw → Raw
- sub (n : ℕ) : Raw → Raw → Raw
- weightSgd (xName wName lrStr : String) (m n : ℕ) : Raw → Raw
- biasSgd (bName lrStr : String) (n : ℕ) : Raw → Raw
- convWeightSgd (xName wName lrStr : String) (ic oc h w kH kW : ℕ) : Raw → Raw
- convBiasSgd (bName lrStr : String) (oc h w : ℕ) : Raw → Raw
- bnGammaSgd (gName vName epsStr lrStr : String) (oc h w : ℕ) : Raw → Raw
- bnBetaSgd (bName lrStr : String) (oc h w : ℕ) : Raw → Raw
- layerScaleChGammaSgd (gName xName lrStr : String) (c h w : ℕ) : Raw → Raw
- lnGammaSgd (gName xName epsStr lrStr : String) (n : ℕ) : Raw → Raw
- lnBetaSgd (bName lrStr : String) (n : ℕ) : Raw → Raw
- veclnGammaSgd (gName xName epsStr lrStr : String) (N D : ℕ) : Raw → Raw
- patchEmbedWeightSgd (wName xName lrStr : String) (ic H W P N D : ℕ) : Raw → Raw
- reluF (n : ℕ) : Raw → Raw
- selectPos (x : String) (n : ℕ) : Raw → Raw
- relu6F (n : ℕ) : Raw → Raw
- selectMid (x : String) (n : ℕ) : Raw → Raw
- convertF (n : ℕ) : Raw → Raw
- flatConvF (w b : String) (ic oc h w' kH kW : ℕ) : Raw → Raw
- flatConvFBf16 (w b : String) (ic oc h w' kH kW : ℕ) : Raw → Raw
- maxPoolF (c h w : ℕ) : Raw → Raw
- convBack (w : String) (ic oc h w' kH kW : ℕ) : Raw → Raw
- maxPoolBack (x : String) (c h w : ℕ) : Raw → Raw
- bnF (g b eps : String) (n : ℕ) : Raw → Raw
- bnBack (g x eps : String) (n : ℕ) : Raw → Raw
- addV (n : ℕ) : Raw → Raw → Raw
- gapF (c h w : ℕ) : Raw → Raw
- gapBack (c h w : ℕ) : Raw → Raw
- broadcastBack (c h w : ℕ) : Raw → Raw
- flatConvStridedF (w b : String) (ic oc h w' kH kW : ℕ) : Raw → Raw
- flatConvStridedXlaF (w b : String) (ic oc h w' kH kW : ℕ) : Raw → Raw
- convStridedBack (w : String) (ic oc h w' kH kW : ℕ) : Raw → Raw
- convStridedWeightSgd (xName wName lrStr : String) (ic oc h w' kH kW : ℕ) : Raw → Raw
- depthwiseWeightSgd (xName wName lrStr : String) (c h w' kH kW : ℕ) : Raw → Raw
- depthwiseStridedWeightSgd (xName wName lrStr : String) (c h w' kH kW : ℕ) : Raw → Raw
- convStridedXlaWeightSgd (xName wName lrStr : String) (ic oc h w' kH kW : ℕ) : Raw → Raw
- depthwiseStridedXlaWeightSgd (xName wName lrStr : String) (c h w' kH kW : ℕ) : Raw → Raw
- flatConvStride4F (w b : String) (ic oc h w' kH kW : ℕ) : Raw → Raw
- bnPerChannelF (g b eps : String) (oc h w : ℕ) : Raw → Raw
- bnPerChannelBack (g x eps : String) (oc h w : ℕ) : Raw → Raw
- bnPerChannelEvalF (g b mu var eps : String) (oc h w : ℕ) : Raw → Raw
- weightGrad (x : String) (m n : ℕ) : Raw → Raw
- biasGrad (n : ℕ) : Raw → Raw
- convWeightGrad (x : String) (ic oc h w' kH kW : ℕ) : Raw → Raw
- convBiasGrad (ic oc h w' kH kW : ℕ) : Raw → Raw
- convStridedWeightGrad (x : String) (ic oc h w' kH kW : ℕ) : Raw → Raw
- bnGammaGrad (v eps : String) (oc h w' : ℕ) : Raw → Raw
- bnBetaGrad (oc h w' : ℕ) : Raw → Raw
- adamMNextF (m b1 ob1 : String) (ds : List ℕ) : Raw → Raw
- adamVNextF (v b2 ob2 : String) (ds : List ℕ) : Raw → Raw
- adamWParamF (θ m v b1 ob1 b2 ob2 bc1 bc2 lr eps wd : String) (ds : List ℕ) : Raw → Raw
- sgdParamF (θ lr : String) (ds : List ℕ) : Raw → Raw
- momVNextF (v mu : String) (ds : List ℕ) : Raw → Raw
- momParamF (θ v mu lr : String) (ds : List ℕ) : Raw → Raw
- rmsBufNextF (sq buf rho orho mu eps : String) (ds : List ℕ) : Raw → Raw
- rmsBufNextTfF (sq buf rho orho mu eps lr : String) (ds : List ℕ) : Raw → Raw
- gradSumSqAccF (ds : List ℕ) : Raw → Raw → Raw
- clipScaleF (clipStr epsStr : String) (ds : List ℕ) : Raw → Raw → Raw
- lambDirF (θ m v b1 ob1 b2 ob2 bc1 bc2 eps wd : String) (ds : List ℕ) : Raw → Raw
- lambScaleF (ds : List ℕ) : Raw → Raw → Raw
- depthwiseF (w b : String) (c h w' kH kW : ℕ) : Raw → Raw
- depthwiseBack (w : String) (c h w' kH kW : ℕ) : Raw → Raw
- depthwiseStridedF (w b : String) (c h w' kH kW : ℕ) : Raw → Raw
- depthwiseStridedXlaF (w b : String) (c h w' kH kW : ℕ) : Raw → Raw
- depthwiseStridedBack (w : String) (c h w' kH kW : ℕ) : Raw → Raw
- depthwiseStridedXlaBack (w : String) (c h w' kH kW : ℕ) : Raw → Raw
- swishF (n : ℕ) : Raw → Raw
- swishBack (x : String) (n : ℕ) : Raw → Raw
- sigmoidF (n : ℕ) : Raw → Raw
- sigmoidBack (x : String) (n : ℕ) : Raw → Raw
- geluF (gf : GeluForm) (n : ℕ) : Raw → Raw
- geluBack (gf : GeluForm) (x : String) (n : ℕ) : Raw → Raw
- layerScaleF (γ : String) (n : ℕ) : Raw → Raw
- layerScaleChF (γ : String) (c h w : ℕ) : Raw → Raw
- softmaxRowF (m n : ℕ) : Raw → Raw
- softmaxRowBack (x : String) (m n : ℕ) : Raw → Raw
- softmaxRowBackShift (x : String) (m n : ℕ) : Raw → Raw
- matmulF (m k n : ℕ) : Raw → Raw → Raw
- transposeF (m n : ℕ) : Raw → Raw
- scaleF (s : String) (n : ℕ) : Raw → Raw
- lnRowF (g b eps : String) (m n : ℕ) : Raw → Raw
- lnRowBack (g x eps : String) (m n : ℕ) : Raw → Raw
- denseRowF (w b : String) (N a c : ℕ) : Raw → Raw
- denseRowBack (w : String) (N a c : ℕ) : Raw → Raw
- patchEmbedF (w b cls pos : String) (ic H W P N D : ℕ) : Raw → Raw
- clsSliceF (N D : ℕ) : Raw → Raw
- clsPadF (N D : ℕ) : Raw → Raw
- headSliceF (N heads d hIdx : ℕ) : Raw → Raw
- headPadF (N heads d hIdx : ℕ) : Raw → Raw
- rowScaleF (g : String) (m n : ℕ) : Raw → Raw
- rowBiasF (b : String) (m n : ℕ) : Raw → Raw
- batched (tag : String) (names : List String) (info : List ℕ) : Raw → Raw
- batched2 (tag : String) (names : List String) (info : List ℕ) : Raw → Raw → Raw
- allReduceMean (R : ℕ) (t : String) (ds : List ℕ) : Raw → Raw
Instances For
Equations
- Proofs.StableHLO.instReprRaw = { reprPrec := Proofs.StableHLO.instReprRaw.repr }
Equations
The (tag, names, info) skeleton descriptor of a batched per-example op — the
discriminator + the SSA names the emit references + the shape dims. Keeps the
batchOp skel one line and isolates the 7-variant match into a pure function.
Equations
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.conv wN bN W bias) = ("conv", [wN, bN], [N, ic, oc, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.convStrided wN bN W bias) = ("convStrided", [wN, bN], [N, ic, oc, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.convBf16 rnd wN bN W bias) = ("convBf16", [wN, bN], [N, ic, oc, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.convF8 rnd wN bN W bias) = ("convF8", [wN, bN], [N, ic, oc, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.convStridedBf16 rnd wN bN W bias) = ("convStridedBf16", [wN, bN], [N, ic, oc, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.convStridedXla wN bN W bias) = ("convStridedXla", [wN, bN], [N, ic, oc, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.convStridedXlaBf16 rnd wN bN W bias) = ("convStridedXlaBf16", [wN, bN], [N, ic, oc, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.depthwise wN bN W bias) = ("depthwise", [wN, bN], [N, c, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.depthwiseBf16 rnd wN bN W bias) = ("depthwiseBf16", [wN, bN], [N, c, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.depthwiseStrided wN bN W bias) = ("depthwiseStrided", [wN, bN], [N, c, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.depthwiseStridedBf16 rnd wN bN W bias) = ("depthwiseStridedBf16", [wN, bN], [N, c, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.depthwiseStridedXla wN bN W bias) = ("depthwiseStridedXla", [wN, bN], [N, c, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.depthwiseStridedXlaBf16 rnd wN bN W bias) = ("depthwiseStridedXlaBf16", [wN, bN], [N, c, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.dense wN bN W bias) = ("dense", [wN, bN], [N, a, b])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.convBackP wN W b_2) = ("convBackP", [wN], [N, ic, oc, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.gap = ("gap", [], [N, b, h, w])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.seBlock w1 b1 w2 b2 W₁ b₁ W₂ b₂) = ("seBlock", [w1, b1, w2, b2], [N, c, h, w, r])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.bnEval gN bN muN varN es ε γ β μ var) = ("bnEval", [gN, bN, muN, varN, es], [N, oc, h, w])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.swish = ("swish", [], [N, b])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.relu = ("relu", [], [N, b])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.relu6 = ("relu6", [], [N, b])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.maxPool = ("maxPool", [], [N, c, h, w])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.maxPool3s2 = ("maxPool3s2", [], [N, c, h, w])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.softmaxRow = ("softmaxRow", [], [N, m, n])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.softmaxRowShift = ("softmaxRowShift", [], [N, m, n])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.denseRowBack wN W) = ("denseRowBackP", [wN], [N, rows, a_2, c])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.denseRowBackBf16 rnd wN W) = ("denseRowBackPBf16", [wN], [N, rows, a_2, c])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.gelu Proofs.GeluForm.tanh) = ("gelu", [], [N, b])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.gelu Proofs.GeluForm.erf) = ("geluErf", [], [N, b])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.transpose = ("transposeP", [], [N, m, n])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.convStride4 wN bN W bias) = ("convStride4P", [wN, bN], [N, ic, oc, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.convStride4Bf16 rnd wN bN W bias) = ("convStride4PBf16", [wN, bN], [N, ic, oc, h, w, kH, kW])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.layerScaleCh gN γ) = ("layerScaleChP", [gN], [N, c, h, w])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.dotOut wN W) = ("dotOutP", [wN], [N, b, a])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.expe = ("expeP", [], [N, b])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.softmaxDiv = ("softmaxDivP", [], [N, b])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.lnRow gN bN es ε γ β) = ("lnRowP", [gN, bN, es], [N, m, n])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.rowScale gN γ) = ("rowScaleP", [gN], [N, m, n])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.rowBias bN β) = ("rowBiasP", [bN], [N, m, n])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.denseRow wN bN W b_2) = ("denseRowP", [wN, bN], [N, tk, a_2, c])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.denseRowBf16 rnd wN bN W b_2) = ("denseRowPBf16", [wN, bN], [N, tk, a_2, c])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.patchEmbed wN bN clsN posN Wc bc cls pos) = ("patchEmbedP", [wN, bN, clsN, posN], [N, ic, H, W, P, tk, D])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.patchEmbedBf16 rnd wN bN clsN posN Wc bc cls pos) = ("patchEmbedPBf16", [wN, bN, clsN, posN], [N, ic, H, W, P, tk, D])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.clsSlice = ("clsSliceP", [], [N, tk, b])
- Proofs.StableHLO.batchOpDescr N Proofs.StableHLO.BatchableOp.clsPad = ("clsPadP", [], [N, tk, a])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.headSlice h) = ("headSliceP", [], [N, tk, heads, d, ↑h])
- Proofs.StableHLO.batchOpDescr N (Proofs.StableHLO.BatchableOp.headPad h) = ("headPadP", [], [N, tk, heads, d, ↑h])
Instances For
Erase an SHlo graph to its renderable skeleton (drops ℝ values + shape
index; keeps op structure, shapes, leaf names).
Instances For
One serialized token: an opcode with shapes/names; operands are positional.
- operand (name : String) (n : ℕ) : Tok
- dotIn (w : String) (m n : ℕ) : Tok
- dotInBf16 (w : String) (m n : ℕ) : Tok
- dotOut (w : String) (m n : ℕ) : Tok
- addBcast (b : String) (n : ℕ) : Tok
- expe (n : ℕ) : Tok
- softmaxDiv (n : ℕ) : Tok
- sub (n : ℕ) : Tok
- weightSgd (xName wName lrStr : String) (m n : ℕ) : Tok
- biasSgd (bName lrStr : String) (n : ℕ) : Tok
- convWeightSgd (xName wName lrStr : String) (ic oc h w kH kW : ℕ) : Tok
- convBiasSgd (bName lrStr : String) (oc h w : ℕ) : Tok
- bnGammaSgd (gName vName epsStr lrStr : String) (oc h w : ℕ) : Tok
- bnBetaSgd (bName lrStr : String) (oc h w : ℕ) : Tok
- layerScaleChGammaSgd (gName xName lrStr : String) (c h w : ℕ) : Tok
- lnGammaSgd (gName xName epsStr lrStr : String) (n : ℕ) : Tok
- lnBetaSgd (bName lrStr : String) (n : ℕ) : Tok
- veclnGammaSgd (gName xName epsStr lrStr : String) (N D : ℕ) : Tok
- patchEmbedWeightSgd (wName xName lrStr : String) (ic H W P N D : ℕ) : Tok
- reluF (n : ℕ) : Tok
- selectPos (x : String) (n : ℕ) : Tok
- relu6F (n : ℕ) : Tok
- selectMid (x : String) (n : ℕ) : Tok
- convertF (n : ℕ) : Tok
- flatConvF (w b : String) (ic oc h w' kH kW : ℕ) : Tok
- flatConvFBf16 (w b : String) (ic oc h w' kH kW : ℕ) : Tok
- maxPoolF (c h w : ℕ) : Tok
- convBack (w : String) (ic oc h w' kH kW : ℕ) : Tok
- maxPoolBack (x : String) (c h w : ℕ) : Tok
- bnF (g b eps : String) (n : ℕ) : Tok
- bnBack (g x eps : String) (n : ℕ) : Tok
- addV (n : ℕ) : Tok
- gapF (c h w : ℕ) : Tok
- gapBack (c h w : ℕ) : Tok
- broadcastBack (c h w : ℕ) : Tok
- flatConvStridedF (w b : String) (ic oc h w' kH kW : ℕ) : Tok
- flatConvStridedXlaF (w b : String) (ic oc h w' kH kW : ℕ) : Tok
- convStridedBack (w : String) (ic oc h w' kH kW : ℕ) : Tok
- convStridedWeightSgd (xName wName lrStr : String) (ic oc h w' kH kW : ℕ) : Tok
- depthwiseWeightSgd (xName wName lrStr : String) (c h w' kH kW : ℕ) : Tok
- depthwiseStridedWeightSgd (xName wName lrStr : String) (c h w' kH kW : ℕ) : Tok
- convStridedXlaWeightSgd (xName wName lrStr : String) (ic oc h w' kH kW : ℕ) : Tok
- depthwiseStridedXlaWeightSgd (xName wName lrStr : String) (c h w' kH kW : ℕ) : Tok
- flatConvStride4F (w b : String) (ic oc h w' kH kW : ℕ) : Tok
- bnPerChannelF (g b eps : String) (oc h w : ℕ) : Tok
- bnPerChannelBack (g x eps : String) (oc h w : ℕ) : Tok
- bnPerChannelEvalF (g b mu var eps : String) (oc h w : ℕ) : Tok
- weightGrad (x : String) (m n : ℕ) : Tok
- biasGrad (n : ℕ) : Tok
- convWeightGrad (x : String) (ic oc h w' kH kW : ℕ) : Tok
- convBiasGrad (ic oc h w' kH kW : ℕ) : Tok
- convStridedWeightGrad (x : String) (ic oc h w' kH kW : ℕ) : Tok
- bnGammaGrad (v eps : String) (oc h w' : ℕ) : Tok
- bnBetaGrad (oc h w' : ℕ) : Tok
- adamMNextF (m b1 ob1 : String) (ds : List ℕ) : Tok
- adamVNextF (v b2 ob2 : String) (ds : List ℕ) : Tok
- adamWParamF (θ m v b1 ob1 b2 ob2 bc1 bc2 lr eps wd : String) (ds : List ℕ) : Tok
- sgdParamF (θ lr : String) (ds : List ℕ) : Tok
- momVNextF (v mu : String) (ds : List ℕ) : Tok
- momParamF (θ v mu lr : String) (ds : List ℕ) : Tok
- rmsBufNextF (sq buf rho orho mu eps : String) (ds : List ℕ) : Tok
- rmsBufNextTfF (sq buf rho orho mu eps lr : String) (ds : List ℕ) : Tok
- gradSumSqAccF (ds : List ℕ) : Tok
- clipScaleF (clipStr epsStr : String) (ds : List ℕ) : Tok
- lambDirF (θ m v b1 ob1 b2 ob2 bc1 bc2 eps wd : String) (ds : List ℕ) : Tok
- lambScaleF (ds : List ℕ) : Tok
- depthwiseF (w b : String) (c h w' kH kW : ℕ) : Tok
- depthwiseBack (w : String) (c h w' kH kW : ℕ) : Tok
- depthwiseStridedF (w b : String) (c h w' kH kW : ℕ) : Tok
- depthwiseStridedXlaF (w b : String) (c h w' kH kW : ℕ) : Tok
- depthwiseStridedBack (w : String) (c h w' kH kW : ℕ) : Tok
- depthwiseStridedXlaBack (w : String) (c h w' kH kW : ℕ) : Tok
- swishF (n : ℕ) : Tok
- swishBack (x : String) (n : ℕ) : Tok
- sigmoidF (n : ℕ) : Tok
- sigmoidBack (x : String) (n : ℕ) : Tok
- geluF (gf : GeluForm) (n : ℕ) : Tok
- geluBack (gf : GeluForm) (x : String) (n : ℕ) : Tok
- layerScaleF (γ : String) (n : ℕ) : Tok
- layerScaleChF (γ : String) (c h w : ℕ) : Tok
- softmaxRowF (m n : ℕ) : Tok
- softmaxRowBack (x : String) (m n : ℕ) : Tok
- softmaxRowBackShift (x : String) (m n : ℕ) : Tok
- matmulF (m k n : ℕ) : Tok
- transposeF (m n : ℕ) : Tok
- scaleF (s : String) (n : ℕ) : Tok
- lnRowF (g b eps : String) (m n : ℕ) : Tok
- lnRowBack (g x eps : String) (m n : ℕ) : Tok
- denseRowF (w b : String) (N a c : ℕ) : Tok
- denseRowBack (w : String) (N a c : ℕ) : Tok
- patchEmbedF (w b cls pos : String) (ic H W P N D : ℕ) : Tok
- clsSliceF (N D : ℕ) : Tok
- clsPadF (N D : ℕ) : Tok
- headSliceF (N heads d hIdx : ℕ) : Tok
- headPadF (N heads d hIdx : ℕ) : Tok
- rowScaleF (g : String) (m n : ℕ) : Tok
- rowBiasF (b : String) (m n : ℕ) : Tok
- batched (tag : String) (names : List String) (info : List ℕ) : Tok
- batched2 (tag : String) (names : List String) (info : List ℕ) : Tok
- allReduceMean (R : ℕ) (t : String) (ds : List ℕ) : Tok
Instances For
Equations
- Proofs.StableHLO.instReprTok = { reprPrec := Proofs.StableHLO.instReprTok.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Postorder serialization: children, then the node's opcode token.
Equations
- One or more equations did not get rendered due to their size.
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.operand nm n) = [Proofs.StableHLO.Tok.operand nm n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.dotIn w m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.dotIn w m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.dotInBf16 w m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.dotInBf16 w m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.dotOut w m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.dotOut w m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.addBcast b n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.addBcast b n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.expe n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.expe n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.softmaxDiv n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.softmaxDiv n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.sub n a b) = Proofs.StableHLO.toToks a ++ Proofs.StableHLO.toToks b ++ [Proofs.StableHLO.Tok.sub n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.weightSgd xN wN lrS m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.weightSgd xN wN lrS m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.biasSgd bN lrS n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.biasSgd bN lrS n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.convWeightSgd xN wN lrS ic oc h w kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.convWeightSgd xN wN lrS ic oc h w kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.convBiasSgd bN lrS oc h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.convBiasSgd bN lrS oc h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.bnGammaSgd gN vN es lrS oc h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.bnGammaSgd gN vN es lrS oc h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.bnBetaSgd bN lrS oc h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.bnBetaSgd bN lrS oc h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.layerScaleChGammaSgd gN xN lrS c h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.layerScaleChGammaSgd gN xN lrS c h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.lnGammaSgd gN xN es lrS n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.lnGammaSgd gN xN es lrS n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.lnBetaSgd bN lrS n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.lnBetaSgd bN lrS n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.veclnGammaSgd gN xN es lrS N D e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.veclnGammaSgd gN xN es lrS N D]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.patchEmbedWeightSgd wN xN lrS ic H W P N D e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.patchEmbedWeightSgd wN xN lrS ic H W P N D]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.reluF n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.reluF n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.selectPos x_1 n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.selectPos x_1 n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.relu6F n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.relu6F n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.selectMid x_1 n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.selectMid x_1 n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.convertF n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.convertF n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.flatConvF w b ic oc h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.flatConvF w b ic oc h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.flatConvFBf16 w b ic oc h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.flatConvFBf16 w b ic oc h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.maxPoolF c h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.maxPoolF c h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.convBack w ic oc h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.convBack w ic oc h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.maxPoolBack x_1 c h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.maxPoolBack x_1 c h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.bnF g b eps n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.bnF g b eps n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.bnBack g x_1 eps n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.bnBack g x_1 eps n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.addV n a b) = Proofs.StableHLO.toToks a ++ Proofs.StableHLO.toToks b ++ [Proofs.StableHLO.Tok.addV n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.gapF c h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.gapF c h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.gapBack c h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.gapBack c h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.broadcastBack c h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.broadcastBack c h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.flatConvStridedF w b ic oc h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.flatConvStridedF w b ic oc h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.flatConvStridedXlaF w b ic oc h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.flatConvStridedXlaF w b ic oc h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.convStridedBack w ic oc h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.convStridedBack w ic oc h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.depthwiseWeightSgd xN wN lrS c h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.depthwiseWeightSgd xN wN lrS c h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.flatConvStride4F w b ic oc h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.flatConvStride4F w b ic oc h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.bnPerChannelF g b eps oc h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.bnPerChannelF g b eps oc h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.bnPerChannelBack g x_1 eps oc h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.bnPerChannelBack g x_1 eps oc h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.bnPerChannelEvalF g b mu var eps oc h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.bnPerChannelEvalF g b mu var eps oc h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.weightGrad x_1 m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.weightGrad x_1 m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.biasGrad n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.biasGrad n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.convWeightGrad x_1 ic oc h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.convWeightGrad x_1 ic oc h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.convBiasGrad ic oc h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.convBiasGrad ic oc h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.convStridedWeightGrad x_1 ic oc h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.convStridedWeightGrad x_1 ic oc h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.bnGammaGrad v eps oc h w' e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.bnGammaGrad v eps oc h w']
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.bnBetaGrad oc h w' e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.bnBetaGrad oc h w']
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.adamMNextF m b1 ob1 ds e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.adamMNextF m b1 ob1 ds]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.adamVNextF v b2 ob2 ds e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.adamVNextF v b2 ob2 ds]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.sgdParamF θ lr ds e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.sgdParamF θ lr ds]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.momVNextF v mu ds e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.momVNextF v mu ds]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.momParamF θ v mu lr ds e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.momParamF θ v mu lr ds]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.rmsBufNextF sq buf rho orho mu eps ds e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.rmsBufNextF sq buf rho orho mu eps ds]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.rmsBufNextTfF sq buf rho orho mu eps lr ds e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.rmsBufNextTfF sq buf rho orho mu eps lr ds]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.gradSumSqAccF ds acc e) = Proofs.StableHLO.toToks acc ++ Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.gradSumSqAccF ds]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.clipScaleF cS eS ds s e) = Proofs.StableHLO.toToks s ++ Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.clipScaleF cS eS ds]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.lambDirF a b c d e' f g h i j k ds x_1) = Proofs.StableHLO.toToks x_1 ++ [Proofs.StableHLO.Tok.lambDirF a b c d e' f g h i j k ds]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.lambScaleF ds s e) = Proofs.StableHLO.toToks s ++ Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.lambScaleF ds]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.depthwiseF w b c h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.depthwiseF w b c h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.depthwiseBack w c h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.depthwiseBack w c h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.depthwiseStridedF w b c h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.depthwiseStridedF w b c h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.depthwiseStridedXlaF w b c h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.depthwiseStridedXlaF w b c h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.depthwiseStridedBack w c h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.depthwiseStridedBack w c h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.depthwiseStridedXlaBack w c h w' kH kW e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.depthwiseStridedXlaBack w c h w' kH kW]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.swishF n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.swishF n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.swishBack x_1 n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.swishBack x_1 n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.sigmoidF n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.sigmoidF n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.sigmoidBack x_1 n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.sigmoidBack x_1 n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.geluF gf n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.geluF gf n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.geluBack gf x_1 n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.geluBack gf x_1 n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.layerScaleF γN n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.layerScaleF γN n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.layerScaleChF γN c h w e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.layerScaleChF γN c h w]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.softmaxRowF m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.softmaxRowF m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.softmaxRowBack x_1 m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.softmaxRowBack x_1 m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.softmaxRowBackShift x_1 m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.softmaxRowBackShift x_1 m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.matmulF m k n a b) = Proofs.StableHLO.toToks a ++ Proofs.StableHLO.toToks b ++ [Proofs.StableHLO.Tok.matmulF m k n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.transposeF m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.transposeF m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.scaleF s n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.scaleF s n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.lnRowF g b eps m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.lnRowF g b eps m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.lnRowBack g x_1 eps m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.lnRowBack g x_1 eps m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.denseRowF w b N a c e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.denseRowF w b N a c]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.denseRowBack w N a c e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.denseRowBack w N a c]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.patchEmbedF w b cls pos ic H W P N D e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.patchEmbedF w b cls pos ic H W P N D]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.clsSliceF N D e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.clsSliceF N D]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.clsPadF N D e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.clsPadF N D]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.headSliceF N heads d hIdx e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.headSliceF N heads d hIdx]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.headPadF N heads d hIdx e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.headPadF N heads d hIdx]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.rowScaleF g m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.rowScaleF g m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.rowBiasF b m n e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.rowBiasF b m n]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.batched tag names info e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.batched tag names info]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.batched2 tag names info a b) = Proofs.StableHLO.toToks a ++ Proofs.StableHLO.toToks b ++ [Proofs.StableHLO.Tok.batched2 tag names info]
- Proofs.StableHLO.toToks (Proofs.StableHLO.Raw.allReduceMean R t ds e) = Proofs.StableHLO.toToks e ++ [Proofs.StableHLO.Tok.allReduceMean R t ds]
Instances For
Stride-2 weight-gradient window geometry — odd AND even kernels. Returns
(up, ext, lo, hi) for one spatial axis: up is the trailing zero row of the
decimate-backward upsample, ext the resulting cotangent extent, and [lo, hi] the
correlation's padding.
The strided weight grad zero-upsamples the cotangent onto the stride-1 grid (the decimate
backward) and then correlates the saved input against it VALID-style, so the result is kH×kW.
For an odd kernel the upsample carries a trailing zero row (up = 1, extent 2s) and the
correlation pads symmetrically by p = (k−1)/2. That is the committed spelling for the 1×1, 3×3
and 7×7 kernels every other net uses, and it is reproduced here byte-identically.
For an even kernel p = (k−1)/2 floors to k/2 − 1, so a symmetric pad emits a result one
short of k: at k = 2, input 8×8 → output 4×4, it declares 2x3x2x2 against a
convolution yielding 1x1 — type-invalid MLIR. The even branch applies the same asymmetry
convStridedBack applies on the input-VJP: drop the trailing zero row (extent 2s−1) and pad
[p, k−2−p].
Output width is ext_padded − ext + 1 = (2s + lo + hi) − ext + 1:
k=1 → (1, 2s, 0, 0) ⇒ 1; k=3 → (1, 2s, 1, 1) ⇒ 3; k=7 → (1, 2s, 3, 3) ⇒ 7;
k=2 → (0, 2s−1, 0, 0) ⇒ 2; k=4 → (0, 2s−1, 1, 1) ⇒ 4.
Equations
Instances For
The full entry — [c,h,w] plus the row-view flag — recorded for SSA name nm.
Equations
- Proofs.StableHLO.lookupEntry tbl nm = List.lookup nm tbl
Instances For
The [c,h,w] nm carries as a map. A row view answers none: it holds the same elements
in a different order, so unflattening it to [B,c,h,w] would not be an inverse pair.
Equations
Instances For
The [c,h,w] an op's INPUT and OUTPUT activations carry, when it has them. Strided and
pooled tags carry their output spatial dims, so the input side is 2h × 2w.
Each batched tag and its per-example peer MUST answer IDENTICALLY. The two renders are tied
byte for byte (tests/TestBatchedEmitTie.lean, convnext-fwd-b-tie), so a shape one path
knows and the other does not is a liftPointwise that fires on one side only — a tie failure
with no wrong answer anywhere to point at. Add tags in pairs.
Instances For
Record nm as carrying the [c,h,w] MAP (not a row view).
Equations
Instances For
The [c,h,w] the running table has for the value bound to nm, as a map.
Equations
- Proofs.StableHLO.lookupShapeM nm = do let __x ← get match __x with | (fst, tbl) => pure (Proofs.StableHLO.lookupShape tbl nm)
Instances For
The ops that keep a value in its [h·w, c] ROW VIEW: ConvNeXt's channel-LN chain, which
normalises over the transposed layout and hands the result back to the closing transpose.
Equations
- Proofs.StableHLO.rowViewPass (Proofs.StableHLO.Tok.batched tag names info) = (tag == "lnRowP" || tag == "rowScaleP" || tag == "rowBiasP" || tag == "lnRowBackP")
- Proofs.StableHLO.rowViewPass (Proofs.StableHLO.Tok.lnRowF g b eps m n) = true
- Proofs.StableHLO.rowViewPass (Proofs.StableHLO.Tok.lnRowBack g x eps m n) = true
- Proofs.StableHLO.rowViewPass (Proofs.StableHLO.Tok.rowScaleF g m n) = true
- Proofs.StableHLO.rowViewPass (Proofs.StableHLO.Tok.rowBiasF b m n) = true
- Proofs.StableHLO.rowViewPass t = false
Instances For
The (m, n) of a transpose token, batched or per-example.
Equations
- Proofs.StableHLO.transposeMN (Proofs.StableHLO.Tok.batched "transposeP" names [head, m, n]) = some (m, n)
- Proofs.StableHLO.transposeMN (Proofs.StableHLO.Tok.transposeF m n) = some (m, n)
- Proofs.StableHLO.transposeMN t = none
Instances For
Record what one token's operand and result carry, given the operand-name stack before and
after it was emitted. Called from serializeToks, so no emitTok arm has to know about the
table — which is what keeps the 94 arms free of it.
Three cases, and the first two exist only for the channel-LN round trip: a transpose FLIPS
the layout flag when its (m,n) match the operand's [c,h,w] (and records nothing when they
do not, e.g. ViT's attention transposes, which are not maps at all), and the row ops carry it
through unchanged. Everything else reads its shapes off the tag.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Render a pointwise block at its 4-D shape when the OPERAND's producer recorded one.
k receives the (possibly unflattened) input name and the dims to type its ops with, and
returns (text, result name).
The c*h*w == n guard is what keeps a mismatched entry from emitting an ill-typed reshape
rather than merely a suboptimal one. It cannot fire today — an entry is written by the token
that produced the name — and it is the difference between a missed optimisation and a render
that does not parse, so it stays.
The block's own RESULT is recorded too, which is what lets a pointwise CHAIN stay 4-D: the value crossing the token boundary keeps its flat type, so without this the second op in a swish→multiply→add chain would find nothing for its operand and drop back to flat.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Two-tensor-operand peer of liftPointwise; both operands carry the same flat width.
The shape comes from whichever operand has one — the cotangent first, since it is the stack
operand and was produced nearby, then the saved activation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The exact GELU forward's ops on r at type d, in the op order of
jax.nn.gelu(approximate=False): y = (0.5·x) · erfc((−x)·√½), which is x · Φ(x)
(geluErfScalar_eq_erfc). chlo.erfc is the only non-arithmetic op; XLA and IREE both
legalise it. The 1 + erf spelling is the same real function and a worse float one: it
cancels to zero below x ≈ −5.2.
One body for the .geluF .erf token and the batched "geluErf" descriptor, so the two
renders cannot differ.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The exact GELU input-VJP's ops, cotangent r and saved pre-activation x at type d,
in the op order of jax.vjp of the forward. With z = (−x)·√½,
−((−2/√π) · ((0.5·x)·dy) · exp(−z²) · √½) + 0.5·(dy·erfc(z)),
which is dy · (Φ(x) + x·φ(x)) (geluErfScalarDeriv_eq_erfc); erfc and the Gaussian are
recomputed from x.
One body for the .geluBack .erf token and the batched "geluErfBackP" tag.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The tanh-GELU forward's ops on r at type d:
y = 0.5·x·(1 + tanh(√(2/π)·(x + 0.044715·x³))). Smooth everywhere (no kink, no mask);
stablehlo.tanh is the only non-arithmetic op.
One body for the .geluF .tanh token and the batched "gelu" descriptor, so the two renders
cannot differ — geluErfFwdText's reason.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The tanh-GELU input-VJP's ops, cotangent r and saved pre-activation x at type d:
dy ⊙ gelu'(x), recomputing t = tanh(√(2/π)·(x + 0.044715·x³)) from x, with
gelu'(x) = 0.5·(1+t) + 0.5·x·(1−t²)·√(2/π)·(1 + 3·0.044715·x²). (Matches IRPrint
renderGeluB.)
One body for the .geluBack .tanh token and the batched "geluBackP" tag.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The row-wise LayerNorm forward's text on the flat r : [B, m*n]; returns the text and
the output's name. Reshape to [B,m,n], then bnF's normalize/affine graph at rank 3 — μ/var
reduced over the LAST axis [2] (per token row), broadcast back over dims [0,1], scalar γ/β
(dims = []) — and reshape to flat. LayerNorm IS per-example BN per row; m is rows PER
EXAMPLE.
One body for the .lnRowF token and the batched "lnRowP" descriptor, so the two renders
cannot differ.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The row-wise LayerNorm input-VJP's text, cotangent r and saved flat pre-LN input xN;
returns the text and the output's name. It recomputes x̂/istd per row from xN, then
bnBack's consolidated three-term (istd/n)·(n·dx̂ − Σdx̂ − x̂·Σ(x̂·dx̂)) (dx̂ = γ·dy) at
rank 3, every Σ over the row axis [2], and reshapes to flat.
One body for the .lnRowBack token and the batched "lnRowBackP" tag.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The text of the cross-replica mean — ViTRender.emitGradAllReduce's body, verbatim, so
that the allReduceMean token re-renders every committed *dp* artifact byte-identically.
all_reduce(add) over replica_groups = [[0..R-1]], then a divide by R; the names are
%arsum{t} … %armean{t} from the tag rather than fresh. At R ≤ 1 there is no text and
the operand's name is the result, exactly as the text function did.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The compute precision a contraction tag asks for: …Bf16 bf16, …F8 fp8 (E4M3), otherwise f32
(none) — as the type printer of the low-precision operands.
Equations
Instances For
One contraction at a compute precision — the stablehlo.convolution / dot_general line of
an emit arm, op lhs rhs being its text between = and the type signature. lp = none is the
f32 op. lp = some t converts both operands to t and types the op in t; with lowResult
the result is t too and is converted back to f32 — the bf16 / fp8 shape (an f32-typed conv
result compiles to pure f32, flatConvFBf16) — and without it the result stays f32, the dot
shape whose f32 result IS the accumulator (dotInBf16). Names are drawn in that order (the two
converts, the op, the convert back), so an arm draws the same %v numbers at every precision.
Returns the text and the f32 result's name.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The flat-carrier SAME conv + bias (flatConvF / flatConvFBf16): reshape the [B, ic·h·w]
carrier to NCHW, convolve at lp's precision (emitContract), add the broadcast bias, flatten.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The flattened batched matrix multiply C = A·B (matmulF / "matmulFBf16"): reshape both
operands to rank 3, dot_general with batching dim 0 (A's last axis against B's middle) at
lp's precision, reshape back to flat.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The squeeze-excite activations inside one seBlock emission, by name: the squeeze (GAP,
[B,c]), the reduce dense + bias ([B,r]), its swish, and the excite dense + bias ([B,c]) —
the four values the SE backward reads. k0 is the fresh-name counter when the seBlock token
is emitted. The offsets are the order the "seBlock" arm of emitTok below calls fresh in
(sq 5th, ex 8th, a1 10th, h2 13th); the #guard after emitTok checks each name is
defined by the op it claims. A renderer that saves these reuses the SE the forward already
computes instead of emitting a second, un-fused copy.
Equations
Instances For
Render one token: pop its operands' result-names off the stack, emit its
StableHLO line(s), push its fresh result name. The text each arm prints (operand order
and arity, types, syntax) is trusted, checked by parsing and running the committed
artifacts; the token stream it consumes is toToks (skel g), whose encoding round-trips
(StableHLOParse.roundtrip).
Instances For
Why t's emitted pad would not compute its den, or none. Two families are faithful only
on a kernel-size domain their constructors do not enforce:
- the stride-2 XLA-
SAMEops (flatConvStride2Xlaand its depthwise, backward and weight-gradient peers) emit pad[p−1, p]withp = (k−1)/2, which reads theden's odd-offset taps only at oddk ≥ 3; - the stride-4 patchify ops (
flatConvStride4and its peers) emit pad(k−1)/2 − 1, which reads theden's offset-1 taps only atk ≥ 3.
Below those bounds Nat subtraction floors the pad at 0, and the text is a well-typed
convolution at the wrong offset: it parses, runs, and computes a different function. Even k
on the symmetric arms changes the output shape instead, so it fails loudly and is not
listed.
Equations
- One or more equations did not get rendered due to their size.
- Proofs.StableHLO.kernelOutsideDomain t = none
Instances For
Fold a token stream to accumulated (code, result-name-stack).
Equations
- One or more equations did not get rendered due to their size.
- Proofs.StableHLO.serializeToks B [] x✝ = pure x✝
Instances For
The bias's slot in a return-name list, gated the way biasName gates the operand: with
convBias := false no bias SGD op is emitted, so the slot must LEAVE the list rather than carry
the empty string the if convBias then … else pure ("", "") idiom hands back.
This exists because leaving it in is silent twice over. An empty name renders
return %a, , %b — malformed text, but only the lowerer ever sees it; and the name list keeps
its FULL length, so an arity #guard on the signature still passes. Use this at every site
where a names := [...] list is built from gated ops.
Instances For
The zero-bias constants the convBias := false render consumes, one per channel width used as
a conv bias. Emitted once at the top of the body; XLA folds the resulting add.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Fixed-6-decimal float literal, so a computed smoothing constant emits in the SAME textual form
the hand-written literals used and nClasses = 10 re-renders byte-identical.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Fixed-12-decimal float literal, for constants fmt6 would destroy.
It exists because fmt6 is not a formatting preference, it is a PRECISION CEILING, and small
derived constants fall straight through it. Gradient accumulation's second-moment coefficient is
(1−β₂)/K²; at K = 4 that is 6.25e-5, which fmt6 emits as 0.000063 — 0.8% wrong, in a
baked literal, in the optimizer, where nothing downstream would question it. Same class as a
hardcoded 0.010000 label-smoothing mass (see alphaOverK). fmt6 stays the default so every committed artifact
re-renders byte-identically; this is for constants that need the room.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The label-smoothing mass per class, α/K. α = 0.1 throughout; K is nClasses.
Derived from nClasses, not written as a literal: a hardcoded 0.010000 is correct at K = 10
and wrong at every other K, and it sits in the COTANGENT, not just in the report-only %loss.
At nClasses = 1000 it would make the smoothing term 100× too large — a different objective,
silently. Nothing in the repo's proofs covers it: α is a literal in emitted text, so it
needs its own numeric check.
Equations
- Proofs.StableHLO.alphaOverK nClasses alpha = Proofs.StableHLO.fmt6 (alpha / nClasses.toFloat)
Instances For
1 − α, the ON-class weight of label-smoothed CE. Emitted beside alphaOverK, because the two
always move together and splitting them is how one of them gets updated alone.
Equations
- Proofs.StableHLO.oneMinusAlpha alpha = Proofs.StableHLO.fmt6 (1.0 - alpha)
Instances For
1 − ρ, the RMSProp mean-square mixing weight. Derived from ρ, never written as a second
literal beside it — the oneMinusAlpha precedent, and the K-constant lesson: any
emitted constant that depends on a hyperparameter must be DERIVED, because the copy is what
gets left behind when the original moves.
Equations
- Proofs.StableHLO.oneMinusRho rho = Proofs.StableHLO.fmt6 (1.0 - rho)
Instances For
The RMSProp hyperparameters, as the JAX reference configs state them. ρ/μ are 0.9 on both
nets that use this optimizer; ε and wd are what differ, and ε differs in the way that
matters most (see Proofs.rmsBufNext_eps_placement_at_zero).
- rho : Float
rmspropDecay— the running mean-square decay. - mu : Float
momentum— μ for the buffer on the normalised gradient. - eps : Float
rmspropEps— emitted INSIDE the square root (TensorFlow), not added to the root. - wd : Float
COUPLED L2 (folded into the gradient), not AdamW's decoupled decay.
Instances For
ρ / (1−ρ) / μ / ε / wd as graph constants — the RMSProp peer of each renderer's adamConsts
block. %lr stays a runtime tensor<f32> arg so one graph serves a whole LR schedule.
Equations
- One or more equations did not get rendered due to their size.
Instances For
MobileNetV2's RMSProp knobs (jax/MainMobilenetV2Imagenet.lean): ε = 1.0.
Equations
- Proofs.StableHLO.mnv2RmsHyper = { eps := 1.0, wd := 40e-6 }
Instances For
EfficientNet-B0's RMSProp knobs (jax/MainEfficientNetImagenet.lean): ε = 1e-3.
Equations
- Proofs.StableHLO.enetRmsHyper = { eps := 10e-4, wd := 10e-6 }
Instances For
pretty — render an SHlo graph to StableHLO as serializeToks ∘ toToks ∘ skel:
tokenize the graph (postorder), then print the tokens. The tokens it prints are exactly
toToks (skel g), whose encoding StableHLOParse.roundtrip shows is invertible; how each
token becomes text (emitTok) is trusted. A stack that does not end with one name returns
"%MALFORMED" as the result name.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The rounding a render hands the bf16/fp8 ops: the identity. A placeholder, exactly as a
renderer's zero kernels are: a render produces TEXT, skel erases every ℝ payload before a
token is emitted, and the emitted text is decided by the tag. The rounding-bearing den lives
in the tie theorems, where rnd is arbitrary and the accuracy statement
(Proofs/Float/*MixedFloatBridge.lean)
instantiates it at bf16 round-to-nearest with |rnd x − x| ≤ 2⁻⁸|x|. A render that baked a
concrete rounding here would be claiming the emitter knows about it, which it does not.
Equations
Instances For
The cross-replica gradient mean as pretty of the allReduceMeanF node, used by every
batched data-parallel render. At replicas ≤ 1 it emits nothing and threads the gradient's
name. The R operand graphs are
all .operand grad at a zero placeholder, because a render is value-independent — skel
erases values — while the family is what den sums over in the tie.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One parameter's AdamW update, as pretty of the proven triple — adamMNextF, adamVNextF
and the decoupled-decay adamWParamF on the gradient grad, reading the graph constants
adamWConsts binds, the step's %bc1/%bc2/%lr, and the decay operand wdName ("%wdz" for
a timm no-decay parameter). Returns (code, θ', m', v'); every batched renderer's AdamW tail is
this. wdName and den's wd must move together: both are 0 here only because every ℝ slot
is a placeholder the emit ignores; if that changes, a no-decay site must pass wd := 0 as well
as %wdz, or the artifact and the denotation describe different optimizers.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The AdamW graph constants — β₁ = 0.9, β₂ = 0.999, ε = 1e-8 and the baked decay wdStr
(1e-4 is the Imagenette recipe every batched net shares; the ImageNet configs pass their own).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The linear train step rendered ENTIRELY from the verified AST. Unlike
linearTrainStepModuleV (forward via pretty, tail hand-written), here the
whole module is pretty of denoted nodes: the cotangent (lossCotGraph,
rendered once → shared %dy), then the two fused SGD ops weightSgd/biasSgd
that consume %dy. So every emitted line is pretty(provenNode) and
LinearFold proves the two outputs' den = the certified loss-descent
SGD step. The lr ℝ / operand values are skel-erased (render is
value-independent), so placeholders here render identically to the live graph
the den theorems use.
Equations
- One or more equations did not get rendered due to their size.