Support for QWEN3.8-Flash-Next
125B params plus 51B n-gram embeddings, only 6B active per token. Looks like an ideal model for local deployment and a serious contender to deepseek-v4-flash.
https://www.modelscope.ai/collections/Qwen/Qwen38-Flash-Next
yes please
+1
ive got qwen4exp running with its native multi-token prediction on Apple Silicon (MLX-side, under MTPLX). The interesting part is draft rejection: the DeltaNet layers carry a running recurrent state rather than a KV cache, so a rejected draft can't be truncated away: it's snapshot-and-restore. With MTP on, output is token-for-token identical to plain decoding testing
mentioning it here because i'd like to take a run at this model in ds4 next. The MLX implementation gives us a known good reference to diff against; not something to translate. From reading the ds4 impl, net new code needed is prob: the DeltaNet chunked-scan and per-step kernels, the sparse-attention block indexer, the n-gram embedding lookup, and teaching the --mtp-draft path to snapshot/restore recurrent state where it currently rewinds KV. this would be hand written against existing conventions, no new dependencies. If there's prior work in flight i should defer to, or opinions on where this should live, happy to coord before opening anything.
who am i and why do i care? just an unemployed replaced-by ai eng that likes ds4-agent :)
FWIW there's already active work in progress: @Baekpica has a fork (github.com/Baekpica/ds4, branch feature/qwen38-ssd-ple-handoff, updated Aug 27) with a working proof-of-concept targeting CUDA/DGX Spark (GB10) — SSD-offload for the ~51B N-gram embedding table, 262K context confirmed working. CUDA kernels and the PLE runtime path are still being implemented/optimized per their own notes. Also discussed on the NVIDIA DGX Spark dev forum: forums.developer.nvidia.com/t/qwen3-8-flash-next-ds4-support/381417. Matching GGUF: huggingface.co/Baekpica/Qwen3.8-Flash-Next-Mixed-Quant-SSD-PLE-GGUF. Might be worth linking up rather than duplicating effort.
llama.cpp support just got merged too: https://github.com/ggml-org/llama.cpp/pull/27742
@francosax Thanks for the mention — really appreciate it.
The implementation has moved forward a bit since then: prefill performance is now around 400 tok/s on a single DGX Spark, and I’m currently working on adding MTP and partial-prefix reuse as well.
Still actively profiling and optimizing the PLE/runtime path, so there should be more to come. Thanks again for pointing people to the work.
mine is metal only, 1M context window (yarn) with focus on full MTP
I'm using it right now locally as my daily via mtplx
you can check it in the pr https://github.com/youssofal/MTPLX/pull/380
On Thu, Aug 27, 2026, 16:18 Sunghoon Baek @.***> wrote:
Baekpica left a comment (antirez/ds4#867) https://github.com/antirez/ds4/issues/867#issuecomment-5446357212
@francosax https://github.com/francosax Thanks for the mention — really appreciate it.
The implementation has moved forward a bit since then: prefill performance is now around 400 tok/s on a single DGX Spark, and I’m currently working on adding MTP and partial-prefix reuse as well.
Still actively profiling and optimizing the PLE/runtime path, so there should be more to come. Thanks again for pointing people to the work.
— Reply to this email directly, view it on GitHub https://github.com/antirez/ds4/issues/867?email_source=notifications&email_token=AAGEMEG72IGKE6SLYO5KI5T5MC6S3A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNBUGYZTKNZSGEZKM4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5446357212, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGEMEEBF2WFAPQQI4SYRFT5MC6S3AVCNFSNUABGKJSXA33TNF2G64TZHMYTEMZRGE2DQNRSGY5US43TOVSTWNJSGU3TKMRTGQ4TNILWAI . You are receiving this because you commented.Message ID: @.***>
Don't forget us on Strix halo!
@Baekpica congrats on getting embedded MTP working — genuinely useful data point, since no MTP oracle exists anywhere else right now (llama.cpp's #27742, now merged, still doesn't implement it).
I'm working on porting qwen4_exp to ds4 targeting AMD Strix Halo (gfx1151, ROCm) — different backend/hardware from your CUDA/DGX Spark work, so hopefully complementary rather than overlapping. Following your progress here rather than duplicating it.
A couple of things I'd love to compare notes on if you have time:
- Your MTP draft-rejection handling for GDN's recurrent state (snapshot/restore vs KV rollback) — matches a design question I'm working through on the ROCm side.
- Your SSD-PLE approach for the N-gram embedding table — I'm looking at DS4's existing
ds4_ssd.c(SSD-streaming for routed MoE experts) as the closest existing analog to extend for the same purpose.
No urgency — happy to share notes on the arch-mapping side (Gated Residual, QSA indexer reuse) if useful. Feel free to reach out any time.
@francosax Thanks — and yes, I see the ROCm/gfx1151 work as complementary rather than overlapping. The different memory hierarchy and kernel behavior should make the comparison especially useful.
My implementation requires MTP-on to preserve the MTP-off target token stream under forced accept/reject cases, including byte-exact recurrent-state restoration.
For draft rejection, ds4 uses a hybrid rollback rather than treating GDN like an append-only KV cache:
- Before the two-row target verification [committed_token, draft], we make a device-to-device snapshot of the PLE convolution window and every target GDN layer’s convolution and recurrent tensors.
- The PLE token-hash frontier is saved separately on the host.
- QSA storage is append-only, so its payload is not copied; we restore only each QSA state length to the pre-verification position.
- On rejection, we restore those recurrent tensors, the PLE hash state and graph length, then replay only the committed token.
- On acceptance, we retain the two-row target state and catch the embedded MTP layer up with the accepted draft.
The MTP layer itself owns separate QSA history and pending hyper-connection state. If the rollback allocation or restore fails under the memory governor, MTP is disabled and decoding falls back to the plain target path.
The relevant functions on the forked branch (dfm) (https://github.com/Baekpica/ds4/tree/dfm) are:
- qwen4exp_recurrent_state_copy
- qwen4exp_graph_mtp_backup_target
- qwen4exp_graph_mtp_restore_target
- ds4_session_eval_qwen_mtp
The main implementation/hardening commits are:
- 6391d33 (https://github.com/Baekpica/ds4/commit/6391d33)
- c8bc5c9 (https://github.com/Baekpica/ds4/commit/c8bc5c9)
- 4226b60 (https://github.com/Baekpica/ds4/commit/4226b60)
For SSD-PLE, ds4_ssd.c is a useful lifecycle and I/O reference, but I would not extend the routed-expert streamer directly. PLE has a different access pattern, so the current implementation is split into backend-neutral ds4_ple.c/.h (https://github.com/Baekpica/ds4/blob/dfm/ds4_ple.c) and a thin CUDA adapter in cuda/qwen38_ple.cu (https://github.com/Baekpica/ds4/blob/dfm/cuda/qwen38_ple.cu).
The CPU side derives the exact 16 bigram/trigram row IDs per token, then prefetches the required 4 KiB pages through a bounded four-way cache and worker pool. It prefers O_DIRECT; the buffered fallback applies POSIX_FADV_DONTNEED. The bounded cache is registered as mapped pinned memory, and the CUDA kernel gathers the 320-byte BF16 rows through mapped pointers while cache-slot leases remain held until a stream callback releases them. Reads are submitted before token embedding/layer 0 and consumed when the PLE layer runs.
For ROCm, To keep ds4_ple.c unchanged and replace only the mapped-cache/gather adapter would be helpful. It would be worth A/B testing mapped host access against copying the compact gathered rows into device-visible memory.
I hope the ds4 engine community becomes even more active through the exchange of diverse opinions. Thank you again for mentioning me.
I've recently added the image input features on a recent commit and kept optimizing the performance. (It's still a cold workload, O(P^2), etc..)
-- On 2026-08-29, Baekpica/ds4@cc771c0 added native still-image input for the Qwen path. Chat Completions image_url, Responses input_image, and Anthropic base64 image blocks share one ordered request representation. The runtime applies the pinned Qwen3VLProcessor/Qwen2VLImageProcessorFast geometry, executes the GGUF's embedded 27-layer vision tower, replaces image-pad rows with projected image features, and carries the reference three-axis M-RoPE positions through prefill and decode.
The interface accepts base64 PNG/JPEG data URIs only: at most four images, 10 MiB decoded per image, and 20 MiB decoded per request. Network/file URLs, video, and other image formats are rejected. Image requests are deliberately cold because token-only cache keys cannot identify pixel content; text-only exact, partial-prefix, and disk-KV reuse remain enabled.
The Q5 artifact passed Chat Completions, Responses, and Anthropic Messages on the guarded DGX Spark server configured for a 262,144-token context, two Qwen banks, and 8,192-token prefill chunks. A synchronized Responses/Anthropic pair completed as served=2 fallback=0. An 8,243-token Chat request placed its 64 projected image rows across the 8,192-token chunk boundary and completed at 489.4 prefill tok/s, 17.232 s TTFT, and 22.5 decode tok/s. A later text-only repeat exercised a partial fork after both banks had served images. The post-gate worker reported zero request, continuous-batch, census, or governor failures under the external 109/115 GiB reclaim/hard guard.
| Source screenshot | Served result |
|---|---|
@Baekpica this is incredibly generous detail, thank you. The hybrid rollback approach (snapshotting the PLE conv window + GDN recurrent tensors, restoring QSA by length since it's append-only, and the graceful fallback to plain target decoding when the memory governor can't afford the rollback buffer) answers exactly the question I had — really appreciate the function/commit pointers too.
And noted on ds4_ple.c vs ds4_ssd.c — good call, I'll plan the ROCm N-gram embedding path as a separate adapter over a shared PLE core rather than trying to bend the existing MoE expert streamer to fit. Will likely have more questions once I'm actually at that stage of the port, but this saves me from chasing the wrong abstraction first.
Congrats on the vision input work too — that's moving fast. Good luck with the O(P²) cold-workload optimization.
I’ve started looking into this and am working on an initial qwen4exp port for ds4. I’m starting conservatively with model detection, split-GGUF loading and tensor/metadata validation via --inspect, using llama.cpp’s working implementation as the correctness reference. If that goes well, the plan is to move on to the Metal graph and SSD expert streaming. Happy to coordinate if anyone else is already working on this.
A Qwen follow-up from my side:
-
Rust-host continuation: the work now continues in Baekpica/ds4-dfm-rs, following the antirez/ds4 → Entrpi/ds4-on-spark → Baekpica/ds4 lineage. As supported model families became more numerous and less uniform, the goal was not abstraction for its own sake: the Rust host provides a small, explicit ownership boundary for HTTP, admission, scheduling, model/session/KV lifecycle, and memory policy, so new families can be integrated effectively with minimal abstraction while the hardware-specific CUDA/MMQ kernels remain native.
-
Uncensored release: I also released Qwen3.8-Flash-Next-Uncensored-Mixed-Quant-SSD-PLE-GGUF, derived directly from orcarouter/Qwen3.8-Flash-Next-Uncensored with the same
MQ-Q5-SSD-PLE-BF16recipe as the main Qwen release. It is not a requantization of another GGUF. -
Current DGX Spark measurements: on
ds4-dfm-rs@f879bf5, the main Q5+Sidecar model reached 606.4 tok/s median cold prefill across three fresh-worker 8,025-prompt-token runs (607.4 / 606.4 / 605.4 tok/s, zero cached tokens) and 28.3 tok/s maximum API-timing-derived aggregate decode in a short MTP-friendly two-bank run. The uncensored model reached 603.4 tok/s median cold prefill (607.3 / 601.3 / 603.4 tok/s, zero cached tokens) and 29.4 tok/s maximum API-timing-derived aggregate decode under the same short two-bank workload.
Both runs used one NVIDIA DGX Spark, 196,608 configured context, two Qwen banks, 8,192-token prefill chunks, a 512 MiB SSD-PLE cache, a 32 GiB disk-KV budget, and --mtp-draft 2. The decode figures come from concurrent 140- and 192-token completions and are aggregate across both banks, not single-stream throughput; they remain content-sensitive serving measurements.
Update: while this Draft was being prepared, upstream main added complete
CUDA support for Qwen3.8 starting with df6eedd and the subsequent optimization
commits. PR #1063 is therefore superseded and will be closed. My previous
comment described the state before those commits reached main. No review or
action is needed from @Baekpica.
Hi everyone, I've optimized Qwen and am wondering if anyone would like to try it out. P.S. I've also added SSD streaming support. PR #1056
Status update on my earlier note here (Aug 28) about porting qwen4exp to ROCm/Strix Halo: I'm not doing a separate port. That work already exists in #1070 by @kyuz0 (Q2/Q4, vision, tools, MTP, checkpoints on gfx1151), on top of the Metal/CUDA support that landed in main with #991. I've removed the placeholder branch from my fork to avoid confusion.
What I'm doing instead is validating #1070 on a different toolchain: ROCm 10.1 (HIP 7.16, AMD clang 24) on a Minisforum MS-S1 Max (Ryzen AI Max+ 395, 128 GB). So far:
- #1070 does not build on ROCm 10.1 as-is (host-side
rsqrtf, see #988 / #1019). With the two commits from #1210 on top, it builds warning-free. - Model-free checks pass:
test-qwen4-rocm,test-qwen4-rocm-production(16/16, Q2/Q4, 33 to 8193 rows) andtest-mxfp4-rocm.
Model-backed results (official continuation scoring, prefill/checkpoint tests, ds4-bench) with the Q2 GGUF will follow in #1070.