Skip to content

feat(qwen36): complete concurrent serving implementation with speculation - #605

Draft
Graffioh wants to merge 14 commits into
Luce-Org:mainfrom
Graffioh:codex/qwen36-concurrent-features
Draft

feat(qwen36): complete concurrent serving implementation with speculation#605
Graffioh wants to merge 14 commits into
Luce-Org:mainfrom
Graffioh:codex/qwen36-concurrent-features

Conversation

@Graffioh

@Graffioh Graffioh commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Dependency

Depends on #595 and is intentionally stacked on its exact head commit
a90ffe45. The commits specific to this PR begin with
feat(qwen35): complete concurrent speculative serving.

Summary

Completes concurrent Qwen3.6-27B serving for the requested Strix Halo
configuration:

--target-device hip:0
--draft-device hip:0
--ddtree
--ddtree-budget 22
--draft-residency persistent
--prefill-compression auto
--prefill-drafter <path>
--kvflash auto
  • Adds per-slot draft KV/features and one packed multi-sequence DDTree
    verification graph, followed by accepted-path replay into durable recurrent
    and paged-KV state.
  • Makes local PFlash preparation scheduler-safe: prompts are prepared once
    before admission, persistent target/draft residency is enforced, and
    effective prompt tokens drive capacity/timing while API billing stays raw.
  • Adds bounded concurrent KVFlash residency over the shared paged pool,
    including per-sequence logical mappings, pinned host backing, fair eviction,
    pending-write protection, cross-slot block-table refresh, and
    drafter-scored/LRU reselection.
  • Extends the decode contract for speculative token bursts with ordered
    EOS/stop/cap handling and per-request DDTree/PFlash/KVFlash telemetry.
  • Ports and extends bench(concurrency): add ragged paired benchmark #596 into a fail-closed feature matrix that proves each
    requested feature actually activated.
  • Adds a cohort-yield guard: if the supplied draft produces fewer than six
    emitted tokens per request on its first packed-tree sample, subsequent steps
    use the existing AR path.

Measurements

Measured on AMD Ryzen AI MAX+ 395 / Radeon 8060S (gfx1151), 128 GiB UMA,
ROCm 7.2.4. Build: Release HIP, DFLASH27B_HIP_SM80_EQUIV=ON. Every case
used a fresh server, an 8-token same-concurrency warmup, temperature 0, seed 1,
EOS ignored, and exactly 64 completion tokens per request. All reported rows
passed exact token accounting and request-correlated activation proof.

Full methodology, hashes, commands, prompt ranges, and caveats are checked in
at
STRIX_HALO_RESULTS.md.

Paired AR / adaptive DDTree

Medians over three fresh-process repeats:

C AR output-window tok/s DDTree output-window tok/s DDTree goodput vs AR Accepted/step
1 12.57 11.85 -4.4% 1.00
4 36.21 33.61 -4.8% 3.08
8 65.93 56.32 -6.7% 2.79
16 58.79 54.63 -8.1% 2.00

The supplied draft was below the continuation floor on this prompt cohort, so
the adaptive guard sampled one real DDTree step, emitted it normally, and then
used AR. This bounds weak-draft overhead rather than repeatedly paying for an
unproductive verify-and-replay path.

Complete screenshot configuration

One fresh-process activation/screening repeat per concurrency level. PFlash
auto retained about 4.9% of each 38K–45K-token prompt. KVFlash startup
telemetry confirmed an 8,192-token physical resident pool.

C Output-window tok/s Effective prompt range Max TTFT s KV page in/out
1 12.39 2,021 19.324 0/0
4 31.61 1,870–2,235 77.495 1/18
8 52.60 1,869–2,237 153.782 245/792
16 18.73 1,867–2,238 307.360 293/1,880

All C1/C4/C8/C16 rows proved DDTree, PFlash, and KVFlash active. Throughput
scaled through C8, then dropped at C16 when roughly 32K effective prompt tokens
shared the 8K resident pool.

Ablations:

  • PFlash-only C4: 35.54 output-window tok/s, 74.261s max TTFT, 166,016 raw
    prompt tokens compressed to 8,179.
  • KVFlash-only C4 pressure: 8.56 output-window tok/s, 197.859s max TTFT,
    13,474–20,203-token histories, 3,714 page-outs.

