What happened
Tensor parallelism and expert parallelism are techniques designed to overcome the computational bottlenecks associated with scaling up deep learning models, particularly large language models (LLMs). Tensor parallelism aims to improve this by distributing matrix multiplications—the core building blocks of transformer layers—across multiple GPUs.
The core idea is to divide these matrices so that each GPU only handles a portion of the calculation, dramatically reducing communication overhead. As noted in Megatron-LM, partitioning GEMM operations column-wise and row-wise allows for single all-reduce steps per block, minimizing synchronization and improving throughput. Expert parallelism addresses the issue within mixture-of-experts (MoE) layers, where an MLP is replaced by numerous smaller experts. These experts are then distributed across GPUs to allow independent computation on different parts of the data.
Why it matters
The ability to train larger models efficiently is paramount in the current AI landscape. LLMs are demanding increasingly more computational resources and time to train.
Tensor parallelism and expert parallelism represent critical advancements that directly address this scalability challenge, enabling researchers and developers to tackle more complex problems and achieve state-of-the-art performance with substantially greater model sizes.
But, but, but…
The effectiveness of these techniques relies heavily on communication infrastructure. The source highlights the significant impact of NVLink (Nvidia’s high-speed interconnect) compared to technologies like InfiniBand.
A 43% throughput drop was measured when moving off NVLink, underscoring its crucial role in minimizing synchronization latency. This dependence on optimized inter-GPU communication is a critical point often overlooked in discussions about model parallelism; it's not just about splitting the work but also how quickly GPUs can exchange information.
““By partitioning a block’s first GEMM column-wise and its second GEMM row-wise, the GPUs only need to synchronize via all-reduce once per block…””
— Dr Non
The counter-take
The emphasis on specific GPU interconnect technologies (NVLink vs InfiniBand) often overshadows broader architectural considerations for scaling deep learning models. While NVLink is demonstrably superior in this specific case, future advancements may shift the balance between different interconnection options based on evolving hardware and software trends.
The AI angle
AI advancements are driving a shift toward specialized hardware architectures—such as GPUs and custom interconnects—to handle increasingly complex computations and facilitate rapid progress in machine learning. The ability to efficiently scale model training has an asymmetric effect, favoring the organizations with access to high-performance computing infrastructure, which concentrates AI development.
