TL;DR
mKernel is an open-source library that breaks through the single-node boundary for fused GPU kernels, overlapping computation, intra-node NVLink communication, and inter-node RDMA at fine-grained tile granularity. By dynamically partitioning streaming multiprocessors (SMs) at runtime and utilizing a portable host proxy, it achieves up to 1.88× speedups over standard unfused baselines across tensor, sequence, and expert parallelism workloads.
What Problem Does This Paper Address?
As large language models (LLMs) and Mixture-of-Experts (MoE) architectures scale, distributed training and inference are increasingly bottlenecked by communication. While modern hardware provides massive intra-node bandwidth (like NVIDIA NVLink), the network bandwidth between different nodes (via InfiniBand or AWS EFA) is significantly lower—often by an order of magnitude.
To hide this latency, developers use kernel fusion to overlap computation with communication. However, existing fused kernels are largely confined to a single node. Extending fusion across multiple nodes is incredibly challenging due to:
- Bandwidth Asymmetry: The massive gap between intra-node and inter-node speeds.
- Granularity Mismatches: Compute kernels operate on fine-grained memory "tiles," whereas network interfaces (NICs) prefer larger message chunks to amortize overhead.
- Transport Semantics: Different network backends offer varying ordering and delivery guarantees.
Consequently, most state-of-the-art systems fall back on coarse-grained, multi-stream pipelines that stall at kernel boundaries.
Methods
The authors introduce mKernel, a library designed around four core principles to coordinate tile-level progress across both local and remote networks:
- SM Specialization & Dynamic Partitioning: Instead of forcing all GPU Streaming Multiprocessors (SMs) to do the same task, mKernel splits them into dedicated roles: compute, intra-node communication, inter-node send, and inter-node receive. An on-GPU controller monitors progress and dynamically reallocates SMs at runtime to prevent bottlenecks.
- Hierarchical Data Movement: To protect the slower inter-node network, mKernel aggregates or reduces data locally within a node via NVSwitch before sending a single combined message to a "rail peer" (a GPU with the same index on a remote node).
- Portable Host-Assisted Communication: Rather than relying on heavy communication frameworks like NCCL or NVSHMEM, mKernel uses a lightweight host CPU proxy implemented directly on
libibverbsRDMA verbs. This allows the exact same GPU kernel to run seamlessly on both InfiniBand and AWS EFA backends. - Decoupled Granularities: Compute tiles and network chunks are sized independently. For example, multiple locally reduced tiles are grouped into a larger network chunk to minimize per-message network overhead without delaying the underlying GEMM computation.
Datasets
As a systems-level paper, mKernel is not trained on traditional datasets. Instead, it is evaluated using synthetic workloads and problem sizes that mimic standard distributed deep learning operations:
- Tensor Parallelism (TP): AllGather+GEMM, GEMM+ReduceScatter, GEMM+AllReduce.
- Sequence Parallelism (SP): Ring Attention.
- Expert Parallelism (EP): MoE Dispatch+GEMM.
Key Insights and Ideas
- The GPUDirect Async Surprise: Surprisingly, the authors found that GPUDirect Async (IBGDA)—which allows the GPU to drive the NIC directly—yields little to no performance benefit over their host-assisted proxy approach. This is because IBGDA requires expensive system-scoped GPU memory fences and doorbells for every network chunk, which negates its latency advantages in throughput-bound workloads.
- Static Partitions Fail Heterogeneous Workloads: A static sweep of SM allocations shows that the optimal compute-to-communication split varies wildly depending on the problem size and kernel type. mKernel’s runtime adaptive controller successfully tracks these shifting minima without requiring offline profiling.
Key Results
mKernel was evaluated on two 16-GPU NVIDIA H200 clusters: one connected via InfiniBand (ConnectX-7) and the other via AWS EFA.
Compared to standard unfused baselines (cuBLAS/FlashAttention followed by NCCL collectives), mKernel achieved substantial performance gains:
- GEMM+AllReduce: Up to 1.53× speedup on EFA and 1.72× on InfiniBand.
- Ring Attention: Up to 1.78× speedup on EFA and 1.88× on InfiniBand.
- MoE Dispatch+GEMM: Up to 3.1–4.5× speedup on EFA by optimizing expert organization alongside communication overlap.
Additionally, mKernel consistently outperformed other specialized communication-overlapping frameworks like Triton-distributed, Flux, Mercury, and MagiAttention across most configurations.
Limitations and Future Work
While highly effective, mKernel currently has a few limitations:
- Single-Node Adaptive Tuning: Due to cluster testbed constraints, the dynamic SM partitioning controller was only evaluated on single-node environments. Validating its stability and performance across multi-node scaling remains future work.
- Manual Kernel Implementation: The library currently provides five specific hand-fused kernels. Integrating mKernel’s scheduling principles into an automated compiler framework (like Triton or a specialized deep learning compiler) would make these multi-node optimizations accessible to a broader range of deep learning operators.
Summary updated