Accelerating Long-Context Model Training in JAX and XLA

AI-generated summary of reporting by NVIDIA Developer Blog. Read the original for the full story.

Why it matters

Teams training long-context LLMs in JAX can now get up to 36% faster training on GB200 NVL72 systems just by enabling a runtime flag, with no code changes.

Read this as

NVIDIA has made an optimization called NVSHMEM part of the XLA compiler, the software that turns Google's JAX AI framework into GPU instructions. When AI models are trained on very long passages of text, computing must be split across many GPUs that constantly swap data; NVSHMEM handles those swaps faster than the standard NCCL library. Training Meta's Llama 3 8B model on 256,000-token sequences ran up to 36% faster. This matters mainly to engineering teams building or training large AI models, not everyday AI users.

Organizations training large language models with very long context windows could cut training costs meaningfully. NVIDIA's benchmark on Llama 3 8B showed 30-36% speedups for 256K-token sequences on GB200 NVL72 systems, with gains concentrated at 128K tokens and above; shorter sequences saw under 4%. The catch: the advantage applies to JAX users, requires newer NVIDIA hardware and multi-node deployments, and the feature is still flagged experimental. PyTorch-centric teams and smaller workloads gain little today.

NVIDIA integrated NVSHMEM into the XLA compiler so the CollectiveBackendAssigner pass automatically selects NVSHMEM for CollectivePermute operations and sub-16MB AllReduce under single-device, single-partition, or NVLink-domain heuristics. NVSHMEM's symmetric memory, stream-aware APIs, and CUDA Graphs capture suit ring attention's latency-critical point-to-point KV exchanges, offloading work to copy engines. Benchmarks: Llama 3 8B in MaxText on GB200 NVL72, up to 36.3% speedup at 256K tokens versus NCCL, 0.7-2.4% at 128K, 0.3-3.9% at 64K. Enabled via --xla_gpu_experimental_enable_nvshmem=true.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

NVSHMEM XLA NCCL JAX Llama 3 8B MaxText GB200 NVL72

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading