Skip to content

Exports on Modal: each XNNPACK and Vulkan window, and the solve, in a Sandbox sized to it - #15

Merged
alpharomercoma merged 2 commits into
mainfrom
modal-exports
Oct 7, 2026
Merged

alpharomercoma merged 2 commits into
mainfrom
modal-exports

Conversation

@alpharomercoma

@alpharomercoma alpharomercoma commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

XNNPACK and Vulkan exports, and the GPTQ solve, now run on Modal. Each runs in a Sandbox with the memory its window needs (pipeline/remote.py, python -m pipeline modal-run), up to Modal's 344064 MiB and 64 cores. The GitHub jobs stay on the Namespace profile and only start the Sandbox, wait, download and publish.

What changes

  • XNNPACK: each window's export, smoke test and decision gate run in one Sandbox, so the separate verify job is gone.
  • Targets jobs: they now get their own Python (setup-light). The Namespace runner's system Python refuses pip install (PEP 668), so since the runner switch every export workflow on main has stopped at its first job.
  • Not moved: MediaTek and QNN still run on the Namespace profile.

Verified

  • From this workstation:
    • SmolLM2-135M Vulkan 2k came out byte-identical to the published file.
    • XNNPACK 2k exported and passed the smoke test in a single Sandbox.
    • Exit code 4 propagates, and the Volume is left empty afterwards.
  • From GitHub Actions: run 37625149449 on this branch (Vulkan 2k, publishing off) went targets → Modal → back to the job, producing the same file.
  • Codex: three reviews; four bugs found and fixed.
  • Tests: 245 pass.

Open: per-export time was slower than on Blacksmith (finding 41).

🤖 Generated with Claude Code

alpharomercoma and others added 2 commits October 7, 2026 20:16
… Sandbox sized to it

The Namespace profile has 15.7 GiB and no swap, which left out every 32k window and most of
the models from 1.5B up (finding 40). The GitHub jobs stay on it and send the heavy step to
Modal instead (pipeline/remote.py, `python -m pipeline modal-run`): a Sandbox with the memory
the window needs, sizing.host_need_bytes times modal.memory_margin, up to the 344064 MiB and 64
cores Modal allows (measured: larger requests are refused), so every window ever built fits
again, Qwen3-4B at 32k included.

- remote.py builds the image from the pinned requirements (torch from the CPU index, as
  setup-export does) and the repo's pipeline, uploads inputs to a v2 Volume under a key unique
  to the run, runs the step with an EXIT trap that commits the Volume with sync on every way
  out and keeps the step's status (exit 4 included), downloads the outputs, and always stops a
  live Sandbox and deletes the key. HF_TOKEN goes in as a Secret built from the job's own
  environment, so nothing is stored on Modal.
- export-matrix gives each window its memory_mib; solve-memory sizes the solve at 12 bytes a
  parameter, as the Blacksmith solves measured.
- export-xnnpack.yml: the solve, then one Sandbox per window that exports, smoke-tests through
  ExecuTorch's C++ runner and gates on the fp32 model's answers before the job publishes. The
  separate verify job existed for the ARM/x86 split and is gone. export-vulkan.yml sends its
  export the same way. Both jobs install only the light requirements (setup-modal).
- MediaTek and QNN still run on the Namespace profile.
- Tested from this workstation on Modal: SmolLM2-135M's Vulkan 2k file came out byte-identical
  to the published one, and its XNNPACK 2k file exported and passed the smoke test in the same
  Sandbox; exports were slower than on Blacksmith (finding 41).

Codex reviewed it three times; it found the cleanup skipped on a Sandbox timeout, the sync
skipped on an explicit exit, the inputs uploaded twice, and the wrong exception caught for a
missing Volume path, all fixed and tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Python refuses pip installs

Every export workflow's targets job ran `python3 -m pip install` on the runner's Python, which
Blacksmith allowed and Namespace does not (PEP 668: externally-managed-environment), so since the
runner switch no XNNPACK, Vulkan, MediaTek or QNN workflow could get past its first job. The
first workflow run through Modal found it. setup-light gives those jobs Python from versions.env
and requirements/dev.txt, which carries the pyyaml and huggingface_hub they used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alpharomercoma
alpharomercoma marked this pull request as ready for review October 7, 2026 13:13
@alpharomercoma
alpharomercoma merged commit 34af8fb into main Oct 7, 2026
3 checks passed
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