Detent: Batch-Invariant LLM Serving and RL Rollouts at Near-Stock Speed
Abstract
Reproducible evaluation, verifiable inference and on-policy reinforcement learning (RL) need an LLM engine to give a request the same output bits whichever requests share its batch. Batch-invariant kernels exist, but engines still select each kernel and its parameters from the batch. Two kernels that compute the same sum can round it differently. The engines' deterministic modes remove the choice by keeping one conservative kernel per operator and pay for it in latency. Many fast kernels are batch-invariant by themselves, so it is enough to fix the few batch-dependent values that kernel selection reads. Detent expresses kernel selection as a program that the engine executes. It finds the fewest values in this program that must be fixed and tunes them for the workload before deployment. On multi-GPU deployments of Llama-3.1-70B and Qwen3-30B-A3B in vLLM and SGLang, Detent is batch-invariant. Tuned per load, it serves at 1.04-1.17x the latency per output token of Stock (each engine with its standard settings), against 1.67-10.3x for the deterministic modes. In SGLang it matches the GSM8K accuracy of SGLang's deterministic mode. Detent covers multiple deployment combinations, including multiple engines, GPU generations, tensor-parallel degrees, and dense and MoE models. Seeded RL rollouts of models up to Llama-3.1-70B replay bit for bit under other batches and cache splits. A trainer on Detent's kernels and values matches every rollout logprob bit for bit at 1.03x Stock's rollout time per token. BF16 GRPO then stays stable where Stock's run collapses.
Create a lesson
Metadata
- Categories
- cs.LG, cs.DC
- Comments
- 18 pages, 14 figures, 7 tables
Related papers
Trigger-Invariant Contrastive Unlearning for Backdoor Removal
Shared title terminologycs.LGSantosh Chapagain, Shah Muhammad Hamdi, Soukaina Filali Boubrahimi
Draft Calibration for Speculative Decoding: Accelerating LLM Serving by Matching Draft and Target Distributions
Shared title terminologycs.LGYuxing Liu, Wei Zuo, Walid Krichene et al.
Reinforcement Learning Can Be Recovered From Its Own Rollouts
Shared title terminologycs.LGJiayi Sheng, Jingwen Gu, Guanning Zeng et al.
Scale-Invariant Empirical-Bayes Laplace Approximation for ReLU Networks
Shared title terminologycs.LGShivam Pal, Piyush Rai
Direct GPU Energy Measurements of Batch-Level Sharing in Mixture-of-Experts and Recurrent Models
Shared title terminologycs.LGRafael Pina, Varuna De Silva
Hybrid Product Search Without the Copy: Lexical, Semantic and Filtered Retrieval Served Directly from a Data Lake
Shared title terminologycs.LGRaghvendra Yadav, Xiang Fu, Chinmay Soman