arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2610.13325cs.DCcs.CLcs.LGcs.PF
收藏

将智能体大语言模型服务的分词过程从主机端移除

Taking Tokenization off the Host for Agentic LLM Serving

KTH Royal Institute of Technology(瑞典皇家理工学院)

Mohammad Siavashi, Pascal Schwinte, Ali Banaei, Gerald Q. Maguire, Marco Chiesa, Dejan Kostić

AI总结:

针对智能体LLM服务中分词成为TTFT瓶颈的问题,提出GPU分词器GraphTok,可接入vLLM等框架,大幅提升分词速度与服务容量,降低P99延迟。

摘要:

智能体工作负载会在调用间几乎不发生变化的情况下重复发送长上下文。当前的前缀缓存技术已能跳过大部分预填充步骤,但每个请求仍需先完成完整的分词才能查询缓存。长期被视为可忽略的CPU阶段——分词,如今成为首token生成时间(TTFT)的最大组成部分,而为整个GPU集群进行分词的前端会限制可服务的GPU数量。我们提出GraphTok,这是一种GPU分词器,它将整个编码流程(从预分词到字节对编码(BPE)合并再到token-ID组装)作为可重放的CUDA图运行。GraphTok在GPT-2、Llama 3、Qwen 2.5、DeepSeek-V3和Gemma 3上可逐位复现参考token ID,会将GPU无法发挥优势的短输入交给CPU引擎处理,且可接入未修改的vLLM和NVIDIA Dynamo。GraphTok编码100万个GPT-2 token需1.7-3.2毫秒(含数据传输),在Llama 3上比最强的CPU分词器gigatoken快4.7-6.0倍;在TokTier的单请求基准测试中,比gigatoken快2.6-3.9倍,比TokTier快达18.1倍。在使用缓存前缀的vLLM中,它将平均TTFT降低了2.1-2.4倍。最大的提升在于容量:在2秒的P99目标内,搭载GraphTok的单个Dynamo前端可维持518请求/秒的12.1万token流量(对应56个GPU的高峰小时负载),而gigatoken仅能维持296请求/秒,默认分词器仅能维持18.5请求/秒;在12.1万到100万token范围内,其负载是gigatoken的1.75-2.5倍,且P99延迟比gigatoken低达64倍(gigatoken的尾延迟会出现中断)。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