{"slug": "reducing-high-bandwidth-memory-bottlenecks-in-jax-based-llm-training-with-host", "title": "Reducing High-Bandwidth Memory Bottlenecks in JAX-Based LLM Training with Host Offloading", "summary": "NVIDIA and Google researchers have developed a host offloading technique in JAX that reduces high-bandwidth memory bottlenecks during LLM training, achieving up to 57% throughput improvements on NVIDIA GB200 NVL72 systems by moving selected activations to pinned host memory and overlapping transfers with GPU computation.", "body_md": "Large language model (LLM) training workloads increasingly run into GPU memory limits before compute is fully used. Model weights, gradients, optimizer states, communication buffers, and intermediate activations all compete for GPU high-bandwidth memory (HBM). As model size, sequence length, and batch size grow, HBM capacity often becomes the primary scaling bottleneck.\n\nThis post explains how host offloading in the open source Python library [JAX](https://github.com/jax-ml/jax) reduces HBM pressure. This process, which is especially advantageous on [NVIDIA Blackwell](https://www.nvidia.com/en-us/data-center/technologies/blackwell-architecture/), moves selected activations to pinned host memory during the forward pass and streams them back when needed in the backward pass. Host offloading is an alternative to [activation rematerialization](https://docs.jax.dev/en/latest/gradient-checkpointing.html). Instead of recomputing selected activations, the training step reloads them from host memory.\n\n## Why is host offloading advantageous on NVIDIA Grace Blackwell systems?\n\nHost offloading is especially advantageous on [NVIDIA Grace Blackwell](https://www.nvidia.com/en-us/data-center/technologies/blackwell-architecture/) systems. The NVIDIA Grace CPU and NVIDIA Blackwell GPU are connected through NVLink-C2C with 900 GB/s of bidirectional bandwidth, making pinned host memory a practical staging area for selected activations. The Vera CPU and Rubin GPU further improve on this by doubling the bidirectional speed to 1.8 TB/s of coherent bandwidth.\n\nHigh-bandwidth CPU-GPU connectivity helps make host offloading practical, but bandwidth alone is not enough. To improve performance, activation transfers must overlap with useful GPU work.\n\n## Performance results on MaxText workloads\n\nThe experiments use [MaxText](https://github.com/AI-Hypercomputer/maxtext), a JAX LLM training framework that uses the [Accelerated Linear Algebra (XLA)](https://github.com/openxla/xla) compiler for training at scale on NVIDIA GPUs. All results were measured on [NVIDIA GB200 NVL72](https://www.nvidia.com/en-us/data-center/gb200-nvl72/) systems using 128 GPUs.\n\nThe evaluation uses two MaxText workloads. [Llama 3.1 405B](https://ai.meta.com/blog/meta-llama-3-1/) is a dense decoder-only transformer model used to study targeted query, key, and value (QKV) activation offloading at a fixed batch size. [DeepSeek-V3 671B](https://arxiv.org/abs/2412.19437) is a sparse mixture-of-experts (MoE) model with multihead latent attention (MLA), used to study both throughput and memory-capacity effects.\n\n### DeepSeek-V3 671B offloading policy\n\nDeepSeek-V3 671B has 61 decoder layers: the first three use dense multilayer perceptron (MLP) blocks, while the remaining layers use MoE blocks.\n\nFigure 1 shows the activation offloading policy for the repeated MoE decoder layer, which dominates the stack. The first three dense MLP layers are not shown; they use a similar policy, with selected up and down projection outputs offloaded.\n\nIn the MoE layer shown in Figure 1, the policy offloads selected MLA query and key/value projection intermediates and selected MoE up projection intermediates. These activations are large enough to impact whether larger batch configurations fit.\n\n### Training throughput improvements\n\nMaxText reports throughput as TFLOPs/s/device, computed from model FLOPs per training step divided by measured step time.\n\n#### DeepSeek-V3 671B\n\nFigure 2 compares DeepSeek-V3 671B throughput across activation placement policies. With offloading, LHS, and pipelined transfers enabled, the workload reached 908.2 TFLOPs/s/device. This was 57% faster than activation rematerialization at the same batch configuration and 67.7% faster than offloading without LHS or pipelining.\n\nUnlike the dense Llama workload where LHS alone was sufficient to hide latency, the massive activation footprint of DeepSeek-V3 MoE and MLA layers means that enabling pipelined transfers provides a distinct, positive impact on total throughput.\n\nThese performance leaps highlight a fundamental NVIDIA advantage: the tight co-design of software and hardware. In a typical commodity cluster, streaming massive MoE activation layers to host memory would stall the entire training pipeline. On Blackwell, XLA custom scheduling flags work hand-in-hand with the hardware to ensure data is moved asynchronously over dedicated copy streams.\n\nThis enables NVIDIA platforms to unlock massive batch configurations that remain completely out of reach for architectures lacking this tight compiler-to-interconnect integration.\n\n### Increasing feasible batch size\n\nHost offloading can also change which batch configurations are feasible. Table 1 shows DeepSeek-V3 671B results across activation placement policies.\n\nNo | Config | Micro batch | Global batch | Throughput (TFLOPs/s/device) | GPU peak (GiB) | Host memory (GiB) |\n1 | Host offload, LHS, pipelined offloading | 8 | 1024 | 908.2 | 165.2 | 145.1 |\n| 2 | No offload, LHS, activation rematerialization | 8 | 1024 | 578.3 | 151.3 | 0.0 |\n| 3 | Host offload, no LHS, no pipelined offloading | 8 | 1024 | 541.6 | 145.6 | 145.1 |\n| 4 | No offload, LHS, save on device | 2 | 256 | 425.3 | 113.3 | 0.0 |\n| 5 | No offload, LHS, save on device | 8 | 1024 | – | OOM | 0.0 |\n\n*Table 1. DeepSeek-V3 671B comparison across activation placement policies*\n\nRows 4 and 5 show the capacity comparison. Saving selected activations on device fit micro batch 2 and global batch 256, while optimized host offloading fit micro batch 8 and global batch 1024. Without using either offloading or rematerialization, the device will hit an Out-of-Memory (OOM) error when attempting to use a micro batch size of 8 and global batch size of 1024.\n\nHost offloading made the micro batch 8, global batch 1024 configuration feasible by moving selected activation storage out of GPU memory. In this DeepSeek configuration, the offload policy targets large intermediate activations from MLA, MoE, and MLP blocks. Keeping those activations on device limits the feasible batch configuration, while offloading them leaves more HBM available for model state, communication buffers, runtime workspaces, and active computation.\n\nWith LHS and pipelined transfers enabled, the offload run uses 165.2 GiB of GPU memory, compared with 145.6 GiB without those optimizations. The increase comes from keeping more copy buffers and prefetched activations in GPU memory while transfers overlap with computation. This extra HBM use trades some memory capacity for better overlap and higher throughput.\n\n#### Llama 3.1 405B\n\nThe Llama 3.1 405B experiment ran 10 steps on synthetic data with batch size 2, sequence length 8,192, fully sharded data parallelism (FSDP) set to 128, and bfloat16 activations with [NVFP4](https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-inference/) 4-bit weight quantization.\n\nAs shown in Table 2, QKV activation offloading with Latency Hiding Scheduler (LHS) improved throughput from 2,669 to 2,746 TFLOPs/s/device, a 2.9% increase over the baseline without offloading. Disabling LHS reduced QKV offload throughput to 2,569 TFLOPs/s/device, highlighting that host offloading depends on effective overlap with other GPU work.\n\nConfig | LHS | Pipelined offloading | Throughput (TFLOPs/s/device) | GPU peak memory (GiB) | Host memory (GiB) |\n| No offload | ON | OFF | 2,669 | 149.6 | 0 |\n| QKV offload | ON | OFF | 2,746 | 149.9 | 70.9 |\n| QKV offload | OFF | OFF | 2,569 | 139.7 | 70.9 |\n| QKV offload | ON | ON | 2,718 | 151.0 | 70.9 |\n\n*Table 2. Llama 3.1 405B throughput and memory across activation placement configurations*\n\nFor this Llama 3.1 405B run, LHS alone provided the best throughput: 2,746 TFLOPs/s/device without pipelining compared with 2,718 TFLOPs/s/device with pipelining. In this configuration, LHS already hides most transfer latency behind compute and communication, leaving little exposed latency for pipelining to hide.\n\nThe 70.9 GiB host memory value is the total QKV activation storage across all 126 layers, not the amount of GPU memory saved at a single moment. At batch size 2 and sequence length 8,192, one layer’s bfloat16 QKV activations require about 576 MiB: 512 MiB for query and 32 MiB each for key and value.\n\nWith the scan loop enabled for layers (scan_layers=True), the backward pass processes one layer at a time, so QKV activations of only one layer are needed on the GPU at once. In this workload, QKV offloading is mainly a performance optimization: it replaces backward pass QKV rematerialization with transfers that can overlap with compute and communication. GPU peak memory remains dominated by model state, communication buffers, and runtime workspaces.\n\nLlama 3.1 405B provides a dense-model fixed-batch example. The gain is smaller than DeepSeek V3 671B, but it shows the same mechanism: targeted QKV offloading replaces backward-pass rematerialization with transfers that overlap with compute and communication.\n\n## When is host offloading most useful?\n\nHost offloading is most useful when GPU memory limits model size, sequence length, or batch size, and when selected tensors are large enough to reduce HBM pressure. It is especially useful when offloading can replace expensive activation rematerialization or make a larger batch configuration feasible.\n\nPerformance depends on overlap. Host offloading works best when the workload has enough compute, communication, or other independent work to hide transfer latency. On NVIDIA GPUs, XLA helps create this overlap by using dedicated copy streams, scheduling transfers with LHS, and enabling pipelined host offloading.\n\nThis pipeline is particularly advantageous on platforms like the NVIDIA Blackwell GB200 and NVIDIA Blackwell Ultra GB300, which leverage dedicated NVLink-C2C interconnect to bypass traditional PCIe bottlenecks entirely. With the [NVIDIA Vera Rubin platform](https://www.nvidia.com/en-us/data-center/technologies/rubin/) delivering even higher interconnect performance, host offloading provides a predictable architectural lever for decoupling training throughput from strict physical memory limits.\n\nHost offloading is less likely to help when tensors are small, when little independent work is available to overlap transfers, or when the workload is bottlenecked somewhere other than memory. Runtime memory should still be validated with real runs because static estimates may not include [NVIDIA Collective Communications Library (NCCL)](https://developer.nvidia.com/nccl) communication scratch space, [NVIDIA cuDNN](https://developer.nvidia.com/cudnn) attention workspace, and framework-managed buffers.\n\n## How to get started with host offloading\n\nStart with a small representative JAX training run. Choose large activations from expensive forward paths, enable offloading, and measure runtime GPU memory, host memory use, and end-to-end step time.\n\nFor open source JAX APIs, see the [JAX host offloading tutorial](https://jax.readthedocs.io/en/latest/notebooks/host-offloading.html). It covers activation offloading with jax.remat, checkpoint policies, and memory_kind=”pinned_host”, as well as parameter and optimizer state offloading with jax.device_put().\n\nThe MaxText experiments in this post used the [NGC JAX container](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/jax). The DeepSeek-V3 671B runs used [ghcr.io/nvidia/jax:deepseek_v3_maxtext](http://ghcr.io/nvidia/jax:deepseek_v3_maxtext), a customized container with additional MaxText integration for [Transformer Engine](https://github.com/NVIDIA/TransformerEngine) MoE permutation optimizations.\n\nThe optimized offload configurations used the following XLA flags:\n\n```\n--xla_gpu_enable_latency_hiding_scheduler=true\n--xla_gpu_enable_pipelined_host_offloading=true\n--xla_gpu_experimental_parallel_async_compute_limit=8\n```\n\nThe last setting increases the amount of asynchronous work that can be in flight, giving LHS more room to overlap activation copies and NCCL collectives. Use profiling tools such as [NVIDIA Nsight Systems](https://developer.nvidia.com/nsight-systems) to confirm that device-to-host and host-to-device copies overlap with compute and NCCL communication.\n\n## Learn more\n\nHost offloading is a strong fit when HBM capacity limits batch size, context length, or model scale, and when selected activations are large enough to reduce GPU memory pressure. It is most effective when it replaces expensive activation rematerialization or makes a larger batch configuration feasible.\n\nTreat host offloading as a memory placement choice that should be validated with measurements. Choose large activations, enable overlap with LHS and pipelined host offloading, and profile both runtime memory and step time.\n\nWhile the results presented in this post focus on Llama 3.1 405B and DeepSeek-V3 671B, the same approach can help other JAX workloads when selected activations are large enough to matter and transfer cost can overlap with useful computation.\n\nTo run JAX on NVIDIA GPUs, [NVIDIA JAX-Toolbox](https://github.com/NVIDIA/JAX-Toolbox) provides maintained containers, documentation, and optimized JAX and MaxText examples.\n\n### Acknowledgments\n\n*We would like to thank Jaroslav Sevcik, Sevin Varoglu, Tj Xu, Haixin Liu, Abhinav Goel, Md Fahim Faysal Khan, Stefano Bosisio, and Jinxin Yang for their technical contributions.*", "url": "https://wpnews.pro/news/reducing-high-bandwidth-memory-bottlenecks-in-jax-based-llm-training-with-host", "canonical_source": "https://developer.nvidia.com/blog/reducing-high-bandwidth-memory-bottlenecks-in-jax-based-llm-training-with-host-offloading/", "published_at": "2026-07-10 18:17:40+00:00", "updated_at": "2026-07-10 18:38:36.931141+00:00", "lang": "en", "topics": ["machine-learning", "large-language-models", "ai-infrastructure", "ai-research", "developer-tools"], "entities": ["JAX", "NVIDIA", "Google", "NVIDIA Blackwell", "NVIDIA Grace Blackwell", "NVIDIA GB200 NVL72", "MaxText", "XLA"], "alternates": {"html": "https://wpnews.pro/news/reducing-high-bandwidth-memory-bottlenecks-in-jax-based-llm-training-with-host", "markdown": "https://wpnews.pro/news/reducing-high-bandwidth-memory-bottlenecks-in-jax-based-llm-training-with-host.md", "text": "https://wpnews.pro/news/reducing-high-bandwidth-memory-bottlenecks-in-jax-based-llm-training-with-host.txt", "jsonld": "https://wpnews.pro/news/reducing-high-bandwidth-memory-bottlenecks-in-jax-based-llm-training-with-host.jsonld"}}