基础设施 3.0 · 值得看 2026-11-04 · 论文

NUMA-Torch: Compiler-Driven NUMA-Aware LLM Prefill on Multi-Socket CPUs

多路 CPU 上的 LLM prefill:参数放不进片上缓存时,吞吐受可持续 DRAM 带宽限制,而 TorchInductor 默认分配权重不看 NUMA 拓扑,大量权重访问要跨槽位互连NUMA-Torch 在编译器层解决:把每个 socket 当独立张量并行分区(NUMA-TP),按槽位分片权重,用 CPU 亲和让线程池与内存分配严格本地化GPT-2/BERT/Gemma 3 270M 上消除跨槽流量:双路 Haswell 最高 2.63x双路 Cascade Lake 1.87x四路 Haswell-EX 2.27x prefill 加速

打开原文回到归档

NUMA-Torch: Compiler-Driven NUMA-Aware LLM Prefill on Multi-Socket CPUs

  • ID: e002de5a
  • 来源: https://arxiv.org/abs/2611.07105
  • 作者: Thisara Rathnayaka Weerakoon, et al.
  • 发表: 2026-11-04 - arXiv 2611.07105 - cs.DC, cs.PF, cs.PL
  • 证据: opencli arxiv paper 2611.07105 -f json 元数据与摘要(2026-11-09 抓取)

Abstract(原文)

For sufficiently large transformer-based Large Language Models (LLMs), whose parameters cannot be retained in on-chip caches, prefill throughput on multi-socket CPUs is often limited by sustainable DRAM bandwidth rather than peak floating-point throughput. In the standard PyTorch compilation (i.e., TorchInductor) path, model weights are allocated without considering the Non-Uniform Memory Access (NUMA) topology: specifically, the affinity between memory banks and compute cores is disregarded. This causes a substantial fraction of weight accesses to traverse the inter-socket interconnect, severely degrading the effective memory bandwidth available to each socket. We address this bottleneck through a compiler-level solution that makes TorchInductor NUMA-aware. Treating each NUMA socket as an independent tensor-parallel partition, we introduce NUMA-aware Tensor Parallelism (NUMA-TP). This approach transparently shards weights across sockets and schedules compute kernels such that thread pools and memory allocations remain strictly local to their respective sockets using CPU affinity. We evaluate the approach on GPT-2 (117M, 345M, 762M) and BERT (Small, Large), which exercise standard multi-head attention and MLP, as well as Gemma 3 270M, which combines Multi-Query Attention with a GeGLU-gated MLP. By strictly enforcing data locality, our approach successfully mitigates cross-socket traffic, achieving prefill speedups of up to 2.63x on a dual-socket Haswell platform, up to 1.87x on a dual-socket Cascade Lake platform, and up to 2.27x on a four-socket Haswell-EX platform.

中文要点

多路 CPU 上的 LLM prefill:参数放不进片上缓存时,吞吐受可持续 DRAM 带宽限制,而 TorchInductor 默认分配权重不看 NUMA 拓扑,大量权重访问要跨槽位互连。NUMA-Torch 在编译器层解决:把每个 socket 当独立张量并行分区(NUMA-TP),按槽位分片权重,用 CPU 亲和让线程池与内存分配严格本地化。GPT-2/BERT/Gemma 3 270M 上消除跨槽流量:双路 Haswell 最高 2.63x、双路 Cascade Lake 1.87x、四路 Haswell-EX 2.27x prefill 加速。

Field Notes

  • CPU prefill 是带宽问题而非算力问题;编译器层 NUMA 感知即可兑现 2x 量级加速