Repository navigation
Prepare and serve Inkling 2 Small NVFP4 at TP4 on four DGX Sparks - #304
Conversation
|
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
left a comment
There was a problem hiding this comment.
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
- CONTRIBUTING.md requires
Signed-off-by; 5abf03b, a4f446a and 803d626 have none. Main's checklist now hashes to1af4(#362), so a rebase needs new design acknowledgments, and the description needs the Discord line.
Should fix
- 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. - 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). - State only what was qualified.
docs/model-preparation.md:1309says four SM120 or SM121 GPUs "in one host or one per host", and:1370says 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) indocs/TODO.txt.:1401still says to drop the page cache before serving, which the distribution change makes unnecessary. tests/recipes/test_inkling2_hosts.py:56assertsplan.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.max_concurrency=32is 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
803d626 to
9ffa8cd
Compare
|
Addressed the review items and rebased onto
|
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 throughPreparationConfig, 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 defaultspeculative_token_capacityfrom 64 to 128 alongsidemax_concurrency=32ensures--max-concurrency 32prepares the qualified 128-token verification catalog without an extra flag, while keeping the default eight-request catalog identical because8 * 8 = 64 <= 128.What changed
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.preparerejectedranks, always bound process-local GPUs(0, 1, 2, 3), andprepare_rankadmitted compute capability(12, 0)only. Now, whenranksis supplied, each rank uses GPU 0 of its own host, andhosts,roce_ring, androce_chainflow fromPlanintoPreparationConfig(preservingcontext=plan.recipe.context).PreparationConfig(inheritingBasePreparationConfig) validates four distinct(host, device)placements and checks routing topology throughvalidate_host_topology.bootstrap._collective_runtimesallocates one shared RoCEnante runtime whencoordinator.spans_hostsis 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_resourcesdeduplicates the shared runtime so it closes once.decoder.reduction_dtypeselectstorch.bfloat16for a RoCE runtime andtorch.float32otherwise, casting embedding, attention, and expert partial sums before reduction.prepare_rankadmits(12, 1)alongside(12, 0)and drops the checkpoint's page cache on integrated GPUs after weight loading.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,PreparationConfigrejectedmax_active > 8withspeculative_token_capacity=64,RECIPEdeclaredmax_concurrency=8andSpeculation.token_capacity=64, andtests/server/test_inkling2.pypinned 8 requests and 4096-token chunks. Now,PreparationConfigacceptsmax_activein[1, 32]with defaultspeculative_token_capacity=128,RECIPEdeclaresmax_concurrency=32andtoken_capacity=128(leaving defaultconcurrency=8,prefill_chunk=4096, andgraph_budget=64unchanged), andtests/server/test_inkling2.pyaccepts concurrency of at least eight and 4096- or 8192-token chunks while scaling chunk-crossing prompts with the advertised chunk size.docs/model-preparation.mdstates the single-host SM120 and four-host GB10 qualifications separately, anddocs/TODO.txtrecords the unrun checks and GB10 rank-cost calibration.Result
ignition export --ranks 4with threeignition joinpeers 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, andflare runserves 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
--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.--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; lowestMemAvailable11.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 GiBMemAvailable) 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 oftests/server/test_inkling2.py, 16 and 32 concurrent exact-repeat requests, streaming, and an 18,832-token lookup (4/4 atmax_tokens=2048, 1/2 atmax_tokens=512where the other run spent 512 tokens in reasoning) with zero RoCE loss-counter increments and noearlyoomkills.main(10467f1a): 75 passed, 81 skipped acrosstests/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, andtests/preparation/test_weight_declarations.py; 228 passed, 0 failed intests/cli/test_planning.pyexcluding two pre-existing collective-ladder failures ondeepseek41andmuse_spark.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 indocs/TODO.txt.tests/server/test_inkling2.pyon Sparks,--roce-ringand--roce-chainrouting, and throughput benchmarks were not run; tracked indocs/TODO.txt.docs/TODO.txt.flare rundistribution is outside this PR, sodocs/model-preparation.mdretains the instruction to drop page cache before export and serving on unified-memory hosts.Discord: el8