Skip to content

serve: --weight-overlay and a drafter read from its target checkpoint (Inkling 2 Mini from its HF repos) - #406

Merged
AzeezIsh merged 2 commits into
mainfrom
feat/inkling2-sparkrun
Nov 23, 2026
Merged

AzeezIsh merged 2 commits into
mainfrom
feat/inkling2-sparkrun

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #401 (@data-angel's Inkling 2 Mini port). Lets Inkling 2 Mini serve straight from its Hugging Face repos: no assembled model dir and no separate drafter dir. Recipes in sparkrun-recipes then need nothing beyond HF ids. That covers sparkrun-recipes#36, which pins Spark (recommended) and Strict.

  • --weight-overlay <hf id | path> loads every *.safetensors file in an overlay repo alongside the checkpoint, adding each tensor under its own name (WeightStore::absorb). A name the checkpoint already has is an error.
    • Spark mode is --weight-overlay Enntity/Inkling-2-Mini-Spark-NVFP4.
    • The overlay repo ships no config.json, so the overlay resolves to its refs/main snapshot through model_resolver::hf_snapshot_dir. That is the first half of resolve_from_hf_cache, extracted with its error messages byte-identical. The second commit fixes the first commit's use of resolve_model_dir, which never booted on the real repo.
  • A --draft-model whose config.json carries an mtp_config next to an mtp.safetensors is read as that drafter: config = mtp_config + text_config.unpadded_vocab_size, weights = mtp.safetensors. So --draft-model thinkingmachines/Inkling-2-Mini serves the checkpoint's own DSpark drafter.
  • Each such file reaches the loader as model.safetensors through one symlink in a private temp dir, so nothing in the HF cache is copied or renamed.
  • No new ATLAS_* names, and nothing changes unless one of these flags points at such a repo.

The branch is linear on main 992eab2: the same two commits as the verified feat/inkling2-401-sparkrun (65a1426 + 58ade50), minus its merges of #401.

Test plan (sparky, one GB10)

  • Unit tests: weight_sidecar 3/3 (including overlay_resolves_config_less_hf_snapshot), model_resolver 7/7.
  • fmt, clippy (spark-server --tests) clean.
  • Overlay identity, job 178, bin e40433df @ 58ade50: the assembled Spark dir vs thinkingmachines/Inkling-2-Mini --weight-overlay Enntity/Inkling-2-Mini-Spark-NVFP4 give greedy C1 8/8 identical. The serve log reads weight overlay ...: 459 tensors.
  • Drafter identity, job 172: the assembled drafter dir vs --draft-model thinkingmachines/Inkling-2-Mini give 8/8 identical.
  • Spark recipe through sparkrun, job 178, image atlas-gb10-local:sha-58ade50 (sha256:01a6eb24…). The overlay's refs/main was deleted first, so sparkrun's own sync had to restore it.
    • The log shows 459 overlay tensors, the checkpoint's own mtp.safetensors drafter, and prefix caching on.
    • Tools 14/14, arith 40/40, needle 11/12, cache hit == cold 6/6.
    • SSM-state poisoning gate: 0 collapsed. agentic-webserver 10/10, 5.56 s/turn.
    • 0 ERROR/panic.
  • Strict recipe through sparkrun, job 176: tools 14/14, arith 40/40, needle 11/12, cache hit 6/6, agentic 9/10 (one /ping timeout), 0 ERROR.
  • CI workspace jobs on this PR.

Generated with Devin

AzeezIsh and others added 2 commits November 23, 2026 00:21
Lets Inkling 2 Mini (#401) serve straight from its Hugging Face repos, with
no assembled model or drafter directory, so a sparkrun recipe (HF ids, HF
offline after sync) can start it:

- `--weight-overlay <id|path>` loads every *.safetensors of an overlay repo
  beside the checkpoint and adds its tensors under their own names (a name
  the checkpoint already has is an error). Spark mode:
  `--weight-overlay Enntity/Inkling-2-Mini-Spark-NVFP4`. The Inkling loader
  already switches on those tensor names, so the result is the same store
  the assembled index produced.
- A `--draft-model` whose config.json carries an `mtp_config` beside an
  `mtp.safetensors` (Inkling 2 Mini's DSpark drafter) is read as that
  drafter: config = mtp_config + text_config.unpadded_vocab_size, weights =
  mtp.safetensors. `--draft-model thinkingmachines/Inkling-2-Mini` works.

Each such file reaches the loader as model.safetensors through one symlink
in a private temp directory; nothing in the checkpoint is copied or renamed.
WeightStore::absorb merges a second store. No new env names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Enntity/Inkling-2-Mini-Spark-NVFP4 ships only spark-nvfp4.safetensors,
quant-report.json and receipts/ — no config.json — so resolving an overlay
id through resolve_model_dir never booted. The overlay resolves straight to
its refs/main snapshot; safetensors_files does the validation.
@AzeezIsh
AzeezIsh merged commit 61661e2 into main Nov 23, 2026
23 of 26 checks passed
data-angel added a commit to Enntity/atlas that referenced this pull request Nov 23, 2026
…split, Atlas-Inf#403, Atlas-Inf#404, Atlas-Inf#406, Atlas-Inf#410) into the images follow-up

Two conflicts, both from the split of 401: layers/inkling2/mod.rs declares
owner_runs and proj, and inkling2_proj_gemv joins the PDL list in its new
file pdl_inkling2.rs. The tree equals this branch's five commits replayed
onto main.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
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