CoRun: Padding is Simple and Efficient for Deterministic LLM Inference
Shiju Zhao, Jiacheng Yang, Qihang Chen, Junhao Hu, Jiaqi Zheng, Guihai Chen, Xusheng Chen
Abstract
Despite fixed sampling parameters and random seeds, Large Language Model (LLM) inference exhibits output inconsistency, which undermines downstream tasks such as model evaluation and reinforcement learning. A major source of this nondeterminism is batch-dependent GPU execution: dynamic input shapes change kernel tiling and floating-point reduction orders. Existing systems address this problem with batch-invariant kernels, but these kernels restrict optimized tiling and split reductions, increasing more than 2× latency and reducing serving throughput by up to 74 %. This paper observes that although most kernels are not batch-invariant, they are position-invariant. Leveraging this property, we present CoRun, a scheduling-based system that achieves deterministic inference without requiring batch invariance. CoRun employs isolated prefill and fixed-shape batched decode to handle the two stages of LLM inference, respectively, leveraging CUDA graphs for efficient execution and simplified implementation. Experiments on LLMs with diverse architectures, including Qwen and DeepSeek, show that CoRun ensures determinism while improving throughput by 15-324 % over batch-invariant approaches, reducing time-to-first-token by 51.8 % and time-per-output-token by 48.6 % on average.
Create a lesson
Related papers
mold: A Massively Parallel Linker
Rui Ueyama
AdaSprite: Resource-efficient Online Co-Adaptation for V2I Systems Under Large-scale Data Drifts
Lehao Wang, Zhiwen Yu, Sicong Liu et al.
Global Simulation-Guided Dynamic Operator Scheduling for Efficient Multi-Tenant Model Serving
Weinan Liu, Zeyuan Ding, Dian Ding et al.
From LLM Inference to Agentic Workloads: Characterization and Implications for Serving Systems
Chaokun Chang, Yukun Zhou, Kaihua Fu et al.
A Bounded Reclaim Actuator for PSI-Guided Compressed Memory: A Controlled Ablation
Abhiyan Dhakal, Sanjog Sigdel
The Ingestion Tax: Adopting File-Backed Weights in Tensor Frameworks
Yuan Si, Yufeng Lin, Daming Li et al.