Repository navigation
Releases
dsv41-1.1.1: DeepSeek-V4.1-Flash on two DGX Spark
The engine of the DeepSeek-V4.1-Flash recipe: DeepSeek-V4.1-Flash-1017 (EXL3, 2.9 bpw) on two DGX Spark, tensor-parallel (TP=2) over the QSFP link.
| Commit | cb4ceaff2b8c on deepseek-v41-tp2 |
| Previous release | dsv41-1.1.0 (730d41abd8f4) |
| Image tag that the recipe builds | tensorfold-dsv41:cb4ceaff2b8c (first 12 characters of the commit) |
| Hardware | 2x NVIDIA DGX Spark (GB10), ConnectX-7, RoCE v2, MTU 9000 |
This release holds 8 pull requests since 1.1.0. Most are fixes: host memory and RDMA setup, tool-call safety, special-token text, and a clean stop after SIGTERM.
Fixes
| Pull request | Change |
|---|---|
| #22 | Three host fixes, each written again in Python after an idea of the official TensorFold. (1) NCCL cuMem is off by default (NCCL_CUMEM_ENABLE=0, NCCL_CUMEM_HOST_ENABLE=0, unless you set them). A probable cause of the NV_ERR_NO_MEMORY reports on GB10. (2) The RDMA GID index is read from sysfs: the lowest RoCE v2 IPv4 entry of each port. NCCL_IB_GID_INDEX and TF_RDMA_GID_INDEX can stay unset, or be -1. A value of 0 or more still fixes the index. A link flap that moves the GID table no longer breaks the gather. (3) The page cache of the weight files is released after the weight load (fadvise), and the log shows the page cache size. |
| #23 | DSML tool calls are contained. A call counts only when its calls block is complete and well formed at the top level of the reply. Text in an open block is never a call, and a <tool_call> or DSML block inside an argument value is argument text. This holds for the whole reply, for the stream, and with TF_DROP_UNOFFERED_TOOL_CALLS=1. A block that does not count and hides a later call prints one WARNING line and counts in tensorfold:tool_calls_suppressed_total on /metrics. |
| #28 (security) | A special-token spelling in message text (</think>, <|User|>, <|Assistant|>, |DSML| and others) is plain text. Before, the tokenizer made a token of it, in a system, user or tool message, in an assistant history, in a tool argument, a tool description, the response format and an image caption. A client could end the thinking, forge a turn or start a forged tool call. The rule follows deepseek-ai/deepseek-recipe. A request without such a spelling gets the same token ids and the same prefix-cache keys as before. |
| #34 | Clean stop after SIGTERM. Rank 0 no longer aborts with terminate called without an active exception when it gets SIGTERM during a prefill (earlyoom or docker stop). The server leaves with exit code 0 within TF_SHUTDOWN_GRACE_S (default 3 s). |
| #35 | A reply that stops inside a DSML calls block (max_tokens) loses the open block from content. Streamed and whole replies now give the same content and the same calls at every cut. Complete blocks before the cut still run. |
| #27 (by @hyungraekim-bagelcode) | With response_format json_schema, the prompt shows the schema, not the OpenAI wrapper. This is what the DeepSeek API layer does. The grammar of the request does not change. |
New
| Pull request | Change |
|---|---|
| #25 | The DSpark drafts of a sampled stream follow the stream's own keyed draw (TF_DS_DRAFT_COUPLED, default on; scale TF_DS_DRAFT_COUPLED_SCALE, default 0.5). The pick is fused into the Markov kernels. Output tokens do not change. A greedy stream keeps the argmax drafts. TF_DS_DRAFT_COUPLED=0 turns it off. It adds a second draft graph (see the known issue below). |
Maintenance
| Pull request | Change |
|---|---|
| #26 | The decode L2 prefetch issues at once: the default of TF_EXL3_L2_DELAY_NS is now 0 (before: 3000). It writes no memory, so no output bit changes. TF_EXL3_L2_DELAY_NS=3000 restores the old wait. |
Results
Measured on 2026-10-21 on the 2x DGX Spark pair, image tensorfold-dsv41:cb4ceaff2b8c, against the 1.1.0 image tensorfold-dsv41:fc9200a44463 (same git tree as 730d41abd8f4). Production settings (graphs on, SPILL_GIB=64, --parallel 4, 1M context, a fresh prompt-spill folder per start). Two lock windows, with the order swapped in the second one: each cell shows window 1 / window 2. The candidate ran with NCCL_IB_GID_INDEX and TF_RDMA_GID_INDEX unset (detected index 3); 1.1.0 ran with the index pinned to 3.
| Check | 1.1.1 | Baseline 1.1.0 |
|---|---|---|
Suite (v41_suite.py, sent straight to the engine) |
32/32, 32/32 | 32/32, 32/32 |
| Grammar check | 14/14, 14/14 | 14/14, 14/14 |
| Decode, 1 stream, prose / code | 54.8 / 99.9 and 54.7 / 99.4 tok/s | 53.4 / 101.4 and 53.4 / 101.3 tok/s |
| Decode, 4 streams, prose, per stream (aggregate) | 27.2 (101.8) and 27.0 (101.2) tok/s | 27.3 (101.1) and 27.1 (100.3) tok/s |
| Decode, 4 streams, code, per stream (aggregate) | 40.2 (148.9) and 40.0 (148.0) tok/s | 40.3 (147.7) and 40.1 (147.3) tok/s |
| Prefill, 32K prompt, cold (no prefix-cache hit), random natural text, median of 3 | 1,966 and 1,959 tok/s (TTFT 16.29 s, 16.35 s) | 1,862 and 1,950 tok/s (TTFT 17.20 s, 16.42 s) |
| Prefill, 32,768 tokens, cold, kit_bench words, median of 3 | 2,250 and 2,234 tok/s | 2,121 and 2,228 tok/s |
| Prefix cache, 24K prompt, cold / warm TTFT | 11.14 s / 1.07 s and 11.21 s / 1.17 s | 11.37 s / 1.11 s and 11.21 s / 1.31 s |
| Long run: 4 streams with 20K / 50K / 100K / 200K prompts | 0 errors, identical tokens | 0 errors, identical tokens |
Long run: lowest head MemAvailable |
1,621 and 1,584 MiB | 1,848 and 1,684 MiB |
| Late graph captures, earlyoom events | 0, none | 0, none |
| Live checks of the new fixes (22 checks) | 22/22 and 22/22 | 5/22 and 5/22 |
- Every prefill value is cold:
cached_tokenswas 0 for all of them. Prompts start with a unique line, and the spill folder is new at each start. - Every benchmark is one pass per window, except the prefill rows (median of 3). Decode and prefill differences are inside the noise (about 2%). Do not read a speed gain into this release.
- The long run tokens have the same four hashes in all four runs (
d58f653b2ce8,f42ae2e092ab,0ed6e9e70041,0d2a3aa664b6), also the same as in the 1.1.0 gate. - Live checks: a user message with
</think>and<|User|>adds no special token id;tool_choicerequiredandautocut at 4 to 64 new tokens give no raw DSML incontent, and the stream equals the whole reply; ajson_schemarequest works and the prompt shows only the schema. 1.1.0 fails 17 of these checks, which are the bugs that this release fixes. - SIGTERM to rank 0 11 s into a 100K-token prefill: exit code 0 after 2.6 s, no
terminate calledin either rank log. Rank 1 then ends withrank 0's step link closed, as expected. - RDMA: with no GID variable set, both ports of both nodes use index 3 (
detected), the log showsdecode gathers over RDMA writes, and the gather does not fall back to NCCL.
Use it
Do not install this engine by hand. The recipe builds the image from this commit and checks the setup:
git clone https://github.com/Elevatormusic/DeepSeek-V4.1-Flash-1017-EXL3-TensorFold-2x-DGX-SparkThen follow its README. A recipe pull request moves the image pin to this release.
Known issues
- Head memory margin under 4 long streams. In the long run above, the lowest head
MemAvailablewas 1.58 to 1.62 GiB (1.1.1), against 1.68 to 1.85 GiB (1.1.0). The new image holds about 0.14 GiB more on the head (the second draft graph of #25). The rest of the gap came from less free memory at the start of each window: the free memory after a start varies by 0.3 to 0.6 GiB from one start to the next, on both images. There was no earlyoom stop, and the low point stayed 0.58 GiB over the 1 GiB earlyoom limit. With less free memory at idle, use the low-memory settings (PREFILL_CHUNK=1024orPARALLEL=2). See docs/MEMORY.md in the recipe. A separate recipe change tovm.watermark_scale_factor25 is in review (about +0.47 GiB of measured head headroom). Recipe issue #21 stays open for this. - Head node hard hang under TP=2 load (CX-7 PCIe completion timeout, then mlx5 recovery and an SMMU stall): recipe issue #24 is still open. This release does not change it.
- Four concurrent 1M-token prompts are rejected, but they are tokenized first, and that can raise head memory by more than 1 GiB in 2 s.
- A message that writes a special-token spelling is encoded twice (once to find the spelling, once as plain text). The cost is CPU time on very large messages (about 5.8 s against 2.6 s for 3.9 MB).
Licence
Apache-2.0, as upstream TensorFold. See LICENSE and NOTICE.
dsv41-1.1.0: DeepSeek-V4.1-Flash on two DGX Spark
The engine of the DeepSeek-V4.1-Flash recipe: DeepSeek-V4.1-Flash-1017 (EXL3, 2.9 bpw) on two DGX Spark, tensor-parallel (TP=2) over the QSFP link.
| Commit | 730d41abd8f4 on deepseek-v41-tp2 (same git tree as fc9200a44463, the tested image) |
| Previous release | dsv41-1.0.0 (07aa02585f64) |
| Image tag that the recipe builds | tensorfold-dsv41:730d41abd8f4 (first 12 characters of the commit) |
| Hardware | 2x NVIDIA DGX Spark (GB10), ConnectX-7, RoCE v2, MTU 9000 |
Fixes for problems that users reported
| Pull request | Change |
|---|---|
| #19 | No decode graph is captured while the engine serves. Users with long parallel sessions saw cudaErrorStreamCaptureInvalidated or a CUDA allocation failure during graph capture (NVIDIA forum thread, posts #48 and ashhart#70). Root cause: the --parallel warm-up captured only 64 round graphs, so other row and context sizes were captured on first use. Each late capture took about 12-13 MiB of memory that the allocator ceiling did not count, and the global capture mode let another thread invalidate it. Now the warm-up captures every round graph that the window can use, a round runs in the graph of the next row size up, and the capture mode is thread_local. A late capture prints a WARNING. Switches: TF_DS_ROUND_ROWS, TF_DS_ROUND_ROWS_LONG, TF_DS_FINE_CONTEXT, TF_DS_CAPTURE_MODE=global (old mode). |
| #21 | Lower host-memory peak on the head under long prompts and images (recipe issue #21, where earlyoom stopped rank 0). The Engram cross-rank sum runs in 512-row blocks (TF_DS_ENGRAM_BLOCK; chunk peak 1.19 → 0.84 GiB, identical tokens). Free torch blocks over 256 MiB go back to the node when the lane is idle (TF_DS_TRIM_MIB). With streams live, a new request waits while free memory is under floor + 1 GiB (TF_DS_ADMIT_GIB). Each part has a switch to turn it off. |
| #24 | The memory gate of #21 counts only the cached bytes that a trim can give back. Before, it also counted about 0.3-0.4 GiB of slack that can never be freed, so after a long session 4 long requests could start together, and in one gate run earlyoom stopped rank 0. Until the gate knows the slack, it counts no cached bytes. |
| #9 | The RDMA queue pairs take the path MTU from the port, not a fixed 4096. At netdev MTU 1500 the gather no longer fails with transport retry counter exceeded (recipe issue #15). MTU 9000 is still the tested and faster setting. |
| #13 | Lane streams are found by identity. Overlapping image requests no longer crash the lane. |
| #14 | --vision-max-images now applies to DeepSeek-V4.1 image input. |
New
| Pull request | Change |
|---|---|
| #20 | MTP drafts of all streams are ranked in one round by how likely each draft token is to survive (TF_DS_DEPTH_POLICY=rank, the new default). Drafts of a structured-output stream stop where the grammar cuts them, before the ranking. Output tokens do not change. |
| #15 | Opt-in TF_DROP_UNOFFERED_TOOL_CALLS=1: a call to a tool that the request did not offer is dropped (or kept as text), also while streaming. Off by default in the engine. |
| #8 | Dense BF16 overrides for DeepSeek-V4.1 TP=2: a checkpoint can replace selected EXL3 tensors with BF16 tensors. Prompt chunks use one BF16 GEMM with FP32 output. Not used by the default recipe. |
| #18 (re-land of #7) | 8-key tile search for the prompt indexer top-k: prefill +0.6 / +0.8 / +2.0 / +3.6% at 8K / 32K / 64K / 128K. #7 was merged into a stacked branch and missed 1.0.0's branch; this release has it. |
Maintenance
| Pull request | Change |
|---|---|
| #12 | CI: CPU tests, lint of changed files, workflow checks and a secret scan. |
| #16 | TLS 1.2 is the stated minimum for image URL fetches (CodeQL alert #1). No change at run time. |
Results
Measured on 2026-10-21 on the 2x DGX Spark pair, image tensorfold-dsv41:fc9200a44463 (same git tree as this commit), production settings (graphs on, SPILL_GIB=64, --parallel 4, 1M context). The baseline is the 1.0.x production image 3c45bdaeab7d, run in the same session.
| Check | 1.1.0 | Baseline 3c45bdaeab7d |
|---|---|---|
Suite (v41_suite.py, sent straight to the engine) |
32/32 | 32/32 |
Grammar check, --parallel 2 |
14/14 | 14/14 |
| Decode, 1 stream, prose / code | 51.9 / 99.7 tok/s | 52.7 / 100.4 tok/s |
| Decode, 4 streams, per stream / aggregate, prose | 26.8 / 99.3 tok/s (+5.9% / +3.3%) | 25.3 / 96.1 tok/s |
| Decode, 4 streams, per stream / aggregate, code | 39.7 / 145.7 tok/s (+7.0% / +3.0%) | 37.1 / 141.5 tok/s |
| Prefill, 32K prompt, cold (no prefix-cache hit), random text | 1,963 tok/s, TTFT 16.32 s (median of 3) | not measured with this method |
| Prefix cache, 24K prompt, cold / warm TTFT | 11.18 s / 1.05 s | 11.43 s / 1.10 s |
| Long run: 4 streams with 20K / 50K / 100K / 200K prompts | 0 errors, identical tokens | 0 errors, identical tokens |
| Late graph captures while serving | 0 | not counted (no warning in this version) |
- Each benchmark is one pass. The 1-stream decode difference is inside the noise.
- Correction (2026-10-21). The first version of this table showed a 32K prefill of 2,751 tok/s (1.1.0) and 2,717 tok/s (baseline). Those numbers came from a prefix-cache hit of 6,144 tokens in the test suite: the suite sent an 8K prompt and then a 32K prompt with the same repeated sentence. The old prefill comparison is withdrawn. With no prefix-cache hit, 1.1.0 gives 1,963 tok/s for random natural text (median of 3; random token ids 2,004 tok/s) and 2,228 tok/s for the repeated sentence. The baseline was not measured with a cold prompt, so no prefill difference between 1.1.0 and the baseline is claimed. The cold side of the 24K prefix-cache row below is not affected: the log shows
cached_tokens0 for it in both columns. - The 4-stream gain comes mainly from #20 (rank drafts). The release also contains #8 and #24, so the gain is not from #20 alone.
- With graphs off (
TF_DS_GRAPHS=0), the earlier candidatee2b282c50724passed all suite tests that reached it. The 2 router tests in that run went to a different model behind the router, so they did not count.
Use it
Do not install this engine by hand. The recipe builds the image from this commit and checks the setup:
git clone https://github.com/Elevatormusic/DeepSeek-V4.1-Flash-1017-EXL3-TensorFold-2x-DGX-SparkThen follow its README. A recipe pull request moves the image pin to this release.
Known issues
- Head memory margin under 4 long streams. In the long run above, the lowest head MemAvailable was 1.45 GiB (1.1.0) and 1.65 GiB (baseline), against the 1 GiB earlyoom limit. With less free memory at idle (for example after other processes on the head), set
TF_DS_PREFILL_CHUNK=1024or use--parallel 2. Recipe issue #21 stays open for this. - Head node hard hang under TP=2 load (CX-7 PCIe completion timeout, then mlx5 recovery and an SMMU stall): recipe issue #24 is still open. This release does not change it.
- Four concurrent 1M-token prompts are rejected, but they are tokenized first, and that can raise head memory by more than 1 GiB in 2 s.
Licence
Apache-2.0, as upstream TensorFold. See LICENSE and NOTICE.
dsv41-1.0.0: DeepSeek-V4.1-Flash on two DGX Spark
The engine of the DeepSeek-V4.1-Flash recipe v1.0.0: DeepSeek-V4.1-Flash-1017 (EXL3, 2.9 bpw) on two DGX Spark, tensor-parallel (TP=2) over the QSFP link.
| Commit | 07aa02585f64cfb04c60a96de6554c0d4708ed46 on deepseek-v41-tp2 |
| Base | TensorFold 0.6.6 (ashhart/TensorFold) + the DeepSeek-V4.1 TP2 engine by bertholomus, with fixes by willjriley and Capicua25x |
| Image tag that the recipe builds | tensorfold-dsv41:07aa02585f64 |
| Hardware | 2x NVIDIA DGX Spark (GB10), ConnectX-7, RoCE v2, MTU 9000 |
Results (from the recipe, on this engine line)
- Decode: 57 tok/s on prose and 92 tok/s on code, 1 request. That is 2.1x and 2.3x the vLLM setup on the same pair.
- Prefill: 2,179 tok/s at 32K tokens (median of 3 cold runs), and about 2,000 to 2,200 tok/s up to 64K.
- 1,048,576-token context, 4 concurrent requests. Aggregate decode reaches 140 tok/s on code.
- 32/32 serving tests: tool calling, structured output, thinking levels, and 64K and 200K needle tests.
The saved runs and the method are in the recipe's runs/2026-10-17/ and runs/2026-10-18/.
Changes on top of the base
| Pull request | Change |
|---|---|
| #1 | tool_choice required and named on DeepSeek's DSML call format. Prompts byte-identical to DeepSeek's reference encoder. |
| #2 | Structured output (json_schema, json_object, regex, choice) on the speculative TP=2 decoder, also under --parallel. |
| #3 | Fault isolation: a host fault ends only its own stream. A broken lane ends the process with exit code 75, so a supervisor can restart it. |
| #4 | Faster long prefills (the Engram page drop). |
| #6 | Steady prefill with the prefix-cache spill on: spill files written with O_DIRECT, past the page cache. |
The recipe's docs/WHAT-I-CHANGED.md gives the reason and the proof for each change.
Use it
Do not install this engine by hand. The recipe builds the image from this commit and checks the setup:
git clone https://github.com/Elevatormusic/DeepSeek-V4.1-Flash-1017-EXL3-TensorFold-2x-DGX-SparkThen follow its README: docker/build.sh builds tensorfold-dsv41:07aa02585f64 on both nodes.
Known issues
- At netdev MTU 1500 the RDMA gather fails with
transport retry counter exceeded(recipe issue #15). Set MTU 9000 on the CX7 netdevs. The recipe's preflight checks this. The engine fix (#9) is in the next release. /v1/messagesreturns 400 whenbudget_tokens >= max_tokens(recipe issue #15). A fix is planned for the next release.
Licence
Apache-2.0, as upstream TensorFold. See LICENSE and NOTICE.