Downloads · 30 days
216
31% of all-time downloads
ranxianglei/Qwen3.8-Flash-Next-W4A16-Modular
Qwen3.8-Flash-Next-W4A16-Modular is a machine learning model from ranxianglei. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Expert-pruned, expert-modular repack of the Intel AutoRound W4A16 build of Qwen3.8-Flash-Next: 512 → 296 experts per layer, selected by profiling real agent traffic. Serves on a single 96 GB GPU with a 262K context wi…
Downloads · 30 days
216
31% of all-time downloads
All-time downloads
688
Public
Parameters
65.9B
98.3 GB on disk
Likes
6
Public
Click a slice to open those files.
.safetensors98.2 GB · 100%
How the weights are stored.
F8_E4M351.2B · 78%
From the Hugging Face model README
Expert-pruned, expert-modular repack of the Intel AutoRound W4A16 build of Qwen3.8-Flash-Next: 512 → 296 experts per layer, selected by profiling real agent traffic. Serves on a single 96 GB GPU with a 262K context window.
--expert-distribution-recorder-mode stat, producing per-(layer, expert)
route counts. A second profile was taken on anomalous contexts (the failure
sessions we wanted the model to keep handling well).experts-L{NN}.safetensors; everything else (dense, GDN linear attention, PLE,
embeddings, lm_head) into 14 large backbone shards. No tensor values were modified —
this is a pure re-chunking of the same weights, verified key-for-key identical
(129,403 tensors) with serving parity (104 tok/s).MoE layers route each token to only top-k of num_experts experts (here 10 of 512).
Routine traffic concentrates on a small subset per layer, so removing never-routed
experts is lossless for that workload; the anomaly-profile union buys back robustness
for edge contexts. Expert weights live in GPU memory only when kept, so pruning
512→296 frees ~13 GB VRAM → +31% KV pool.
| Pruned-294E | Modular (this) | |
|---|---|---|
| Experts/layer | 294 (daily profile only) | 296 (+2/layer from anomaly profile → self-heal) |
| Layout | 23 linear shards (~4.5 GB) | 48 expert files (~180 MB) + 14 backbone shards |
| Editing one layer's experts | rewrite a 4.5 GB shard + index | rewrite one 180 MB file |
| Quality gates | passed | passed (incl. anomalous-context suite) |
Same base weights, same quantization; day-to-day quality and speed are identical.
| Pattern | Count | Size each | Contents |
|---|---|---|---|
experts-L00..47.safetensors | 48 | ~180 MB | all MoE expert tensors of one layer (w13/w2 qweight/scales/qzeros) |
backbone-000XX.safetensors | 14 | ~4.4 GB | dense / GDN linear-attention / attention / PLE / embeddings / lm_head |
Swapping, adding or re-pruning experts for layer N only rewrites experts-LNN.safetensors
plus config.json (num_experts) and the index weight_map — the backbone never changes.
Want a keep set tuned to your traffic? Profile it in one command and serve pruned
without re-exporting: sglang-expert-profile
(CLI + community keep-sets; the serving-side keep-mask lives in the
sglang fork, ours/main).
--ple-offload-embedding)python -m sglang.launch_server \
--model-path ./Qwen3.8-Flash-Next-W4A16-Modular \
--chat-template ./qwen3_coder_template.jinja \
--ple-offload-embedding \
--moe-a2a-backend none \
--linear-attn-prefill-backend triton --linear-attn-decode-backend triton \
--mamba-ssm-dtype bfloat16 \
--context-length 262144 --mem-fraction-static 0.93 \
--reasoning-parser qwen3 --tool-call-parser qwen3_coder
Sampling defaults ship in generation_config.json (temp 0.7 / top_p 0.95 / top_k 20, no
penalties — Flash-Next is penalty-sensitive, see our notes in the sglang fork). No need to
pass them per request.
Note: without the marlin GC patch, loading OOMs at ~91.5 GB on some stacks (gptq_marlin_moe_repack int4→int32 expansion). Patch + details: https://github.com/ranxianglei/sglang (ours branch).
This model's 262K window + huge KV pool makes it an excellent host for our context-compression plugins — long agent sessions stay coherent while effective context grows far beyond the window:
Together: Flash-Next serves the window, billion-context compresses into it — day-long coding agents on one consumer GPU.
Base: Qwen/Qwen3.8-Flash-Next → Intel AutoRound W4A16 (calibrated) → expert pruning 512 → 296 by routing-profile keep-set → modular repack (this repo). 294-expert variant (linear shards): ranxianglei/Qwen3.8-Flash-Next-W4A16-Pruned-294E