All articles

How to serve a mixture-of-experts model: memory, expert parallelism and which GPU fits

A mixture-of-experts model needs GPU memory for every expert but computes only a few per token. Size the GPU from total parameters, size the speed from active ones, and turn on expert parallelism in vLLM when the model spans several GPUs. Worked examples for gpt-oss-120b and Qwen3.8-Flash-Next. Checked against the vLLM 0.34.0 docs and the model cards, 1 December 2026.
Lium team7 min read
vllm
llm-inference
mixture-of-experts
Short answer: pick the GPU for a mixture-of-experts (MoE) model by its total parameters, because every expert must sit in GPU memory, and expect speed per token close to a dense model the size of its active parameters. If the weights fit on one card, serve on one card: gpt-oss-120b fits one 80 GB H100. If they do not, split the model over a node with NVLink and add --enable-expert-parallel to vllm serve, which spreads whole experts across GPUs instead of slicing each one. Qwen3.8-Flash-Next in FP8 is the example: its recipe serves it on 4 or 8 GPUs with expert parallelism, and calls that faster than plain tensor parallelism.
Everything below is checked against the vLLM expert parallel deployment guide (stable docs for vLLM 0.34.0), the vLLM recipe for Qwen3.8-Flash-Next, and the Hugging Face model cards and config files of gpt-oss-120b and Qwen3.8-Flash-Next, all read 1 December 2026. GPU memory sizes come from the Lium price feed of the same day.

Total parameters vs active parameters

An MoE layer replaces one big feed-forward block with many small ones, the experts, and a router that sends each token to a few of them. The model cards give both numbers:
ModelTotal parametersActive per tokenExperts per layerExperts used per token
gpt-oss-120b117B5.1B1284
Qwen3.8-Flash-Next125B, plus a 51B n-gram embedding and a 4B MTP head6B51210 routed + 1 shared
The two numbers answer different questions:
  • Memory follows total parameters. Any token can be routed to any expert, so all of them stay loaded. A 117B model needs room for 117B parameters even though one token uses 5.1B.
  • Compute per token follows active parameters. Each token runs through only its chosen experts, so the arithmetic per token is close to that of a 5B or 6B dense model. At small batches, decoding is limited by reading weights from memory, and each token reads only the experts it uses.
That is why MoE models are good for serving: the quality of a large model with the per-token cost of a small one, as long as you can hold all of it in memory. It also means the usual rule of thumb (a 7B model on a small card) does not apply. Count the full checkpoint.
The KV cache comes on top of the weights. It grows with context length and concurrent requests, not with the number of experts, and What to fix when vLLM runs out of memory covers how vLLM sizes it.

Which GPU fits which model

Weights first. The checkpoint sizes are the safetensors totals on Hugging Face, and the per-card memory is from the Lium price feed (1 December 2026):
Model and formatWeightsFits on one cardNeeds several cards
gpt-oss-120b, MXFP4 expertsabout 65 GBH100 (80 GB), RTX PRO 6000 (96 GB), H200 (141 GB)only for more KV cache
Qwen3.8-Flash-Next, FP8185.5 GB (172.78 GiB)B300, for testingyes for serving: 4 or 8 GPUs
Notes on each row:
  • gpt-oss-120b. OpenAI's card says it fits "into a single 80GB GPU (like NVIDIA H100 or AMD MI300X)". Only the expert weights are in MXFP4. Attention, router, embedding and output layers stay in higher precision, which is part of the 65 GB. On an H100 the space left for KV cache is small, so long contexts or many users point to the 96 GB RTX PRO 6000 or the 141 GB H200.
  • Qwen3.8-Flash-Next. The FP8 checkpoint is larger than one B200 (180 GB). The recipe says it "fits on a single GB300 GPU (288 GB HBM3e)". The B300 is the same Blackwell Ultra GPU, and NVIDIA lists 2.1 TB of GPU memory for an 8-GPU DGX B300 (read 1 December 2026), so one B300 also holds the checkpoint. The recipe adds that one GPU "suits evaluation and development; multi-GPU TEP remains the recommended deployment for serving throughput." For serving, it gives configs for 4x GB300, 8x H200 and 8x H100.

Tensor parallelism vs expert parallelism

