Skip to content

DeepSeek V4.1 remote prefill: leave the Mac only the last prompt token (TF_PREFILL_TAIL) - #99

Closed
BlivionIaG wants to merge 1 commit into
mixed/m3-breakerfrom
mixed/m4-tail
Closed

BlivionIaG wants to merge 1 commit into
mixed/m3-breakerfrom
mixed/m4-tail

Conversation

@BlivionIaG

@BlivionIaG BlivionIaG commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

What this changes

Before, the Mac runs the part of a prompt past the pair's last chunk boundary (96 to 461 tokens after the 512-token boundary) as a prefill pass. After, by default (TF_PREFILL_TAIL=1) the Mac asks the producer for the whole prompt but one token: the export stands one token short and the Mac runs that token as one decode-class step. TF_PREFILL_TAIL=0 keeps the chunk rule. The policy gains a tail count; no wire, manifest or producer change. Slice 9 of the chain in ashhart#3553.

Checks on this head

  • Head commit: be668ff745
  • Lean checker, python3 tools/zig/lean_check.py, on the parent head and on this head: 339 problems on the parent head, 339 on this head, 0 new (tools/zig/lean_new.py).
  • Tests run, with the command and pass, fail and skip counts:
    • zig build -Dfixed-cpu test-native --summary all: 173 pass, 0 fail, 3 skip.
    • zig build -Dfixed-cpu test-lane-api-host --summary all: 709 pass.
    • zig build -Dfixed-cpu test-dsv41-handoff --summary all: 94 pass†.
    • zig build -Dfixed-cpu test-dsv41-env-host test-environment-host --summary all: 14 and 23 pass†.
    • zig build -Dfixed-cpu test-dsv41-draft --summary all: 139 pass†.
    • zig build -Dfixed-cpu test-fabric-scratch --summary all: 60 pass†.
    • compile-dsv41-server: exit 0†.
    • zig fmt --check build.zig zig and git diff --check: clean. tools/pr_check.py --base <parent>: 0 errors, advisory warnings only (--pr, and a documentation example address 0.0.0.0 where listed).
  • CI: none on the fork.
  • Not run, and why: zig build test test-golden (full suite), dev-tools, test-exl3-gpu and test-deepseek-v41 on this head, any Metal run of this slice on its own. † counts were measured on the tree before a test-only fix to zig/src/native/qwen27_handoff_test.zig; those steps do not compile that file. The failing-before check for the new tests was not done.

Receipt

  • Main against branch: the whole stack's measurement is in the receipt of the first PR of this tier and in DeepSeek-V4.1 mixed mode: prefill on a GB10 pair, decode on Metal over the #2648 hand-off (gate and slices) ashhart/TensorFold#3553; this slice was not measured on its own.
  • Boxes it reaches: DeepSeek-V4.1 EXL3 on Metal with --prefill-from.
  • New switch? TF_PREFILL_TAIL: default 1, a whole count of prompt tokens the Mac prefills itself after the pull (0 cuts on the TF_PREFILL_CHUNK boundary); row in docs/environment.md, registered in platform/environment.zig (scope metal). It changes the default of --prefill-from for DeepSeek V4.1.
  • Exactness, speed, prompt speed: see the first PR of this tier (whole stack).
  • Licence of any new weights or drafter: n/a.

Checklist

  • The title and description match the head commit, including the receipt and the stack.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.

…n (TF_PREFILL_TAIL)

The Mac now asks the producer for the whole prompt: the export stands one token
short of it and the Mac runs that token as one decode-class step instead of a
96 to 461 token prefill pass after the 512-token boundary. The policy gains a
tail count (0 keeps the chunk rule); no wire, manifest or producer change.
@BlivionIaG

Copy link
Copy Markdown
Owner Author

Published upstream as a draft instead: ashhart#3597.

@BlivionIaG BlivionIaG closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant