Skip to content

Add disagg_smoke: minimal-Qwen Modal test for pool claim/reset + cookbook consolidation - #8

Closed
jvmncs wants to merge 3 commits into
devin/1782798589-cookbook-consolidationfrom
devin/1782803070-disagg-smoke-test
Closed

Add disagg_smoke: minimal-Qwen Modal test for pool claim/reset + cookbook consolidation#8
jvmncs wants to merge 3 commits into
devin/1782798589-cookbook-consolidationfrom
devin/1782803070-disagg-smoke-test

Conversation

@jvmncs

@jvmncs jvmncs commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

A small Modal app (cookbook/disagg_smoke/) that validates the pool-control work end to end on a minimal Qwen (Qwen/Qwen2.5-0.5B-Instruct) — no Kimi/large config, no Megatron trainer. It exercises both PR #5 (explicit pool claim/reset, fresh-run-id ownership, monotonic pointer, 1:1 trainer↔pool) and PR #6 (the consolidated cookbook.sidecar/serving/trainer_helpers/rollout_control spine + thin adapters + whole-cookbook image mount). Stacked on PR #6's branch.

Instead of training, it synthesizes real slime disk-delta versions (xor + zstd + xxh3-128) from the base checkpoint and publishes them through the real bulletin board, so the actual host-side delta-apply + reconcile path runs.

delta.py — synthetic delta encoder

Writes byte-for-byte valid weight_v{N:06d}/ dirs that slime's real apply_deltas accepts. DeltaPublisher tracks cumulative new bytes per tensor, so expected_tensor(name) is exactly what the decoder must produce in the local checkpoint:

delta_file[name] = zstd(old ^ new)            # safetensors-format payload
header["__metadata__"][name] = xxh3_128(new)  # what the decoder re-checksums post-apply
index.json.metadata = {version, base_version, xor, zstd, xxh3-128}

Perturbs only the low (mantissa) byte of a few elements, so bf16 weights stay finite and the perturbed model still generates.

app.py::control_plane_test (GPU-free, primary)

Drives the real WeightSyncManager/build_manager against a fake SGLang upstream (an in-process http.server answering flush_cache/pause/continue/update_weights_from_disk). Asserts everything itself; raises on failure:

  • claim(run_a) → empty pointer <run_a>/weight_v000000, reset=True; startup converges to base.
  • publish v1+v2 → reconcile → local checkpoint bytes == pub.expected_tensor(...) (real slime decoder), engine reloaded at weight_version="2".
  • advance(run_a, 1) and re-claim(run_a) both raise PointerRewind (fresh-run-id enforcement).
  • fresh run_b re-claims → engine resets to base → replays its own chain (1:1 epoch).
  • imports every consolidated module + thin adapter off the mount — with include_source=False, the PR Consolidate cookbook trainers onto a shared sidecar/serving/launch spine #6 whole-cookbook mount regression would ImportError here.

app.py::serving_smoke (1× GPU)

Runs the real consolidated sidecar (python3 -m cookbook.slime_disagg.sidecar) in front of a real SGLang server on tiny Qwen, claims the run, publishes one delta, triggers a reconcile, and asserts the engine reloaded to v1 (real update_weights_from_disk) and serves a completion pinned to min_required_version: 1. Uses a vanilla single-GPU SGLang image (not the Blackwell fa4 fork build, which targets B200s) so it runs on a common 1×GPU; the whole-cookbook mount + --no-deps decoder layers are identical.

Run

modal run cookbook/disagg_smoke/app.py::control_plane_test   # GPU-free
modal run cookbook/disagg_smoke/app.py::serving_smoke        # 1× GPU

Pin SLIME_SMOKE_REPO/SLIME_SMOKE_REF to the same slime ref the trainer encodes with (encoder == decoder).

Validation

Static only (per request — I don't have Modal creds; you run modal run):

  • py_compile clean on all four files.
  • Full local suite: 116 passed, 1 skipped. delta_test.py (encoder structural + xor/checksum self-consistency) passes (3 passed) once numpy/zstandard/xxhash are present; it importorskips otherwise so the bare-env suite stays green.

The byte-for-byte round-trip against slime's real decoder is asserted by control_plane_test on Modal.

Link to Devin session: https://modal.devinenterprise.com/sessions/b0d6110c71924c24943bcb5cea1eb5f4
Requested by: @jvmncs

…book consolidation

Co-Authored-By: jason.mancuso@modal.com <jvmncs@gmail.com>
@jvmncs jvmncs self-assigned this Jun 30, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration Bot and others added 2 commits June 30, 2026 07:40
Co-Authored-By: jason.mancuso@modal.com <jvmncs@gmail.com>
Co-Authored-By: jason.mancuso@modal.com <jvmncs@gmail.com>
@jvmncs jvmncs closed this Jun 30, 2026
@nanjiangwill
nanjiangwill deleted the devin/1782803070-disagg-smoke-test branch July 27, 2026 04:23
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