Repository navigation
fix(server): DSML calls read from their own tags in the native server (the native side of #20) - #25
Merged
bertholomus merged 1 commit intoOct 20, 2026
Conversation
…<tool_call> text (the native side of bertholomus#20) The native parser collected the <tool_call> forms and DeepSeek-V4.1's DSML blocks independently and kept whichever started first. A <tool_call> in the prose before a block, with a </tool_call> in one of its arguments (a file being written), swallowed the start of the block: the call was dropped and reached the client as text. A call to a tool the request did not offer was rewritten as <tool_call>{json}</tool_call>, call syntax the model never wrote. And the call streamer read the whole answer, so a Qwen-style <tool_call><function=NAME> quoted in a DSML argument streamed as a real call to NAME when that tool was offered, and the reply's DSML calls were then never sent (tool_calls_streamed). DSML blocks are now found first and the other forms only in the text around them; every invoke is a call, under the model's own name when the request did not offer it (with one call a reply, such an invoke drops out as before); the streamer is fed beforeDsml(answer), the text before the first DSML block. As 222a9c0 did for the Python server. Tests: the unoffered-tool case now expects a call; a new test covers a <tool_call> in the prose, a </tool_call> and a whole call in an argument, and calls in the reply's order. Both fail before this change.
Owner
This was referenced Oct 19, 2026
Owner
bertholomus
added a commit
that referenced
this pull request
Oct 24, 2026
…s it A rank that stopped (an error, a crash, a kill) left the others waiting inside their next exchange for good, their GPUs spinning on it: the signature of tp2 #25's second hang. Each rank now watches its links (link.Watch: a poll for the peer shutting its end, which frames never set): when a peer rank goes and this process has not ended within 5 s, it prints which rank went and exits 1. The server's rank 0 watches its followers and the lane followers watch rank 0; rank 0's done, a follower reading it and Model.close end the watch, so a clean shutdown is as before. A follower that stops on an error also says why on stderr (its stdout line stays for the gates). Tests: a closed link is named and a frame on it is no close; a stopped watch lets its links close quietly; the grace lets this process end first. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
bertholomus
added a commit
that referenced
this pull request
Oct 24, 2026
…s too A follower refuses a primitive expecting rank 0 to refuse the same one at the same step. A GPU fault breaks that, as it is one rank's alone: in tp2 #25's second hang rank 1 hit CUDA_ERROR_ILLEGAL_ADDRESS at a launch, printed follow_refused CudaFailed and stayed up, while rank 0 ran on into its next exchange and waited there for good; rank 1's context ran nothing more. Now a refusal on a CUDA failure asks the context (after a fault a stream's query returns it for good). A failed context ends the follower at once, without the orderly close (NCCL's teardown can wait on a peer): its link closes, and the stopped-rank watch stops rank 0 with a line that names this rank. A failed call the context survived, and every other refusal, are as before. Tests: a CUDA failure that left the context failed ends the follower; one the context survived and other refusals do not, and others never ask. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
bertholomus
added a commit
that referenced
this pull request
Oct 24, 2026
….7.1) The README's fork note: v0.7.0's nine changes on the four-node branch's v0.3.1, then v0.7.1's seven (the shared DSML reader and the streamed-prose fix with #25's tests, TF_DS_PROMPT_ALIAS, the stopped-rank watch, the GPU-context stop, #14 and the test addresses), the merge of the four-node branch's v0.3.2 and the fix that keeps cache_salt on compaction notes; the two-node recipe's pool of 2,097,152 positions and its v0.7.1. NOTICE names v0.3.2's cache_salt and the DSML reader with their tests among the new files and compact_test.zig among the changed ones, and ATTRIBUTION.md's #25 row names the two commits that carry #25's tests. ATTRIBUTION.md adds two reports, @den13501's (two-node recipe issue #15: the kit rebuild's mapping error, which #14 fixes) and @plyldavid-maker's (issue #25: the ranks that waited on each other), and says what the export changed in v0.7.1's messages. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
bertholomus
added a commit
that referenced
this pull request
Nov 2, 2026
…s it A rank that stopped (an error, a crash, a kill) left the others waiting inside their next exchange for good, their GPUs spinning on it: the signature of tp2 #25's second hang. Each rank now watches its links (link.Watch: a poll for the peer shutting its end, which frames never set): when a peer rank goes and this process has not ended within 5 s, it prints which rank went and exits 1. The server's rank 0 watches its followers and the lane followers watch rank 0; rank 0's done, a follower reading it and Model.close end the watch, so a clean shutdown is as before. A follower that stops on an error also says why on stderr (its stdout line stays for the gates). Tests: a closed link is named and a frame on it is no close; a stopped watch lets its links close quietly; the grace lets this process end first. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
The native server's side of #20 (
222a9c0bondeepseek-v41-tp2).<tool_call>forms only in the text around them. Before, a<tool_call>in the prose with a</tool_call>in an argument dropped the block's calls.<tool_call>{json}</tool_call>text.tool_calls_streamedthen kept the reply's own DSML calls from being sent.Reported in bertholomus/deepseek-v4.1-tensorfold-tp2-2xgb10#29. This is unrelated to the malformed markup in #26 there.
Receipt
deepseek-v41-zigat9f82099plus this change. Two DGX Sparks (GB10, 128 GB each), TP=2 over RoCE with both rails,nvcr.io/nvidia/pytorch:26.07-py3. Checkpoint easthambuilds/DeepSeek-V4.1-Flash-1017-EXL3-2.9bpw at2913ea75. Served with--context 1048576 --parallel 4, drafts and CUDA graphs on.tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: not run. Instead, 12 greedy chat prompts (temperature 0, 128 tokens, drafts on) give byte-identical text to the unpatched9f82099image, with this change and the two companion PRs built together.tools/bench_openai.py: not run. The recipe'skit_bench.py decode --set agives prose 57.0 → 56.9 and structured 104.9 → 104.3 tok/s, with the three PRs together.tools/prefill_cold.py: not run. No prompt-pass code changes.zig build test(CUDA host tests, aarch64 Linux) 219 pass, 0 fail, 0 skip, with the three PRs together.9f82099(2 failed) and pass with the change.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (not run as such; greedy replies equal the unpatched engine's)