Skip to content

Prepare and serve Inkling 2 Small NVFP4 at TP4 on four DGX Sparks - #304

Merged
lukealonso merged 2 commits into
mainfrom
inkling2/dgx-spark-tp4
Nov 20, 2026
Merged

lukealonso merged 2 commits into
mainfrom
inkling2/dgx-spark-tp4

Conversation

@original-el8

@original-el8 original-el8 commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Inkling 2 Small NVFP4 could previously be prepared only on four SM120 GPUs of one host, and was capped at eight concurrent requests with a 64-token packed verification capacity. Each rank holds a quarter of the 344 GB checkpoint, which fits a DGX Spark (GB10, 121 GiB unified memory), so four Sparks joined by RoCE can prepare and serve the model at up to 32 concurrent requests and 8192-token prefill chunks once the recipe places one rank per host and raises its request and verification capacities. The recipe follows the multi-host structure used by DeepSeek V4 (commit 51864a2b, #240): host placement and ring or chain routing travel through PreparationConfig, and one shared RoCEnante runtime replaces the per-role CUDA peer-memory channels when ranks span hosts. Because RoCEnante reduces BF16 only, cross-host ranks round partial sums to BF16 before reducing; single-host preparation keeps FP32 reductions so its prepared graphs do not change. Raising default speculative_token_capacity from 64 to 128 alongside max_concurrency=32 ensures --max-concurrency 32 prepares the qualified 128-token verification catalog without an extra flag, while keeping the default eight-request catalog identical because 8 * 8 = 64 <= 128.

What changed

  1. Multi-host TP4 preparation (586c6018 — ignition/recipes/inkling2/{recipe,bootstrap,decoder}.py, tests/recipes/test_inkling2_hosts.py, docs/{model-preparation,roce-ring}.md, docs/TODO.txt): Previously, recipe.prepare rejected ranks, always bound process-local GPUs (0, 1, 2, 3), and prepare_rank admitted compute capability (12, 0) only. Now, when ranks is supplied, each rank uses GPU 0 of its own host, and hosts, roce_ring, and roce_chain flow from Plan into PreparationConfig (preserving context=plan.recipe.context). PreparationConfig (inheriting BasePreparationConfig) validates four distinct (host, device) placements and checks routing topology through validate_host_topology. bootstrap._collective_runtimes allocates one shared RoCEnante runtime when coordinator.spans_hosts is true—carrying hidden reductions and vocabulary, sampling, and log-probability gathers sized from decode rows, per-request draft blocks, the prefill chunk, and each rank's vocabulary partition—and creates the same peer-memory channels as before when ranks share one host; close_resources deduplicates the shared runtime so it closes once. decoder.reduction_dtype selects torch.bfloat16 for a RoCE runtime and torch.float32 otherwise, casting embedding, attention, and expert partial sums before reduction. prepare_rank admits (12, 1) alongside (12, 0) and drops the checkpoint's page cache on integrated GPUs after weight loading.
  2. 32-request concurrency limit and 128-token default verification capacity (9ffa8cd6 — ignition/recipes/inkling2/{recipe,bootstrap}.py, tests/cli/test_{inkling2,planning}.py, tests/recipes/test_inkling2_hosts.py, tests/server/test_inkling2.py, docs/model-preparation.md, docs/TODO.txt): Previously, PreparationConfig rejected max_active > 8 with speculative_token_capacity=64, RECIPE declared max_concurrency=8 and Speculation.token_capacity=64, and tests/server/test_inkling2.py pinned 8 requests and 4096-token chunks. Now, PreparationConfig accepts max_active in [1, 32] with default speculative_token_capacity=128, RECIPE declares max_concurrency=32 and token_capacity=128 (leaving default concurrency=8, prefill_chunk=4096, and graph_budget=64 unchanged), and tests/server/test_inkling2.py accepts concurrency of at least eight and 4096- or 8192-token chunks while scaling chunk-crossing prompts with the advertised chunk size. docs/model-preparation.md states the single-host SM120 and four-host GB10 qualifications separately, and docs/TODO.txt records the unrun checks and GB10 rank-cost calibration.

Result

ignition export --ranks 4 with three ignition join peers prepares Inkling 2 Small NVFP4 across four DGX Sparks at up to 32 concurrent requests and 8192-token prefill chunks with 128-token packed verification by default, and flare run serves the exported core across the four hosts. Single-host preparation retains the same peer-memory channels, FP32 hidden reductions, and eight-request default graph catalog. Serving checks on four Sparks establish functional behavior only; no throughput benchmark is claimed.

Evidence and limitations

  • Four DGX Sparks (GB10, SM121, 121 GiB unified memory each, one rank per host, RoCE over ConnectX-7 with switch routing, checkpoint on rank zero only):
    • Reduced core (--no-mtp --language-model-only --max-concurrency 1 --prefill-chunk-size 512 --autotune-effort off --no-compile, no memory reserve): exported 8 graphs in 18 min 43 s, loaded 82.91 GiB per rank with a 24.5 GiB cache (6,414,336 KV tokens), and passed chat completion, streaming (90 events), two requests against one slot, a 7,150-token chunked lookup, and 3.5 s SIGTERM drain with zero RoCE loss-counter increments.
    • Full 32-request core (--max-concurrency 32 --image-concurrency 4 --prefill-chunk-size 8192 --mtp-draft-tokens 7 --speculative-token-capacity 128 --speculative-graph-budget 64 --autotune-effort default, 4 GiB reserve): exported 152 graphs in 1 h 25 min 30 s (351 GB core; lowest MemAvailable 11.5–13.1 GiB; 2,840 MiB graph pool per rank). Serving loaded 90.06–90.24 GiB per rank: 12.4 GiB cache (2,392,064 KV tokens, 78 snapshot slots, 12.0–12.5 GiB MemAvailable) with the 4 GiB reserve, or 16.5 GiB cache (3,252,224 KV tokens, 106 snapshot slots, 7.76–8.26 GiB after loading, 7.64 GiB lowest during 32 concurrent requests) with --memory-limit=-0G. Passed all 7 default-effort cases of tests/server/test_inkling2.py, 16 and 32 concurrent exact-repeat requests, streaming, and an 18,832-token lookup (4/4 at max_tokens=2048, 1/2 at max_tokens=512 where the other run spent 512 tokens in reasoning) with zero RoCE loss-counter increments and no earlyoom kills.
  • CPU tests on main (10467f1a): 75 passed, 81 skipped across tests/recipes/test_inkling2_hosts.py, tests/cli/test_inkling2.py, tests/recipes/test_inkling2_frontend.py, tests/recipes/test_inkling2_experts.py, tests/recipes/test_inkling2_target.py, and tests/preparation/test_weight_declarations.py; 228 passed, 0 failed in tests/cli/test_planning.py excluding two pre-existing collective-ladder failures on deepseek41 and muse_spark.
  • Material limitations and unrun checks:
    • Numerical comparison of BF16 cross-host reductions (ignition/recipes/inkling2/decoder.py) against single-host FP32 output has not been run because no four-GPU SM120 single host is available in this test environment; tracked in docs/TODO.txt.
    • Single-host SM120 preparation after these multi-host changes, single-host SM120 at 32 concurrent requests, a 16-request core, an 8-request Spark core, effort-zero cases of tests/server/test_inkling2.py on Sparks, --roce-ring and --roce-chain routing, and throughput benchmarks were not run; tracked in docs/TODO.txt.
    • Planning at 32 requests and 8192-token chunks estimates 22.9 GiB of KV pages per rank against 12.4 GiB allocated at a 4 GiB reserve; rank-cost calibration is tracked in docs/TODO.txt.
    • Peer rank-core page-cache release during flare run distribution is outside this PR, so docs/model-preparation.md retains the instruction to drop page cache before export and serving on unified-memory hosts.

Discord: el8

@original-el8 original-el8 changed the title Prepare Inkling 2 Small NVFP4 across four hosts for DGX Spark TP4 Prepare and serve Inkling 2 Small NVFP4 at TP4 on four DGX Sparks Nov 15, 2026
@original-el8 original-el8 added area:packaging Package assembly, verification, distribution, inspection, and loading. area:preparation Ignition checkpoint loading, tuning, compilation, capture, and export. enhancement New feature or request triage:validation Proposed implementation needs acceptance evidence; no claim that a reported defect is fixed. labels Nov 18, 2026
@original-el8

Copy link
Copy Markdown
Collaborator Author

This is not redundant with the Inkling 2 recipe already on main. The diff against main 5fd4070 still removes the single-host-only preparation restriction, adds cross-host configuration/collectives, raises the concurrency ceiling and releases peer distribution page-cache data. The branch merges cleanly. Keep it as the TP4 cross-host integration/qualification PR; #312's further optimizations and external FlashInfer dependencies are separate. I inspected the remaining diff and the reported validation, but did not repeat the four-host export or serving run.

@yatesdr yatesdr left a comment

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.

Inkling 2 Small at TP4 across four DGX Sparks is worth having, and the recipe takes its placement from the plan and ranks, as deepseek41 does. Before merge:

Blocking

  1. CONTRIBUTING.md requires Signed-off-by; 5abf03b, a4f446a and 803d626 have none. Main's checklist now hashes to 1af4 (#362), so a rebase needs new design acknowledgments, and the description needs the Discord line.

Should fix

  1. Split out the page-cache release. release_served_pages (flare-cli/src/distribution.rs:1012, called at :1081) runs for every multi-host core, on every model and TP size, but the evidence is Inkling on four Sparks. Put it in its own PR with a run on another model and on discrete GPUs, and a test that exercises the rank-zero skip; the new test's rank-zero file list is empty.
  2. Numerical contract. Over RoCE, the cross-host reductions now round to BF16 (ignition/recipes/inkling2/decoder.py:97, :105, :169), while a single host keeps FP32. Post a comparison against single-host FP32 output (design-review principles 9 and 12).
  3. State only what was qualified. docs/model-preparation.md:1309 says four SM120 or SM121 GPUs "in one host or one per host", and :1370 says up to 32 concurrent requests; the evidence covers four GB10 hosts. Put the unrun checks (single host, RTX PRO 6000 at 32 requests, ring and chain routing) in docs/TODO.txt. :1401 still says to drop the page cache before serving, which the distribution change makes unnecessary.
  4. tests/recipes/test_inkling2_hosts.py:56 asserts plan.page_bytes >= 16 << 30, the estimate that your TODO entry says over-counts (22.9 GiB planned per rank against 12.4 GiB allocated). Assert the allocated requirement, or drop the bound.
  5. max_concurrency=32 is declared for all hardware (ignition/recipes/inkling2/recipe.py:60), but the qualified 32-request core also needs --speculative-token-capacity 128, which only the documented command passes.

The Inkling 2 Small NVFP4 recipe previously prepared only on four GPUs of one
host: it rejected a multi-host rendezvous, built its collectives on CUDA peer
memory, and admitted compute capability 12.0 alone. Each rank holds a quarter
of the 344 GB checkpoint, which fits a DGX Spark (GB10, 121 GiB unified
memory), so four Sparks joined by RoCE can serve the model once the recipe
places one rank per host. The recipe follows the multi-host structure used by
DeepSeek V4 (51864a2, #240): host placement and ring/chain routing travel
through PreparationConfig, and one RoCEnante runtime replaces the per-role
peer-memory channels when the rank group spans hosts. Because RoCEnante reduces
BF16 only, cross-host ranks round each partial sum to BF16 before reducing,
while single-host preparation keeps FP32 reductions so its prepared graphs do
not change.

In ignition/recipes/inkling2/: previously, recipe.prepare raised when given
ranks and always used process-local GPUs 0 through 3. Now, with ranks, each
rank uses GPU 0 of its own host, and hosts, roce_ring, and roce_chain flow
from the plan into PreparationConfig (preserving context=plan.recipe.context).
PreparationConfig validates four distinct (host, device) placements and checks
routing shape through validate_host_topology. bootstrap._collective_runtimes
allocates one shared RoCEnante runtime when coordinator.spans_hosts is true,
carrying hidden reductions and vocabulary, sampling, and log-probability
gathers sized from decode rows, per-request draft blocks, the prefill chunk,
and each rank's vocabulary partition; otherwise it creates the same
peer-memory all-reduce and all-gather runtimes as before. close_resources
deduplicates the shared runtime so it closes once. decoder.reduction_dtype
selects BF16 for a RoCE runtime and FP32 otherwise, casting embedding,
attention, and expert partial sums before reduction. prepare_rank admits
compute capability (12, 1) alongside (12, 0) and releases the checkpoint's
page cache on integrated GPUs after loading weights. The request limit stays 8
and declared defaults remain unchanged. docs/model-preparation.md documents
four-host Spark preparation and what was qualified, docs/roce-ring.md lists
Inkling 2 Small NVFP4 among multi-host TP4 recipes, and docs/TODO.txt records
the unrun checks.

As a result, `ignition export --ranks 4` with three `ignition join` peers
prepares Inkling 2 Small NVFP4 across four hosts, and `flare run` serves the
core across them. Single-host preparation builds the same peer-memory channels
and FP32 reductions as before.

Evidence: on four DGX Sparks (GB10, SM121, 121 GiB unified memory each, RoCE
over ConnectX-7 with switch routing, checkpoint on rank zero only), a reduced
core (--no-mtp --language-model-only --max-concurrency 1 --prefill-chunk-size
512 --autotune-effort off --no-compile, no memory reserve) exported 8 graphs
in 18 min 43 s and served across the four hosts (82.91 GiB loaded per rank,
24.5 GiB cache with 6,414,336 KV tokens). A chat completion, a streamed
completion (90 events), two requests against the one slot, and a 7,150-token
lookup prefilled in fourteen 512-token chunks returned expected answers,
SIGTERM shutdown completed in 3.5 s, and RoCE loss counters did not change.
CPU tests after rebasing onto main (10467f1): tests/recipes/test_inkling2_hosts.py,
tests/cli/test_inkling2.py, and the Inkling 2 and host-shape cases of
tests/cli/test_planning.py passed (22 passed, 0 failed). Across the full
tests/recipes/test_inkling2_hosts.py, tests/cli/test_inkling2.py,
tests/cli/test_planning.py, and tests/recipes/test_declarations.py: 289 passed,
8 failed, 15 skipped; all 8 failures are pre-existing on main (DeepSeek V4.1
and Muse Spark collective-ladder cases, Qwen declaration assertions, and
missing Kimi checkpoint fixtures). Limitations and not run: numerical
comparison of BF16 cross-host reductions against single-host FP32 output,
single-host SM120 GPU preparation after this change, --roce-ring and
--roce-chain routing, and the effort-zero cases of tests/server/test_inkling2.py
on Sparks.

Signed-off-by: Jason Cook <jasonc@maxlyn.com>
Design-Signed-Off-By: Antigravity (Gemini 4 Neon); design-review=1af4
The Inkling 2 Small NVFP4 recipe rejected more than eight concurrent requests
because PreparationConfig bounded max_active to [1, 8] and the recipe declared
max_concurrency=8 with speculative_token_capacity=64. Four DGX Sparks hold
enough memory beside the weights for a 32-request core with 8192-token prefill
chunks, and all request slots, batch capacities, pool rows, DSpark scratch,
vision slots, gather rows, prefill scratch, and page counts already derive
from the configured request count. Raising the recipe's default
speculative_token_capacity from 64 to 128 alongside max_concurrency=32 matches
the qualified 32-request verification catalog without requiring an extra flag,
while leaving the default eight-request catalog identical because 8 * 8 = 64
is within 128.

Previously, bootstrap.PreparationConfig rejected max_active above 8,
recipe.RECIPE declared max_concurrency=8 and Speculation.token_capacity=64,
and tests/server/test_inkling2.py pinned eight requests and 4096-token chunks.
Now, PreparationConfig accepts max_active in [1, 32] with default
speculative_token_capacity=128, recipe.RECIPE declares max_concurrency=32 and
token_capacity=128 (keeping default concurrency=8, prefill_chunk=4096, and
graph_budget=64), tests/server/test_inkling2.py accepts concurrency of at
least eight and 4096- or 8192-token chunks while scaling chunk-crossing
prompts with the advertised chunk size, tests/cli/test_inkling2.py and
tests/cli/test_planning.py verify the updated defaults, and
tests/recipes/test_inkling2_hosts.py covers the 32-request bound, default
128-token capacity, unchanged 8-request speculative shapes, RoCE channel
sizing, and GB10 planning fit without asserting an overestimated page-byte
floor. docs/model-preparation.md documents the 32-request, 8192-token four-
Spark qualification and states the unrun configurations, and docs/TODO.txt
records single-host SM120 at 32 requests and the GB10 rank-cost calibration.

As a result, the recipe prepares and serves up to 32 concurrent requests with
128-token packed verification by default, while an export without flags
produces the same eight-request graph catalog as before. On four DGX Sparks,
the 32-request, 8192-token core with seven drafts and vision exports, loads
with at least 7.6 GiB available per host, and answers 32 concurrent requests
correctly (functional checks only; no throughput was measured).

Evidence: on four DGX Sparks (GB10, 121 GiB unified memory each, one rank per
host, RoCE over ConnectX-7 with switch routing), exporting with
--max-concurrency 32 --image-concurrency 4 --prefill-chunk-size 8192
--mtp-draft-tokens 7 --speculative-token-capacity 128
--speculative-graph-budget 64 --autotune-effort default and a 4 GiB reserve
took 1 h 25 min 30 s and produced 152 graphs in a 351 GB core (lowest
MemAvailable 11.5 to 13.1 GiB during export; 2,840 MiB graph pool per rank).
Serving loaded 90.06 to 90.24 GiB per rank: with the 4 GiB reserve the cache
was 12.4 GiB (2,392,064 KV tokens, 78 snapshot slots, 12.0 to 12.5 GiB
MemAvailable); with --memory-limit=-0G it was 16.5 GiB (3,252,224 KV tokens,
106 snapshot slots, 7.76 to 8.26 GiB after loading, 7.64 GiB lowest during 32
concurrent requests). On that service, tests/server/test_inkling2.py -k
default-effort passed all 7 cases; 16 and 32 concurrent exact-repeat requests
and a streamed completion succeeded; an 18,832-token lookup succeeded in 4 of
4 runs at max_tokens=2048 and 1 of 2 at max_tokens=512 (the other spent all
512 tokens in reasoning); RoCE loss counters did not change and earlyoom
killed no process. CPU tests after rebasing onto main (10467f1): 75 passed,
81 skipped across tests/recipes/test_inkling2_hosts.py,
tests/cli/test_inkling2.py, tests/recipes/test_inkling2_frontend.py,
tests/recipes/test_inkling2_experts.py, tests/recipes/test_inkling2_target.py,
and tests/preparation/test_weight_declarations.py; 228 passed, 0 failed in
tests/cli/test_planning.py excluding two pre-existing collective-ladder
failures on deepseek41 and muse_spark. Limitations and not run: the planner
predicts 22.9 GiB of KV pages per rank against 12.4 GiB allocated at the 4 GiB
reserve (recorded in docs/TODO.txt); not run are 32 requests on single-host
SM120 (RTX PRO 6000), a 16-request core, an 8-request Spark core, effort-zero
server cases on Sparks, BF16-vs-FP32 reduction numerical comparison, and
benchmarks.

Signed-off-by: Jason Cook <jasonc@maxlyn.com>
Design-Signed-Off-By: Antigravity (Gemini 4 Neon); design-review=1af4
@original-el8
original-el8 force-pushed the inkling2/dgx-spark-tp4 branch from 803d626 to 9ffa8cd Compare November 20, 2026 18:17
@original-el8

Copy link
Copy Markdown
Collaborator Author

Addressed the review items and rebased onto main (10467f1a, commits 586c6018 and 9ffa8cd6):

  1. DCO, design-review hash, and Discord contact: Rebased onto main (adapting PreparationConfig to inherit BasePreparationConfig, use validate_host_topology, and preserve context=plan.recipe.context), added Signed-off-by and Design-Signed-Off-By: ...; design-review=1af4 trailers to both commits, and added Discord: el8 to the PR description.
  2. Page-cache release split out: Dropped the flare-cli/src/distribution.rs page-cache release commit from this PR so it can be validated separately on another model, discrete GPUs, and with a non-empty rank-zero skip test.
  3. BF16 cross-host vs. single-host FP32 numerical comparison: No four-GPU SM120 single-host machine is available in this environment to run an end-to-end single-host FP32 comparison against the four-Spark BF16 reduction path. This remains explicitly disclosed as unrun in the PR description, docs/model-preparation.md, and docs/TODO.txt. Note on the rounding sites in ignition/recipes/inkling2/decoder.py: attention_partial rounds from FP32 to BF16 before RoCEnante reduction, whereas embedded is BF16 with disjoint per-rank vocabulary partitions and expert_partial is already BF16.
  4. Qualified scope in docs: Narrowed docs/model-preparation.md to separate single-host SM120 (8 requests, 4096-token chunks) from four-host SM121 DGX Spark qualification (32 requests, 8192-token chunks), and recorded all unrun checks (single-host SM120 re-validation and 32-request run, --roce-ring, --roce-chain, effort-zero on Sparks, and BF16-vs-FP32 comparison) in docs/TODO.txt. Kept the page-cache drop instruction in docs/model-preparation.md because the distribution page-cache release was split out of this PR.
  5. Planner page-bytes bound in tests: Dropped the overestimated plan.page_bytes >= 16 << 30 assertion in tests/recipes/test_inkling2_hosts.py.
  6. Default speculative_token_capacity for 32 requests: Raised RECIPE.speculation.token_capacity and PreparationConfig.speculative_token_capacity from 64 to 128, so --max-concurrency 32 prepares the qualified 128-token verification capacity by default without an extra flag while keeping the default 8-request graph catalog identical (8 * 8 = 64 <= 128). Verified with unit tests in tests/recipes/test_inkling2_hosts.py, tests/cli/test_inkling2.py, and tests/cli/test_planning.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:packaging Package assembly, verification, distribution, inspection, and loading. area:preparation Ignition checkpoint loading, tuning, compilation, capture, and export. enhancement New feature or request triage:validation Proposed implementation needs acceptance evidence; no claim that a reported defect is fixed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants