Sort prompts before batch MoE inference: a free 7–17% speedup in stock vLLM

yb2698 · x · 2026-10-20

A zero-cost MoE batch inference trick: sort your prompts before calling llm.generate.

Why it works: each decode step reads every expert picked by any request in the batch. Mixed-domain batches touch more experts; same-domain batches overlap, improving expert cache hits.

Measured on stock vLLM with identical requests, only the order changed:

Just one argsort — no model or framework changes needed.

Original post →

More from Infra

Infra channel →