跳到正文
返回论文列表
cs.DC提交于 已译

将 Tokenization 移出主机以服务于代理式 LLM 推理

Taking Tokenization off the Host for Agentic LLM Serving

Mohammad Siavashi · Pascal Schwinte · Ali Banaei · Gerald Q. Maguire Jr. · Marco Chiesa · Dejan Kosti\'c

中文摘要

代理式(agentic)工作负载在多次调用间重复发送几乎不变的长上下文。前缀缓存(prefix caching)已能跳过大部分 prefill,但每次请求仍需先完成完整 tokenization,才能查询缓存。原本被视为可忽略的 CPU 阶段 tokenization,成为首 token 时间(time-to-first-token, TTFT)中的最大开销;而为整个 GPU 集群做 tokenization 的前端,限制了它能供给的 GPU 数量。GraphTok 是一个 GPU tokenization 器,将从预分词(pre-tokenization)到字节对编码(byte-pair encoding, BPE)合并,再到 token ID 装配的整个编码流水线,作为一个可重放的 CUDA 图(graph)执行。GraphTok 在 GPT-2、Llama 3、Qwen 2.5、DeepSeek-V3、Gemma 3 上逐位复现参考 token ID,对 GPU 无法取胜的短输入交给 CPU 引擎处理,并可直接接入未修改的 vLLM 与 NVIDIA Dynamo。GraphTok 编码一百万 GPT-2 token 仅需 1.7–3.2 ms(含数据传输);在 Llama 3 上,相比当前最强的 CPU tokenization 器 gigatoken 获得 4.7–6.0 倍加速。在 TokTier 自身的单请求基准上,相比 gigatoken 提速 2.6–3.9 倍,最高可达 TokTier 的 18.1 倍。在使用缓存前缀的 vLLM 中,平均 TTFT 降低 2.1–2.4 倍。最大收益来自吞吐容量:在 2 s P99 目标下,单个集成 GraphTok 的 Dynamo 前端可承载 121k token 流量的 518 req/s(对应 56 张 GPU 的高峰小时负载),而 gigatoken 仅 296 req/s,默认 tokenization 器仅 18.5 req/s。在 121k 到一百万 token 区间内,这是 gigatoken 所承载负载的 1.75–2.5 倍;在 gigatoken 尾部恶化场景下,P99 最高降低 64 倍。

关键要点

  1. 01问题:代理式工作负载中前缀缓存已跳过大量 prefill,但完整 tokenization 仍需在 CPU 上进行,成为 TTFT 最大开销并限制前端可供给的 GPU 数量。
  2. 02方法:GraphTok 将预分词、BPE 合并与 token ID 装配封装为单一可重放的 CUDA 图,短输入回退 CPU,可直接接入未修改的 vLLM 与 NVIDIA Dynamo。
  3. 03正确性:在 GPT-2、Llama 3、Qwen 2.5、DeepSeek-V3、Gemma 3 上逐位复现参考 token ID。
  4. 04延迟与吞吐:在 Llama 3 上相比最强 CPU tokenization 器 gigatoken 提速 4.7–6.0 倍,含传输的百万 token 编码仅需 1.7–3.2 ms。
  5. 05部署容量:单个 Dynamo 前端在 2 s P99 内可承载 56 张 GPU 对应的 518 req/s 流量,约为 gigatoken 的 1.75–2.5 倍,尾部 P99 最高降低 64 倍。

解读

尚无解读。

原始英文摘要

arXiv:2610.13325v1 Announce Type: cross Abstract: Agentic workloads resend long contexts that barely change between calls. Prefix caching now skips most of their prefill, yet every request must still be tokenized in full before the cache can even be consulted. Tokenization, a CPU stage long treated as negligible, becomes the largest part of time-to-first-token (TTFT), and a frontend that tokenizes for a whole GPU fleet limits how many GPUs it can feed. We present GraphTok, a GPU tokenizer that runs the entire encoding pipeline, from pre-tokenization through byte-pair encoding (BPE) merging to token-ID assembly, as one replayable CUDA graph. GraphTok reproduces the reference token IDs bit-for-bit on GPT-2, Llama 3, Qwen 2.5, DeepSeek-V3, and Gemma 3, hands short inputs to a CPU engine where the GPU cannot win, and plugs into unmodified vLLM and NVIDIA Dynamo. GraphTok encodes one million GPT-2 tokens in 1.7-3.2 ms including data transfers, and on Llama 3 it is 4.7-6.0x faster than gigatoken, the strongest CPU tokenizer. On TokTier's own single-request benchmark, it is 2.6-3.9x faster than gigatoken and up to 18.1x faster than TokTier. In vLLM with a cached prefix, it lowers mean TTFT by 2.1-2.4x. The largest gain is capacity. Within a 2 s P99 target, one Dynamo frontend with GraphTok sustains 518 requests/s of 121k-token traffic, the busiest-hour load of 56 GPUs, against 296 with gigatoken and 18.5 with the default tokenizer. Across 121k to one million tokens, this is 1.75-2.5x the load gigatoken sustains, with a P99 up to 64x lower where gigatoken's tail breaks.

同方向论文 · cs.DC

查看全部 →

反向发现 · 这篇论文相关的工具与提示词

去交叉发现 →

关联提示词 · 3

编程github.com/f/awesome-chatgpt-prompts·外部收录·

Android AI App Security Specialist Task

Act as an Android AI App Security Specialist. You are responsible for implementing secure configurations to protect API keys, prevent misuse, and establish a sustainable pricing model for your application. Your tasks include: 1. **Backend…

编程github.com/f/awesome-chatgpt-prompts·外部收录·

AI Engineer

--- name: ai-engineer description: "Use this agent when implementing AI/ML features, integrating language models, building recommendation systems, or adding intelligent automation to applications. This agent specializes in practical AI impl…