Skip to content

pgw#997: a REAL micro endpoint family — 3 export entries, a 15-second full mint cycle - #522

Merged
PaulFidika merged 2 commits into
masterfrom
997-micro-endpoint
Aug 7, 2026
Merged

pgw#997: a REAL micro endpoint family — 3 export entries, a 15-second full mint cycle#522
PaulFidika merged 2 commits into
masterfrom
997-micro-endpoint

Conversation

@PaulFidika

Copy link
Copy Markdown
Contributor

Closes the "sdxl is the test vehicle" problem: 6.9 GB, 36 export entries, ~95 min/pod cycle. This adds a real org worker with 3 entries whose full local machinery cycle is 15 seconds.

What's here

examples/micro-diffusion/ — a real org worker, not a fixture. Own pyproject.toml, endpoint.toml, Dockerfile-first build contract (gen_worker.discovery at build, gen_worker.entrypoint as ENTRYPOINT), catalog Slot(..., selected_by="model") with no default_checkpoint (pgw#969's shape), a registered export declaration, a @family defaults vocabulary, two served arms.

denoiser/cfg=true     guided arm; container arity 2
denoiser/cfg=false    turbo arm; container arity 1
decoder               a SECOND target, its own dims, no fork

Smallest set that still exercises plan selection, a fork coordinate, a derived dynamic range, a second target, entry naming, the seal, the publish wire and the cross-process adopt filter.

Two declared facts keep pgw#993/pgw#994 under test on every cycle:

  • a repeat= CONTAINER input with a plain input immediately after itt's argument position is 1, its FLATTENED position is 2. Asserted structurally in CI.
  • one Dim carried by both a container element axis (("x", 0)) and a plain tensor axis (("latent", 1)).

Weights are generated, never fetched. (seed, config) -> bytes; nothing in git, nothing on a developer's box. The Dockerfile runs --verify (regenerate + byte-compare), so an image whose weights did not reproduce fails the build. 1.1 MB.

The rig is vehicle-selectable. --vehicle {tiny,micro} / task rig:micro; endpoint coupling moved to tests/harness/rig_vehicles.py. task rig:mint unchanged.

Measured (this box, CPU, synthetic sm per pgw#983)

leg s
gates 0.9
weights (generated) 0.1
handoff (3 declared entries) 0.03
mint-child (real spawn, export + AOTI, seal) 9.4-10.6
publish (real CellPublisher, 4 HTTP calls) 0.2
adopt + parity (SECOND process) 2.7-4.3
full cycle 14.8-15.4

Adopt is a real parity check, not a filter check: served_entry_calls {decoder: 1, denoiser/cfg=false: 1, denoiser/cfg=true: 1}, execution_count 3, ingress_refusals 0, max |delta| vs eager 7.15e-07. That call is exactly where pgw#994 lives.

task rig:mint (the pgw#978 vehicle) still green: 18.6 s.

Found by the first cycle: pgw#998

unexpected None!, 512*s18*s57 — bisected to the mint's own torch.export.save/load hand-off to its compile child, which makes a nonlinear symbolic extent unlowerable. Not strictness, not the code-only config, not the wrapper split: the round trip alone. A squared symbol fails identically, so the trigger is nonlinearity, not symbol count. z-image's declaration has the same two-dynamic-axis shape and is worth checking before its next buy. Filed as pgw#998; this declaration sidesteps it with token sequences (flux/qwen's real interface) and a CI row keeps the invariant RED-able.

Not run

The pod runbook lives in examples/micro-diffusion/README.md, end to end, with derived ESTIMATEs (~5-8 min/cycle vs sdxl's ~95). No pod has been bought and none may be without Paul's go.

Coordination

Touches scripts/micro_mint_rig.py, which pgw#995's env-delivery lane also edits — hunks are disjoint (vehicle seam + adopt call here; docstring, run_cycle signature and child-env block there); whichever lands second rebases. pgw#996 touches aot_mint.py/export_contract.py/discover.py — no overlap.

… full mint cycle

AOT-mint iteration has been proven against sdxl: 6.9 GB of weights, 36 export
entries, ~95 minutes per pod cycle. Nothing about the mint MACHINERY needs any
of that. pgw#978's rig inverted the publish-build-buy loop but its vehicle is a
one-entry toy in the SDK's test tree — no fork, no second target, no container
input, nothing a build could consume.

`examples/micro-diffusion` is a real org worker: its own pyproject/endpoint.toml,
Dockerfile-first build contract, catalog Slot with no default_checkpoint
(pgw#969's shape), a registered export declaration, a @family vocabulary, and
two served arms that map onto the two declared fork coordinates. It declares
THREE entries — denoiser/cfg=true, denoiser/cfg=false, decoder — which is the
smallest set that still exercises plan selection, a fork coordinate, a derived
dynamic range, a second target, entry naming, the seal, the publish wire and the
cross-process adopt filter.

Two declared facts keep a known defect class under test on EVERY cycle: a
`repeat=` container input with a PLAIN input immediately after it (t's argument
position is 1, its flattened position is 2 — pgw#994's divergence), and one Dim
carried by both a container element axis and a plain tensor axis (pgw#993's).

Weights are GENERATED from a seed, never fetched: nothing in git, nothing on a
developer's box, and the Dockerfile materializes the tree with --verify so an
image whose weights did not reproduce fails the build. 1.1 MB.

Measured on this box, CPU, synthetic sm per pgw#983: full machinery cycle
14.8-15.4 s (mint child 9.4-10.6, publish 0.2, adopt+parity 2.7-4.3). The adopt
leg arms the cell in a SECOND process and calls every arm — served_entry_calls
1/1/1, ingress_refusals 0, max |delta| vs eager 7.15e-07 — so a serve-side
flattening regression turns the cycle red in seconds.

The rig is now vehicle-selectable (--vehicle {tiny,micro}, `task rig:micro`);
its endpoint coupling moved to tests/harness/rig_vehicles.py and `task rig:mint`
is unchanged. The adopt child now installs the same runtime probes the mint
child got and configures logging, so a filter miss reports the axis it was
rejected on instead of an empty log.

The first micro cycle immediately produced pgw#998: the mint's own
torch.export.save/load hand-off to its compile child makes a NONLINEAR symbolic
extent unlowerable (`unexpected None!`, 512*s18*s57). Bisected to the
serialization round trip alone; the declaration sidesteps it with token
sequences, which is also flux/qwen's real interface. z-image's declaration has
the same two-dynamic-axis shape and is worth checking before its next buy.

The pod runbook is written in the package README and is DELIBERATELY NOT RUN.
… exactly what the 0.93.3 serve path binds wrong

The declaration is deliberately the pgw#994 shape, so a pod run on 0.93.3 would
mint, seal, and then refuse at ingress on the first served call. Recorded at
the pin and at runbook step 1 rather than left for a burned pod to find.
@PaulFidika
PaulFidika merged commit e5a4563 into master Aug 7, 2026
2 checks passed
@PaulFidika
PaulFidika deleted the 997-micro-endpoint branch August 7, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant