feat(server): lossless CPU-isolated tool-call prediction - #620
Closed
davide221 wants to merge 5 commits into
Closed
Conversation
Contributor
Author
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.
Summary
Why
Agent latency is often dominated by the repeated sequence “decode a tool call,
wait for the tool, decode the next call.” This change overlaps the first tool
with target decoding and, for a previously validated recurring workflow,
collapses redundant model/tool synchronization barriers into one typed macro.
Design
predictor. The core interface is model-agnostic; Qwen3 is one native adapter.
is explicitly allowlisted and its measured execution lane passes admission.
disconnect, malformed prediction, or different target call cancels/discards
it; the caller runs the authoritative call normally.
The Lucebox default is
before-model: Qwen runs briefly on Strix, leaves thecompute window, and the CPU tool overlaps DeepSeek on R9700 + Strix. This avoids
shared-GPU predictor contention. An explicit
overlapmode remains availablefor deployments with independently qualified accelerator capacity.
Production result
Lucebox5, DeepSeek-V4-0731 + DS4/DSpark, Qwen3-0.6B Q8_0 on Strix, CPU tools on
14-15,30-31, paired randomized tasks with 10, 15, and 20 leaf calls:The 5.60x number applies to recognized, side-effect-free recurring
workflows. The isolated contribution from early tool launch is 1.70x; this
PR does not claim that arbitrary single tool calls become 5.60x faster.
Safety and compatibility
bounded by timeout and output-size limits
Verification
gfx1151;gfx1201)main: 399 / 399 passedmainproduction smoke: exact Qwen hit, 10 / 10 leaf calls/results, correct final output, DS4 active (90.6% acceptance)retrying with ARor tool-speculation errorsgit diff --checkReproduction commands and the compact evidence artifact are in
optimizations/ooo_spec_lucebox5_cpu/README.md.Review map
server/src/server/semantic_tool_hint.*server/src/server/native_semantic_tool_predictor.*server/src/common/qwen3_tool_predictor_ipc*server/src/server/http_server.*server/src/server/tool_speculation.*optimizations/ooo_spec_lucebox5_cpu/