feat(qwen36): complete concurrent serving implementation with speculation - #605
feat(qwen36): complete concurrent serving implementation with speculation#605Graffioh wants to merge 12 commits into
Conversation
7b0debd to
352b308
Compare
There was a problem hiding this comment.
All reported issues were addressed across 109 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
608c38f to
b54b7fc
Compare
|
@cubic-dev-ai review this PR |
@Graffioh I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 110 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
b54b7fc to
72adf3b
Compare
There was a problem hiding this comment.
All reported issues were addressed across 110 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
72adf3b to
6ad8d30
Compare
6ad8d30 to
69fba37
Compare
There was a problem hiding this comment.
6 issues found across 110 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="harness/benchmarks/concurrency/generate_feature_prompts.py">
<violation number="1" location="harness/benchmarks/concurrency/generate_feature_prompts.py:17">
P2: `--profile tiny` is accepted here, but the feature-matrix runner has no `tiny` workload limit and fails after generating the prompts. Restrict this map to runner-supported base profiles or add a `tiny` workload case before exposing it.</violation>
</file>
<file name="server/src/qwen35/concurrency/qwen35_slot_manager.h">
<violation number="1" location="server/src/qwen35/concurrency/qwen35_slot_manager.h:88">
P2: When `max_ctx` is negative, admission can succeed but the slot cannot decode: the prompt check converts `max_ctx` to an unsigned size, while decode rejects the resulting slot. Validate `max_ctx > 0` at construction (or reject it before any unsigned conversion) so invalid configuration cannot create an admitted request that can never progress.</violation>
</file>
<file name="server/src/qwen35/qwen35_backend.cpp">
<violation number="1" location="server/src/qwen35/qwen35_backend.cpp:112">
P2: Initializing one concurrent Qwen backend permanently changes the process-wide rocBLAS setting for every later backend. Keep this default scoped to the intended backend or configure it outside the server process instead of mutating the global environment here.</violation>
</file>
<file name="server/src/common/paged_attention_config.h">
<violation number="1" location="server/src/common/paged_attention_config.h:51">
P2: Negative cache or reserve fields increase `usable` instead of reducing capacity, which can over-allocate the physical pool. Validate both fields as nonnegative and perform bounded subtraction before sizing tokens.</violation>
<violation number="2" location="server/src/common/paged_attention_config.h:57">
P2: When a caller supplies an oversized `max_ctx`, `paged_token_capacity(max_ctx)` overflows its signed `int` arithmetic before this cast. Reject values above `INT32_MAX - PAGED_BLOCK_SIZE + 1` before calculating the logical cap.</violation>
</file>
<file name="server/src/server/scheduler.cpp">
<violation number="1" location="server/src/server/scheduler.cpp:833">
P2: During shutdown, pending final responses are discarded as soon as the first drain pass returns. Continue servicing drains until they flush or reach their existing deadline before calling `finish_job()` on them.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
69fba37 to
b92a8ce
Compare
Summary
Depends on #595 at
a90ffe45. This PR completes concurrent Qwen3.6-27B serving for the requested Strix Halo configuration:Concurrent speculation uses packed verify-and-replay; standalone fast rollback remains a single-sequence path.
Strix Halo measurements
AMD Ryzen AI MAX+ 395 / Radeon 8060S (
gfx1151), ROCm 7.2.4, Release HIP. Full commands, hashes, prompt ranges, and caveats are in STRIX_HALO_RESULTS.md and #596.Recommended routing
Blog-aligned setup: Qwen3.6-27B Q4_K_M target, Q8_0 draft, SWA 2048, DDTree budget 22, fast rollback flag, paged attention, and Q4_0 paged KV.
Default policy: use fixed blog-aligned DDTree for C=1–3; use AR for C>3 and mixed or unknown traffic. Math500's small C=4 DDTree win is a workload-specific exception.
The earlier adaptive-DDTree screen used a weak-yield prompt cohort and measures fallback overhead; it does not contradict the canonical workload crossover above.
AR prefill tuning at C=16
Three paired observations per band, 16/16 successful requests per case, 64 output tokens. The selected policy keeps packed width at 8 and raises the mixed prefill budget from 2,048 to 4,096 only while an admitted prompt has at least 768 tokens.
Widths 12/16, an 8K idle budget, and a 1,024-token allocation quantum did not survive repeated testing. Short prompts retain the 2K mixed budget.
Complete DDTree + PFlash + KVFlash screen
One activation repeat per level, 64 output tokens, 38K–45K raw prompts compressed to roughly 4.9%, and an 8,192-token resident KV pool:
All rows proved DDTree, PFlash, and KVFlash active. C8 was the peak; C16 became paging-bound.
Validation
Constraints
NoEvictableBlockduring selected prefill still fails instead of deferring.