Replaces cherry-picked upstream_ref with complete source trees. xllm/ — Iluvatar official C++ inference engine (15MB, 1470 files) Complete: kernels → layers → models → runtime → scheduler → api Excluded: .git, binary images, third_party submodule checkouts ds_vllm/ — Iluvatar official vllm fork (8MB, 703 files) Included: csrc/ (ALL CUDA kernels), fused_moe/, qwen3_5 model, _custom_ops Excluded: tests, benchmarks, docs, examples (not needed for reference) Critical call chains now fully traceable: MoE: moe_topk_softmax_kernels.cuh → ixformer.h → fused_moe.cpp → layer GDN: qwen3_gated_delta_net_base.cpp → qwen3_5_gated_delta_net.cpp Attention: ixformer.h → xllm_paged_attention → attention.cpp
840 B
840 B
ChunkedPrefill调度器
功能介绍
xLLM支持chunked prefill调度策略。Chunked prefill是一种优化大语言模型推理的技术,将长prompt分割成多个较小的chunk进行分批处理,而不是一次性处理整个prompt。 这种方法可以有效降低显存峰值使用量,提高Device利用率,并且能够更好地与decode阶段的请求进行调度和混合处理。
使用方式
上述策略已在xLLM实现,并向外暴露gflag参数,控制功能的开关。
- 开启chunked prefill,并设置chunked_size,如果不手动设置chunked size,则默认等于max_tokens_per_batch。
--enable_chunked_prefill=true
--max_tokens_per_chunk_for_prefill=20480 # optional
性能效果
开启chunked_prefill之后,在Qwen3-8B模型上,限制TPOT 50ms,TTFT时延 下降46%。