Repository navigation
Conversation
DeepSeek-V4.x releases ship encoding.py, not a Jinja template. A checkpoint that carries one anyway (flash17 keeps September's file for older loaders) made every chat prompt render through that stale file instead of the native encoder the published engine uses, changing prompt ids, effort defaults and tool rules. The native encoder now renders DeepSeek-V4.x unless --chat-template names an override. The native path also covers what the Jinja path did: image parts become the image token when the server serves images (still refused otherwise), and a request's response_format schema is shown as the encoder's "## Response Format" block, as the published engine does by default (TF_DSV41_SCHEMA_PROMPT=0 turns it off). /tokenize renders the same way. Host tests run the committed encoding.py goldens, now including the response_format cases, through HfText; cover the ignored checkpoint Jinja, the override, served and refused images, json_object, string and object schemas and the knob. (cherry picked from commit c7d0dca)
…text The native encoder escaped every <|deepseek_image|> in message content as request text, including the marker its image hook writes, so images.zig saw no placeholder and refused every image request under TF_DSV41_IMAGES=native. Request text is now escaped as it is read; a marker left in a message is the hook's and renders as template text outside the request spans. (cherry picked from commit e2308a9)
|
Thanks @jayleaton, the goldens are the check #1208 left open. Since this changes every DeepSeek-V4.x prompt that used the checkpoint's Jinja, could you run the two unticked items on current main and post the counts?
Also: this ignores a customized DeepSeek checkpoint's own Jinja unless |
A DeepSeek-V4.x checkpoint is rendered by its own encoder unless --chat-template is given, so a customized checkpoint's Jinja goes unused. The start-up log now says which renderer was chosen, and when a native DeepSeek checkpoint's own chat template is left unused.
|
Thanks @ashhart. Here's the host part; the TP=2 part follows below. 1. The new tests against main's renderer. I put this PR's
The other 22 tests pass on both. The totals differ because the PR is based on Start-up log. It didn't say. Nothing logged which renderer was chosen, so an operator couldn't tell that a customized checkpoint's Jinja was being skipped. I pushed When the checkpoint ships no Jinja, the line is Gates at
2. Drafted equals |
|
Thanks @jayleaton. That answers it: the four tests fail on main's renderer and pass here, and the new |
|
Thanks @ashhart, and @jayleaton. Agreed: #1722 takes this PR's form. When this lands, I'll rebase #1722 onto it and drop #1722's own image path in the renderer: the |
|
Hi @jayleaton, a quick status from our side: this one is waiting on us, not you. We still owe the TP=2 run we described |
What this changes
#1208 made a DeepSeek-V4.1 checkpoint without a Jinja template render through the native encoder (
serve/template.zig). The public Flash-1017 EXL3 pack still carries September'schat_template.jinjafor older loaders, so main renders every chat prompt through that stale file and not through the encoder that matches the release'sencoding.py. Prompt ids, effort defaults and tool rules all differ.--chat-templatenames an override. This is a deliberate DeepSeek-wide contract: a customized DeepSeek checkpoint's own Jinja is ignored unless the operator passes--chat-template. Other families keep checkpoint-template loading, and their tests are unchanged.response_formatschema appears as the encoder's## Response Formatblock, as the release does.TF_DSV41_SCHEMA_PROMPT=0turns that off./tokenizeand the cache-prefix probe render the same way.<|deepseek_image|>is still escaped, and only the hook's marker renders as template text outside the request spans.Issue: follows #1208, whose remaining check compared the encoder against the 1017
encoding.py; the goldens here are that check. Stacked on: nothing (based on main3f0a715c4; the 51 later main commits, to22f3d289a, touch none of its files).Receipt
f61e23911740on main3f0a715c4; Zig 0.17.0; host checks on a Linux aarch64 DGX Spark (GB10, CUDA 13.0). Real-pack boot on two GB10s, TP=2 over RoCE, checkpointjayleaton/DeepSeek-V4.1-Flash-1017-EXL3-2.8bpwrevision859396591c34,TF_EXPERIMENTAL=deepseek.encoding.pygoldens throughHfText, including theresponse_formatcases. Known gap: the OpenAI message normalization joins a text-parts array before the encoder sees it, whereasencoding.pyputs\n\nbetween parts. That predates this PR and is not changed here.encoding.pygoldens throughHfText; ignored checkpoint Jinja; the--chat-templateoverride; served and refused images;json_object, string and object schemas; the knob; and a provenance test that tells a typed marker from the hook's marker. Updated upstream tests are the ones that pinned "checkpoint Jinja wins" for DeepSeek.83ba53298924: passed. Both ranks reached readiness; the recipe smoke, the canary and a strict tool call passed;MissingTritonVariant0 in both rank logs; 2048 greedy tokens in 51.1 s withtoken_sha2567538b20557b1…, the same as the downstream build of this series.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Not measured for this change alone.)SUMMARYline is in the receipt. (No kernel changes.)