Qwen3.8
Serve Qwen3.8-2.4T-A95B on two nodes or Qwen3.8-27B on one GPU with TokenSpeed. Qwen3.8 shares the hybrid linear-attention (GDN) / full-attention layer pattern with Qwen3.5.
Prerequisites
- Complete the TokenSpeed environment setup, make the
tokenspeedcommand available, and installcurlfor the verification steps. - For Qwen3.8-2.4T-A95B, use two 8-GPU nodes and make the
Qwen/Qwen3.8-2.4T-A95Bcheckpoint available on both nodes. Qwen3.8-max needs 16 GPUs. - For Qwen3.8-27B, use one GPU and make the
Qwen/Qwen3.8-27B-FP8checkpoint available. - For the multi-node recipe, obtain node 0's hostname or IP address. Make TCP port
25000on node 0 reachable from node 1, and make TCP port8000on node 0 reachable from the client that runs the verification request.
Qwen3.8-2.4T-A95B
Launch tokenspeed serve on every node with the same command, changing only --node-rank. Every node points --dist-init-addr at node 0, which is the only rank that serves the HTTP API. For more information, see the multi-node parallelism rules.
Replace <node0-host> with node 0's own hostname or IP address, and use the same value on both nodes. The commands use port 25000 for distributed initialization.
This family has no parser auto-selection, so both configurations set --reasoning-parser qwen3_thinking and --tool-call-parser qwen_coder explicitly. Both configurations also set --speculative-algorithm MTP without --speculative-draft-model-path, which drafts from the base checkpoint.
Choose a layout
- TP16: Choose this layout for lower TTFT and TPOT at batch sizes 1-2. There is no dispatch/combine hop, and the single replica owns the whole batch.
- TP8 DP2 EP16 (DeepEP): This layout pulls ahead from mid-sized batches upward, where its expert kernels and the second attention replica both pay off.
TP16
This layout runs one replica across both nodes. --ep-size defaults to 1, so the experts stay tensor-parallel over the full world and all-to-all stays out of the path. Keep --moe-backend auto: the block-scale FP8 deep_gemm experts implement only the DeepEP legs and are unavailable without --all2all-backend deepep.
On each node, start the server with the TP16 configuration. The commands differ only in
--node-rank:bash# node 0 (serves the HTTP API) tokenspeed serve Qwen/Qwen3.8-2.4T-A95B \ --served-model-name Qwen/Qwen3.8-2.4T-A95B \ --nnodes 2 --node-rank 0 --nprocs-per-node 8 --world-size 16 \ --dist-init-addr <node0-host>:25000 \ --attn-tp-size 16 \ --moe-backend auto \ --quantization fp8 --kv-cache-dtype fp8 \ --attention-backend trtllm \ --chunked-prefill-size 8192 \ --max-num-seqs 128 \ --speculative-algorithm MTP --speculative-num-steps 3 \ --speculative-eagle-topk 1 --speculative-num-draft-tokens 4 \ --reasoning-parser qwen3_thinking --tool-call-parser qwen_coder \ --host 0.0.0.0 --port 8000 # node 1 (same command, --node-rank 1) tokenspeed serve Qwen/Qwen3.8-2.4T-A95B \ --served-model-name Qwen/Qwen3.8-2.4T-A95B \ --nnodes 2 --node-rank 1 --nprocs-per-node 8 --world-size 16 \ --dist-init-addr <node0-host>:25000 \ --attn-tp-size 16 \ --moe-backend auto \ --quantization fp8 --kv-cache-dtype fp8 \ --attention-backend trtllm \ --chunked-prefill-size 8192 \ --max-num-seqs 128 \ --speculative-algorithm MTP --speculative-num-steps 3 \ --speculative-eagle-topk 1 --speculative-num-draft-tokens 4 \ --reasoning-parser qwen3_thinking --tool-call-parser qwen_coder \ --host 0.0.0.0 --port 8000From a terminal that can reach node 0, confirm that the engine has registered with the gateway:
bashcurl --fail http://<node0-host>:8000/readinessThe request returns HTTP
200 OKwhen the server is ready. Node 1 does not expose an HTTP endpoint.
TP8 DP2 EP16 (DeepEP)
This layout runs two TP8 attention replicas, shards experts across all 16 ranks, and routes experts on DeepEP dispatch/combine instead of all-gather.
DeepEP sizing and networking
Review these requirements before starting the server:
--low-latency-max-num-tokens-per-gpusizes DeepEP's NVSHMEM heap (roughly 2.0 GB at 64, 8.1 GB at 256), and startup claims that heap after profiling the KV pool. An oversized value therefore fails late, when the first dispatch runs out of fabric memory. Size it to the real per-rank decode token bound and no lower: the runtime rejects a batch above the capacity rather than truncating it.- Internode DeepEP rides NVSHMEM IBGDA. On a RoCE fabric, mirror the NCCL values into
NVSHMEM_IB_GID_INDEX,NVSHMEM_IB_TRAFFIC_CLASS, andNVSHMEM_IB_SL, and pointNVSHMEM_BOOTSTRAP_UID_SOCK_IFNAMEat the same interface asNCCL_SOCKET_IFNAME.
To serve this layout, follow these steps:
On each node, start the server with TP8 attention, DP2, and EP16. The commands differ only in
--node-rank:bash# node 0 (serves the HTTP API) tokenspeed serve Qwen/Qwen3.8-2.4T-A95B \ --served-model-name Qwen/Qwen3.8-2.4T-A95B \ --nnodes 2 --node-rank 0 --nprocs-per-node 8 --world-size 16 \ --dist-init-addr <node0-host>:25000 \ --attn-tp-size 8 --data-parallel-size 2 --ep-size 16 \ --moe-backend deep_gemm \ --all2all-backend deepep --deepep-mode auto \ --low-latency-max-num-tokens-per-gpu 64 \ --quantization fp8 --kv-cache-dtype fp8 \ --attention-backend trtllm \ --chunked-prefill-size 8192 \ --max-num-seqs 128 \ --speculative-algorithm MTP --speculative-num-steps 3 \ --speculative-eagle-topk 1 --speculative-num-draft-tokens 4 \ --reasoning-parser qwen3_thinking --tool-call-parser qwen_coder \ --host 0.0.0.0 --port 8000 # node 1 (same command, --node-rank 1) tokenspeed serve Qwen/Qwen3.8-2.4T-A95B \ --served-model-name Qwen/Qwen3.8-2.4T-A95B \ --nnodes 2 --node-rank 1 --nprocs-per-node 8 --world-size 16 \ --dist-init-addr <node0-host>:25000 \ --attn-tp-size 8 --data-parallel-size 2 --ep-size 16 \ --moe-backend deep_gemm \ --all2all-backend deepep --deepep-mode auto \ --low-latency-max-num-tokens-per-gpu 64 \ --quantization fp8 --kv-cache-dtype fp8 \ --attention-backend trtllm \ --chunked-prefill-size 8192 \ --max-num-seqs 128 \ --speculative-algorithm MTP --speculative-num-steps 3 \ --speculative-eagle-topk 1 --speculative-num-draft-tokens 4 \ --reasoning-parser qwen3_thinking --tool-call-parser qwen_coder \ --host 0.0.0.0 --port 8000From a terminal that can reach node 0, confirm that the engine has registered with the gateway:
bashcurl --fail http://<node0-host>:8000/readinessThe request returns HTTP
200 OKwhen the server is ready. Node 1 does not expose an HTTP endpoint.
Qwen3.8-27B
This recipe serves a dense 27B-class Qwen3.8 FP8 checkpoint on a single GPU, with self-speculative MTP. The draft model path points at the same checkpoint.
Start the server. The command uses the published checkpoint ID as the model path, served model name, and draft model path; no placeholder values need replacement:
bashtokenspeed serve Qwen/Qwen3.8-27B-FP8 \ --served-model-name Qwen/Qwen3.8-27B-FP8 \ --world-size 1 \ --attention-backend trtllm \ --moe-backend flashinfer_trtllm \ --chunked-prefill-size 8192 \ --max-model-len 262144 \ --max-num-seqs 128 \ --kv-cache-dtype fp8_e4m3 \ --speculative-algorithm MTP \ --speculative-draft-model-path Qwen/Qwen3.8-27B-FP8 \ --speculative-num-steps 3From another terminal, confirm that the engine has registered with the gateway. If you changed
--hostor--port, replace127.0.0.1:8000with the server's address:bashcurl --fail http://127.0.0.1:8000/readinessThe request returns HTTP
200 OKwhen the server is ready.