SURGE:超批次统一资源高效GPU编码用于异构分区数据
SURGE: SuperBatch Unified Resource-efficient GPU Encoding for Heterogeneous Partitioned Data
AI总结:
SURGE通过分析模型和内存限制,实现高效GPU编码,减少内存使用并提升处理速度,适用于大规模文本嵌入生成。
摘要:
我们提出了SURGE,一个部署在生产环境中的流式GPU编码系统,用于生成超过8亿文本的嵌入,分布在4万个逻辑分区中。生产嵌入流水线面临逻辑数据分区与高效GPU利用之间的张力:独立处理每个分区会带来$P$次进程间通信(IPC)调用,其开销限制了计算轻量模型的吞吐量。我们的贡献是分析性的:(i)一个成本模型(定理1)可预测吞吐量,误差在三个覆盖参数范围15倍的编码器中不超过2%;(ii)一个内存安全界限(引理3)使流式双阈值策略能够以峰值内存$O(B_{\min} + n_{\max})$而非$O(N)$实现;(iii)一个$ϕ$/CV决策框架,刻画了在我们的工作负载之外何时适用该模式。简单的固定大小批处理方法需要$O(N)$峰值内存(1000万文本时为32.7 GB;在192 GB节点上超过~6000万时不可行),在所有编码完成前不产生输出,且不提供容错能力。SURGE在$O(B_{\min} + n_{\max})$有界内存(2.6 GB)下实现了相同的吞吐量,速度比固定批处理快68倍,且在SuperBatch粒度下具备崩溃恢复能力。在1000万文本和4块NVIDIA L4 GPU上,SURGE的吞吐量为26,413 texts/s -- 与固定批处理吞吐量相匹配,但内存使用减少了12.6倍。我们验证了bge-base(109M,$d$=768,误差1.3%)和跨对数正态$σ$在{1.0, 1.72, 2.5}中的表现(速度提升在±3%内不变),并对比了分区批处理基准线(PB-PBP-LB),SURGE在吞吐量上保持7%的优势,且TTFO快2.5倍。互补的工程优化——零拷贝Arrow序列化(22-25倍提速)和异步I/O流水线(最高93%收益)——实现了设计,但并非贡献。
英文摘要:
We present SURGE, a streaming GPU encoding system deployed in production to generate embeddings for over 800 million texts across 40,000 logical partitions. Production embedding pipelines face a tension between logical data partitioning and efficient GPU utilization: processing each partition independently incurs $P$ inter-process communication (IPC) calls whose overhead limits throughput for compute-light models. Our contributions are analytical: (i) a cost model (Theorem 1) predicting throughput within 2% across three encoders spanning a 15$\times$ parameter range; (ii) a memory-safety bound (Lemma 3) enabling a streaming two-threshold policy with peak memory $O(B_{\min} + n_{\max})$ rather than $O(N)$; and (iii) a $ϕ$/CV decision framework characterizing when the pattern applies beyond our workload. The naive fix of batching at fixed size requires $O(N)$ peak memory (32.7 GB at 10M texts; infeasible beyond ~60M on 192 GB nodes), produces no output until all encoding completes, and offers no fault tolerance. SURGE achieves the same throughput with $O(B_{\min} + n_{\max})$ bounded memory (2.6 GB), 68$\times$ faster time-to-first-output, and crash recovery at SuperBatch granularity. On 10M texts with 4 NVIDIA L4 GPUs, SURGE delivers 26,413 texts/s -- matching fixed-batch throughput while using 12.6$\times$ less memory. We validate on bge-base (109M, $d$=768, error 1.3%) and across log-normal $σ$ in {1.0, 1.72, 2.5} (speedup invariant within $\pm$3%), and compare against a partition-batched baseline (PB-PBP-LB), against which SURGE retains a 7% throughput edge and 2.5$\times$ faster TTFO. Complementary engineering -- zero-copy Arrow serialization (22-25$\times$ speedup) and async I/O pipelining (up to 93% benefit) -- realizes the design but is not the contribution.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。