用细粒度模拟器预测大模型推理延迟,省下大量实测数据。
KernelSight-LM: A Kernel-Level LLM Inference Simulator

- 拆解推理步骤为内核级模型,结合调度机制精准建模
- 跨代预测误差12.1%,实测后降至3.8%,远低于基线
- 适合芯片设计、部署优化,节省大量实机测试成本
随着大语言模型进入生产环境,从业者需快速评估不同硬件、模型和部署参数下的推理性能,以满足成本与延迟目标。然而,大模型的端到端行为耦合了服务层策略、低层级GPU内核执行及不断演进的架构,导致依赖具体部署的基准测试缓慢且难以泛化。我们提出KernelSight-LM,一种细粒度推理模拟器,可建模逐标记执行并生成内核级延迟分解。它将每个服务步骤分解为带学习效率项的屋顶线内核模型、通信模型和主机开销模型,通过离散事件调度器整合,同时捕捉前缀缓存和连续批处理等机制。该模拟器提供两种预测层级:跨代层级仅需硬件规格和先前微基准测试数据,对未见GPU生成内核延迟预测误差为12.1%(比屋顶线基线22.0%提升1.8倍);第二层级在目标GPU上增加一次无模型依赖的微基准测试,将内核误差降低至3.8%(相比同类基线27.7%提升7.3倍)。两者所需目标数据远少于此前系统。模拟结果中,跨代层级在六类模型上的端到端中位误差(p50)分别为15.4%(TTFT)、12.8%(TPOT)、3.0%(吞吐量),目标测量层级分别为14.3%、6.2%、2.7%,匹配专用调优工具但采集数据极少。除预测外,其内核级瓶颈分析还可支持软硬件协同设计与容量规划。
原文摘要 · Abstract (English)
As large language models (LLMs) move into production serving, practitioners must rapidly evaluate inference performance across diverse hardware, models, and serving parameters to meet cost and latency targets. However, the end-to-end behavior of LLMs couples serving-layer policies with low-level GPU kernel execution and rapidly evolving architectures, forcing slow, deployment-specific benchmarking that is hard to generalize. We present KernelSight-LM, a fine-grained inference simulator that models token-level execution and produces kernel-level latency breakdowns. It decomposes each serving step into a roofline kernel model with a learned efficiency term, a communication model, and a host-overhead model, composed through a discrete-event scheduler that also captures mechanisms like prefix caching and continuous batching. KernelSight-LM offers two prediction tiers that trade target-GPU data for accuracy. The cross-generation tier uses no target-GPU measurements, only hardware specifications and kernel microbenchmarks from previously profiled GPUs, and predicts per-kernel latency on an unseen GPU generation to 12.1% error, a 1.8x improvement over the roofline baseline (22.0%). A second target-measured tier adds one model-agnostic kernel-microbenchmark sweep on the target GPU, sharpening per-kernel error to 3.8%, a 7.3x improvement over a comparable baseline (27.7%). Both tiers require far less target-GPU data than the prior systems they extend. In our simulator, these predictions yield end-to-end median (p50) errors across six model families of 15.4%, 12.8%, and 3.0% (TTFT, TPOT, throughput) in the cross-generation tier and 14.3%, 6.2%, and 2.7% in the target-measured tier, matching dedicated profiling tools while collecting far less on-device data. Beyond prediction, its kernel-level bottleneck breakdowns support hardware/software co-design and capacity planning.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。