Skip to content

Restore frozen Miles image names and name images by fork commit - #343

Merged
Fred Robinson (frrad) merged 7 commits into
mainfrom
fix/restore-frozen-miles-image-names
Nov 17, 2026
Merged

Fred Robinson (frrad) merged 7 commits into
mainfrom
fix/restore-frozen-miles-image-names

Conversation

@frrad

@frrad Fred Robinson (frrad) commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Users choose trainer images by name in their configs, for example trainer_image = "miles-v0.1.1-fdd808c". A name is the upstream Miles release plus the short commit of the Spindle Miles fork that the image installs. Named images are frozen: a change gets a new name, so a config keeps running exactly what it was tested on. Miles checkpoints depend on this too. A checkpoint restores only on a trainer with the same Miles revision as the one that saved it (_validate_checkpoint in miles_lora.py).

#324 (seeded LoRA initialization) changed the fork commit behind four existing names without renaming them:

Name Before #324 After #324
miles-v0.1.1-fdd808c (also the miles default) fdd808c ce494f0
miles-v0.1.2-f2f8447 f2f8447 fde5e9e
miles-v0.1.2-464efc9-glm53 464efc9 612703a
miles-v0.2.0-15afe21 15afe21 384d73b

So each suffix named the wrong commit, and checkpoints saved on these names before #324 no longer restored. The new commits also weren't on the fork branches. Three were open PRs; the DeepSeek-V4.1 one (fde5e9e) only existed on a branch with no PR.

This PR:

  • Points each old name back at its original commit, and adds a seed-enabled name for each, pinned to the commit merged on the fork branch. Final registry:

    Name Installs Source
    miles-v0.1.1-fdd808c fdd808c008175d4895fd8c57c95ef4fa5bb6a2a0 restored
    miles-v0.1.1-52a7a99 52a7a99d9f9e6188ece91a0583ef417093601025 miles#42 squash merge; same tree as ce494f0
    miles-v0.1.2-f2f8447 f2f8447c33ac0755a0988c30d413d334dea0a26a restored
    miles-v0.1.2-99e1ebe 99e1ebe8e86974e0b3c290f47f415ee47726f965 head of spindle-miles-v0.1.2 (see below)
    miles-v0.1.2-464efc9-glm53 464efc9781bbf8edf2135f0857f5aa417685eae2 restored
    miles-v0.1.2-99e1ebe-glm53 99e1ebe8e86974e0b3c290f47f415ee47726f965 miles#43 squash merge; same tree as 612703a
    miles-v0.2.0-15afe21 15afe217019b2762290da27a31a92454051a0d34 restored
    miles-v0.2.0-8c5de26 8c5de2650a6876c2ca17ff221c7e0ba8a2d7b84a miles#44 squash merge, on top of Beam LoRA support (miles#37, 3280b7a)

    DeepSeek-V4.1 (miles-v0.1.2-99e1ebe). fde5e9e was never merged. Experiment (not for merge): drop the checkpoint-volume commit after sampler weight export #43 merged the same seed patch onto spindle-miles-v0.1.2: git diff 464efc9 99e1ebe is byte-identical to git diff f2f8447 fde5e9e. Between f2f8447 and 99e1ebe, the branch also carries the GLM-5.3 work from miles#31. That work is inert in the plain v0.1.2 build. Its Bridge provider registers only when /opt/miles-glm53-models exists, which only the -glm53 build steps create. Its HF config alias change turns an error into a skip. The build check for miles_plugins/models/deepseek_v4_1/lora.py still holds at 99e1ebe.

  • Keeps seed support for defaults and bundled configs.

    • The miles default is now miles-v0.1.1-52a7a99.
    • The 42 bundled configs that were on miles-v0.1.1-fdd808c move to miles-v0.1.1-52a7a99.
    • The 7 DeepSeek-V4.1 configs move to miles-v0.1.2-99e1ebe, and the 4 GLM-5.3 Flash configs to miles-v0.1.2-99e1ebe-glm53.
    • No bundled config uses miles-v0.2.0-*. The reference run reference_runs/results/dapo-math-qwen35-4b-miles-v020 stays on miles-v0.2.0-15afe21: it was recorded before Support seeded LoRA initialization through Miles #324, so the restored name matches what it ran.
  • Names image variables after their fork commit, and modules after their Miles release. miles_image.py is now miles_v011_image.py, matching miles_v012_image.py and miles_v020_image.py. glm53_trainer_image.py built from the same v0.1.2 release image and fork branch as miles_v012_image.py, so its images moved there as a second series (glm53_image_01_464efc9, glm53_image_02_99e1ebe) with unchanged build commands. Each Miles module has an image_at(commit) builder and one variable per commit, numbered in ancestry order: image_01_fdd808c, image_02_52a7a99 and so on. The SGLang modules follow the same pattern (rollout_image.image_01_c4182b2, image_02_803bccb; deepseek_v41_image.image_01_a3e0e17; glm53_image.image_01_c4182b2). Each module has a one-line comment saying entries are only ever appended, and each shared builder says editing it rebuilds every image built from it. Registry strings are unchanged apart from the four new names. The restored names use the same build commands as before Support seeded LoRA initialization through Miles #324, so Modal should reuse their cached layers.

  • Adds regression tests in tests/providers/test_deployment_apps.py:

    • Each image_NN_<short> variable must build a commit starting with <short>, and the numbers in each series (image_, glm53_image_, ...) must run 01, 02, ... in order.
    • Each registered SGLang and Miles name must point at the variable whose short commit appears in the name, and only -glm53 names may point at GLM-5.3 images. Swapping miles-v0.1.2-99e1ebe with its -glm53 twin, or the two c4182b2 sampler images, fails it.
    • Each pinned fork commit must be on the branch its module names (MILES_BRANCH or SGLANG_BRANCH). The test fetches each branch's commits from GitHub with git fetch --filter=tree:0, about a second per branch, and checks ancestry. It runs on every PR. The GLM-5.3 trainer and DeepSeek-V4.1 sampler modules now name their branch in a constant too; their build commands are unchanged.

    I checked the first two by mutation. Repinning image_01_fdd808c to another commit fails the first test, and pointing miles-v0.1.2-f2f8447 at the seed image fails the second. The third failed for all four unmerged seed commits before this PR switched to the merged ones.

  • Links each registered image to its fork PR with a comment above each TRAINER_IMAGES and SAMPLER_IMAGES entry.

  • Removes scripts/check_multi_targets_gpu.py and its only worker, tests/gpu/multi_targets_worker.py.

  • Updates the Miles commit lookup in CI's upstream type-check step. It now reads the newest image_at(...) commit in miles_v011_image.py (52a7a99, which has the same tree as main's ce494f0), because MILES_COMMIT no longer exists. Updates docs/deployment-configs.md#images and the CHANGELOG.

Checkpoints and upgrades

A checkpoint restores only on the Miles revision that saved it.

The seed error now says to switch trainer_image to a seed-enabled image rather than "update Miles", since named images are frozen.

Testing

On commit be9c523:

  • uv sync --locked --python 3.12 and uv run pre-commit run --all-files pass.
  • With CI's setup (CPU torch 2.10, the image-pinned Tinker SDK, ./rust/router), uv run --no-sync pytest -q -n auto passes: 1477 passed and 9 skipped, including slow tests and the network branch test.

No images were built and nothing ran on GPUs. In particular, DeepSeek-V4.1 hasn't been trained on 99e1ebe. The seed patch is identical to what #324 shipped, and the extra GLM-5.3 changes are gated off in the plain build, but a DeepSeek LoRA run on miles-v0.1.2-99e1ebe would confirm it.

🤖 Generated with Claude Code

#324 moved the fork commit behind miles-v0.1.1-fdd808c, miles-v0.1.2-f2f8447,
miles-v0.1.2-464efc9-glm53 and miles-v0.2.0-15afe21 to add seeded LoRA
initialization. Named images are frozen, and Miles checkpoints restore only
on the revision that saved them, so this broke both the name and checkpoint
restore for anyone pinned to one of those names.

