Repository navigation
serve: pair a checkpoint's known drafter when the local cache holds it - #3204
Merged
Merged
Conversation
3 of 4 tasks
The target-to-drafter table moves from benchmark_model.zig to drafter.zig, so serve and the benchmark read one table. With no --drafter, serve looks the target up there and resolves its drafter through the local hub resolver only, so nothing is downloaded, and logs one line naming it. A drafter it paired that does not open is dropped with one line and the target opens alone. --drafter none serves without one, and an explicit --drafter keeps its meaning. The benchmark's serve child gets --drafter none when the plan names no drafter, so it keeps the drafter it chose. Fixes #3173
ashhart
force-pushed
the
lead/serve-known-drafter
branch
from
November 16, 2026 13:38
4a6f3d5 to
f62fdc8
Compare
3 of 4 tasks
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.
servenow pairs a checkpoint's known drafter by itself when that drafter is already on disk. The target-to-drafter table (knownDrafter) moves fromserver/benchmark_model.zigtoserver/drafter.zig, so serve and the benchmark read one table. It holds one entry: Qwen3.8-27B (qwen3_5, hidden size 5120, 64 layers) withz-lab/Qwen3.8-27B-DFlash2.What changes
--drafter: serve looks the target up in the table and resolves the drafter through the same local resolver--drafteruses (a directory, or a revision already in the Hugging Face cache). Nothing is downloaded. A hit logs one line naming the drafter; a miss, a target with no entry, or a config that cannot be read changes nothing.--drafter noneserves without an external drafter. An explicit--drafteris unchanged, including its error when the drafter is not cached.--no-draftsand HIP builds (no DFlash2 there yet) skip the lookup.--drafter nonewhen the plan names no drafter.Why output is unchanged: the drafter only proposes tokens; the target checks every proposed token against its own sample, so a drafted reply is the same tokens as the same request without the drafter. Pairing changes what is loaded (memory, startup time, speed), not which tokens are accepted.
Tests (host, no GPU)
drafter_test.zig: the table (root and nestedtext_config, wrong shape or family); a local cache hit and miss; a missing or unreadable config; malformed refs and absent snapshots;none,--no-draftsand HIP; an explicit drafter winning over the table and an explicit missing drafter's error. A paired drafter that is refused or fails leaves the target open alone with one line; an explicit drafter's failure is passed through unchanged.benchmark_server_test.zigandbenchmark_run_test.zig: the serve child gets--drafter nonein every plan that names no drafter.zig build test-server-cpu test-cuda-host test-golden fuzz-cortheon check-native-cuda-host nativepass;zig fmt --checkand the lean check report nothing new.Still owed, and it decides whether this lands as the default: Qwen3.8-27B served on Metal and CUDA with the drafter picked from the cache against
--drafter none, sametoken_sha256at T=0 and sampled, and decode speed at 1 to 8 streams, load time and memory. If any cell is slower with the drafter than without, the default waits.Fixes #3173