When the weights do not fit on one GPU, vLLM has two ways to split the expert layers.
Tensor parallelism (TP) slices every weight matrix, including each expert, across the GPUs. Every GPU holds a piece of every expert. This is what vLLM does by default: without --enable-expert-parallel, the guide says, MoE layers use tensor parallelism like dense layers.
Expert parallelism (EP) keeps each expert whole and places different experts on different GPUs. Tokens are sent to the GPU that holds their expert and the results are sent back, an all-to-all exchange in every MoE layer. The guide gives the size as:
text
EP_SIZE = TP_SIZE × DP_SIZE
So --tensor-parallel-size 8 --enable-expert-parallel spreads the experts over 8 GPUs while attention stays tensor-parallel. The recipe calls this TEP8.
The guide's other pattern combines EP with data parallelism (DP). With --tensor-parallel-size 1 --data-parallel-size 8 --enable-expert-parallel, each GPU has a full copy of the attention weights and serves its own requests, and the experts are split over all 8. The guide's example serves a large MoE model this way, and notes that it "will work on a H200 (or H20) node with 8 GPUs". It also says EP "is more efficient when used in conjunction with DP".
Which to use:
  • One GPU is enough: neither. Expert parallelism only matters across GPUs.
  • Several GPUs, many small experts: expert parallelism. Slicing a small expert eight ways leaves each GPU tiny matrix multiplications. Qwen3.8-Flash-Next has 512 experts with an intermediate size of 640, and its recipe says "expert parallelism is consistently faster for this model" than plain TP.
  • Some checkpoints require it. The recipe says "plain TP8 is incompatible with the FP8 checkpoint", because its 128-wide quantization blocks cannot be split eight ways. Use TEP8.

Serve Qwen3.8-Flash-Next with expert parallelism

The recipe's FP8 command for an 8x H200 node:
bash
vllm serve Qwen/Qwen3.8-Flash-Next-FP8 \
  --tensor-parallel-size 8 \
  --enable-expert-parallel \
  --moe-backend triton \
  --max-num-seqs 256 \
  --enable-prefix-caching \
  --kv-cache-dtype fp8 \
  --attention-config.indexer_kv_dtype fp8 \
  --speculative-config '{"method":"mtp","num_speculative_tokens":3}' \
  --enable-auto-tool-choice \
  --tool-call-parser qwen3_coder \
  --reasoning-parser qwen3
The same command works on 8x H100, with one difference handled for you. The recipe says 80 GB per GPU "is not enough headroom for the 51B N-gram/PLE embedding table", so vLLM keeps that table in host RAM by default (--engram-config '{"cpu_offload":true}'). The recipe asks for at least 51 GB of host memory plus headroom for it. On 4x H100, the recipe warns that plain TP4 runs out of memory at startup without this offload.
For gpt-oss-120b on one GPU, no parallel flags are needed:
bash
vllm serve openai/gpt-oss-120b

Uneven experts: turn on the load balancer

Expert parallelism has one weakness: some experts are more popular than others. The guide says "in practice the distribution of tokens across experts can be highly skewed", and a GPU holding popular experts becomes the slow one that everyone waits for. vLLM's Expert Parallel Load Balancer (EPLB) moves experts between GPUs to even out the load. Turn it on with --enable-eplb and tune it with --eplb-config. Check the guide for the options your vLLM version supports, then compare throughput with and without it on your traffic.

The node matters: check NVLink

The all-to-all exchange runs in every MoE layer for every batch, so expert parallelism needs fast links between GPUs. Before you serve on a multi-GPU pod, check how its GPUs are connected with Lium's multi-GPU checks. Look for NVLink between all GPUs. Over PCIe alone, the exchange can cost more time than the split saves.

Running it on Lium

Serve an open LLM with vLLM on a single Lium GPU shows how to start a pod with lium up and run vllm serve. Choose the card from the table above:
  • gpt-oss-120b: an H100, or an RTX PRO 6000 or H200 for longer contexts and more users.
  • Qwen3.8-Flash-Next FP8: an 8x H200 or 8x H100 node for serving, or one B300 to try it.
Pods bill by the second, so a test with and without --enable-expert-parallel or --enable-eplb costs only the time it runs. Live supply for each card and node size is on lium.io/stats. For help choosing between cards for inference in general, see the best GPU cloud for LLM inference.

Checklist

  1. Size GPU memory from the full checkpoint, not the active parameter count.
  2. Add room for the KV cache on top of the weights.
  3. If the model fits on one GPU, serve it on one GPU.
  4. Across GPUs, add --enable-expert-parallel, and follow the model's recipe where it needs TEP (Qwen3.8-Flash-Next FP8 on 8 GPUs).
  5. Check for NVLink before you rely on expert parallelism.
  6. If one GPU stays busier than the rest, try --enable-eplb and measure.
Get new posts by e-mail: Subscribe to the Lium newsletter