Point each old name back at its original commit and register the seed
commits under new names (miles-v0.1.1-ce494f0, miles-v0.1.2-fde5e9e,
miles-v0.1.2-612703a-glm53, miles-v0.2.0-384d73b). The Miles default and
every bundled Miles config move to the new names, so they keep seed support.

Image modules now define one variable per fork commit, numbered in ancestry
order (image_01_fdd808c, image_02_ce494f0, ...), built by an image_at helper.
Tests check that each variable builds the commit it is named after and that
each registered name points at the variable for its commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each Miles and SGLang image module names the fork branch it builds from.
Fetch each branch (commits only) and check that every pinned commit is an
ancestor of its head, so an image cannot pin a commit that exists only on an
unmerged branch and could disappear when that branch is deleted.

The GLM-5.3 trainer and DeepSeek-V4.1 sampler modules now name their branch
in a constant too. Their build commands are unchanged.

This test fails until the seed commits ce494f0, fde5e9e, 612703a and 384d73b
are merged onto their spindle-miles* branches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fork PRs for seeded LoRA initialization were squash-merged, so the
commits Spindle pinned are not on the spindle-miles* branches. Pin the
merged commits instead:

- miles-v0.1.1-52a7a99 (modal-projects/miles#42; same tree as ce494f0)
- miles-v0.1.2-99e1ebe-glm53 (modal-projects/miles#43; same tree as 612703a)
- miles-v0.2.0-8c5de26 (modal-projects/miles#44, after Beam LoRA support #37)

The DeepSeek-V4.1 seed commit fde5e9e was never merged. Its seed patch is
identical to the one #43 merged onto spindle-miles-v0.1.2, so the plain
v0.1.2 image uses that branch head, 99e1ebe, as miles-v0.1.2-99e1ebe. The
GLM-5.3 changes between f2f8447 and 99e1ebe only take effect in the glm53
build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mages into the v0.1.2 module

miles_image.py builds Miles v0.1.1; name it like miles_v012_image.py and
miles_v020_image.py.

glm53_trainer_image.py built from the same v0.1.2 release image, fork
repository and branch as miles_v012_image.py, so its images now live there as
a second series (glm53_image_01_464efc9, glm53_image_02_99e1ebe). Build
commands are unchanged. The sequence test now numbers each series separately.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- CHANGELOG: bundled configs and the default now install newer Miles
  commits than v0.1.7 did, so say which image name restores a checkpoint
  saved with v0.1.7 or earlier.
- The seed error now says to switch trainer_image to a seed-enabled image
  rather than to update Miles, since named images are frozen.
- The name-matching test now also checks the -glm53 suffix, so swapping an
  image with its GLM-5.3 twin on the same commit fails.
- Each shared image builder says that editing it rebuilds every image built
  from it.
- Wording fixes in the docs, and the append-only comment in glm53_image.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t GPU script

Each TRAINER_IMAGES and SAMPLER_IMAGES entry now notes the modal-projects
fork PR that last changed its commit, so readers can see what each name adds.

Remove scripts/check_multi_targets_gpu.py and its only worker,
tests/gpu/multi_targets_worker.py, along with their ruff ignores and mentions
in the spindle-dev skill.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…les-image-names

# Conflicts:
#	tests/gpu/multi_targets_worker.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall lgtm, there is one thing related to checkpoint compability:

Checkpoints created on main after #324 require a custom image pinned to their original Miles commit. The new squash-merged commits have different hashes, so even identical code won’t pass checkpoint revision validation. This is explicitly documented.

but i dont think this is a pressing issue (no one has checkpoints from prior versions that they're tied to i think)

@frrad
Fred Robinson (frrad) merged commit 1866cf8 into main Nov 17, 2026
4 checks passed
@frrad
Fred Robinson (frrad) deleted the fix/restore-frozen-miles-image-names branch November 17, 2026 23:44
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.

2 participants