mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5069] [Engine] Qwen3.6-35B-A3B: support --kv int8 / --kv-resident and a long-context decode path, as the Flash-Next path has #2357
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2357
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BumBee-dev on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5069
[Feature] Qwen3.6-35B-A3B: KV cache quantization and a long-context decode path, like the Flash-Next one
What
The
qwen35moe(Qwen3.6-35B-A3B) engine path has no KV cache quantization:--kv,--kv-residentand--cache-type-k/vare printed asignoring <flag> (not an option of this engine)and skipped (see #5023, #3303),so its KV is always fp32 at 44 KB per context token. On a 24 GB card this makes decode collapse as the context
grows, which makes the family unusable for RAG / agent workloads whose prompts are long by nature.
The
qwen4exp(Qwen3.8-Flash-Next) path does not have this problem: it takes--kv int8and--kv-resident, andits decode stays essentially flat out to 200K+.
Request: give
qwen35moethe same two capabilities — an int8 (and ideallyk8v4) KV cache,--kv-resident,and an attention path whose cost does not explode with context length (flash-attention-style, or the opt-in QSA
32-cell variant from #4567 wired into the CUDA build).
Why it matters (measured, not estimated)
Hardware: Tesla P40 24 GB, sm_61 (Pascal), driver 580.178.04, CUDA 12.6, engine 0.1.53 (
v0.2.7.1source build,
-DSTRATA_EXPERIMENTAL_SM60=ON -DCMAKE_CUDA_ARCHITECTURES=61), 1 slot, greedy requests with MTP on.Qwen3.6-35B-A3B, every routed expert resident in VRAM (
every routed expert in VRAM (8.89 GiB)), so expertstreaming is not a factor. Decode vs. context:
That is ≈ 3.2 µs per 1K context tokens, i.e. an effective KV read bandwidth of ~14 GB/s on a 346 GB/s card
(4 % of peak).
Same card, same boot, the Flash-Next path (
qwen4exp,--kv int8 --kv-resident 32768, IQ2_XS):Same-shape control from the repository's own Pascal benchmark (#4920, GTX 1070 Ti 8 GB, sm_61, Flash-Next IQ2_XS,
--kv int8): decode 31.8 / 31.0 / 30.6 at short / 4K / 16K — flat on Pascal too.And the same Qwen3.6 GGUF under llama.cpp (
-ctk q8_0 -ctv q8_0 --flash-attn on) on the same card:23.6 short → 17.5 at 43K (flat, lower absolute because of its constant per-token cost).
Decomposing the per-token cost at 43K context:
Two independent gaps, both on the qwen35moe path: 4× more bytes (fp32 vs int8) and ~10× lower read
efficiency (14 vs 139 GB/s).
Impact
prefill alone takes 122 s (431 tok/s).
effectively limited to short turns even though
--max-context 65536is accepted.--mtp 2= 8.3 tok/s versus--mtp 0= 8.7 tok/s. The context termdominates.
Suggested scope (smallest thing that helps)
--kv int8(and ideallyk8v4) plus--kv-resident Ninstrata::qwen35::run, the wayqwen4expdoes — including the refusal in #5023 instead of a silentignoring.#4567's
STRATA_QSA_ATTN_VARIANT=2(32-cell chunks) exists but its issue notes "CUDA was not built (no NVIDIAcard here)", so it is not in any CUDA engine; at minimum please compile and measure it for CUDA.
kv_bytes_per_tokenper family indocs/QWEN36.md(it is already insetup.py:11 * 2 * 256 * 2 * 4),so users can predict this before installing.
Reproduce
--kv int8on that command line producesstrata-q36: ignoring --kv int8 (not an option of this engine);--kv-residentand--cache-type-kbehave the same.Environment
unsloth/Qwen3.6-35B-A3B-MTP-GGUFUD-Q4_K_XL, and a 12.75 GB Q2_0 build with the MTP block baked in--mtp 2,--max-context 65536, greedy requestsHappy to run any build or measurement you want on this Pascal card and post the numbers back — including an
interleaved A/B of
--kv int8versus fp32 at 8K/32K/64K once the flag exists.