These long-context product/ablation rows are one-repeat engineering screens,
not the documented five-repeat publication matrix.

Validation

  • Optimized Release HIP/gfx1151 dflash_server build
  • Server unit: 353/353
  • Feature gate: 180 assertions
  • Sequence slot manager: 198 checks
  • Sequence batch plan: 67 checks
  • Sequence engine contract: 15 checks
  • Recurrent snapshot: passed
  • Paged KV pool: 15/15
  • Concurrent KV residency: 10/10
  • Transfer layout: 3/3
  • Packed DDTree path: passed
  • HIP packed-tree attention: F16/F16, Q4/Q8, and Q8/Q4 cases passed
  • Benchmark tooling: 34/34
  • Final benchmarks: 211/211 requests, 13,504/13,504 completion tokens,
    zero failed cases or invalid proofs
  • Independent policy and measurement audits: no P0/P1 issue or numeric
    discrepancy
  • git diff --check

Safety and compatibility

  • Concurrent paged DDTree requires one local target/draft device.
  • PFlash concurrency requires --draft-residency persistent; snapshot-cache
    configurations remain rejected.
  • KV pages cannot be evicted until the target graph completes its writes.
  • Scorer failures fall back to LRU; residency/transfer failures stay explicit.
  • Unsupported single-slot, remote-draft, mixed-device, and layer-split
    combinations remain gated.

Known limitations

  • A transient NoEvictableBlock during a selected prefill currently fails
    that step instead of deferring it. The requested auto-8192/C16 configuration
    completed without hitting this exceptional path.
  • Greedy output hashes varied across fresh concurrent repeats at C4+ in both
    the AR control and DDTree; C1 was byte-stable. The benchmark proves exact
    token accounting and feature execution, not bitwise concurrent text
    reproducibility.
  • With the controlled 8K KV resident cap, the full C16 row shows a real paging
    throughput cliff; C8 was the peak in this screen.

Review in cubic

AMD recipe alignment and single-request isolation

Commit 7b0debde makes the AMD recipe explicit in the concurrent runner: the Q8_0 Qwen3.6 drafter, DFLASH27B_DRAFT_SWA=2048, DFLASH27B_PREFILL_UBATCH=512, DDTree budget 22, target/draft hip:0, persistent residency, and the exact screenshot flags are recorded per case. A producer/consumer synchronization barrier was also added between the local draft graph and target projection.

The canonical concurrent C1 run proved DDTree execution (67 steps, 181 accepted tokens) and the startup marker reports mode=packed-verify-replay. This is intentional: multi-slot serving uses the safe accepted-path replay today; standalone --fast-rollback has the single-sequence rollback implementation. The flag is preserved for command-line parity and metadata, but the marker prevents confusing it with true concurrent fast rollback.

A fresh one-request isolation run (466-token prompt, 256-token completion) measured:

Setup Request decode tok/s Goodput tok/s TTFT
Dense AR, no paged/concurrency 12.03 11.13 1.79 s
Paged AR, C1 12.10 11.25 1.68 s
Dense Q8 DFlash + SWA=2048 16.22 14.48 1.95 s
Dense forced PFlash 12.05 10.45 3.32 s
Dense KVFlash (no page pressure) 11.05 10.28 1.82 s

This isolates the implementation effect: paged AR itself is neutral, while PFlash/KVFlash add overhead on a short prompt and are intended for long-context/paging workloads. The concurrent packed verify/replay DDTree run was 11.48 request decode tok/s on the same short C1 cohort, so it is not yet a replacement for the standalone blog decode number.

@Graffioh Graffioh changed the title feat(qwen36): complete concurrent speculative serving feat(qwen36): complete concurrent serving implementation with speculative Aug 13, 2026
@Graffioh Graffioh changed the title feat(qwen36): complete concurrent serving implementation with speculative feat(qwen36): complete concurrent serving implementation with speculation Aug 13, 2026
@Graffioh
Graffioh force-pushed the codex/qwen36-concurrent-features branch from 7b0debd to 352b308 Compare August 14, 2026 07:12
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