张量并行是把模型权重按维度切分到多张加速卡上、让每张卡只保存并计算一部分的并行技术,核心是把矩阵运算横向拆开并在层内做归约以换取单卡显存下降,能力包括按行或按列切分权重、按注意力头切分、层内集合通信协同以及与低精度训练组合。它解决的是单卡装不下模型权重与激活的问题,并不解决跨机通信带宽不足的问题。
张量并行的核心是用切分换显存,它可以帮助企业实现以下目标:
让单卡显存占用随切分规模下降。权重被平均分摊到多张卡上,模型规模的增长不再受限于单卡容量。
让训练与推理用同一套路径。大规模训练部署与在线推理服务复用同一套切分与通信实现,模型上线的迁移成本被压低。
让硬件互联优势被真正利用。在高速互联域内完成层内归约,切分带来的通信延迟被控制在可接受范围。
让大规模模型能真正跑起来。千亿参数级别的模型得以在集群上完成训练与部署,验证与推理服务具备可操作的前提,集群资源也能被充分盘活。
总之,张量并行可以帮助企业用多卡协同突破单卡容量瓶颈,把超大模型的训练与推理落地从理论可行变为工程可行,并保持训练与推理路径的一致以降低运维复杂度,同时需要按硬件拓扑精细选择切分比例,避免过细切分带来通信占比反升。
翻译
Tensor parallelism splits model weights along a dimension across several accelerator cards so that each card holds and computes only part of them. Its core is breaking matrix computation apart horizontally and reducing within a layer in exchange for lower per-card memory, with capabilities covering row and column weight splitting, splitting by attention head, in-layer collective communication and combination with low-precision training. It solves the problem of model weights and activations not fitting on a single card, but it does not solve the problem of insufficient interconnect bandwidth across machines.
At the heart of tensor parallelism is trading splitting for memory, which can help companies achieve the following:
Make per-card memory fall as the split scales. Weights are spread evenly over many cards, and growth in model size is no longer capped by the capacity of one card.
Let training and inference share one path. Large-scale training deployment and online inference reuse the same splitting and communication implementation, so the cost of moving a model into production falls.
Turn fast interconnect into real gains. In-layer reduction runs inside a high-speed interconnect domain, and the latency introduced by splitting is kept within an acceptable range.
Let very large models actually run. Models with hundreds of billions of parameters can be trained and served across a cluster, which is what makes validation and inference services a practical proposition.
In short, tensor parallelism can help enterprises break through the single-card capacity barrier with multi-card cooperation, turning the training and inference of very large models from theoretically possible into engineering reality, and keep training and inference on one path to reduce operational complexity, while choosing split ratios carefully for the hardware topology so that over-fine splitting does not let communication overhead grow instead.