Skip to main content

MegaTrain: Full Precision Training of 100B+ Parameter Large Language Models on a Single GPU

AuthorsZhengqing Yuan et al.
Year2026
HF Upvotes43
arXiv2604.05091
PDFDownload
HF PageView on Hugging Face

Abstract

We present MegaTrain, a memory-centric system that efficiently trains 100B+ parameter large language models at full precision on a single GPU. Unlike traditional GPU-centric systems, MegaTrain stores parameters and optimizer states in host memory (CPU memory) and treats GPUs as transient compute engines. For each layer, we stream parameters in and compute gradients out, minimizing persistent device state. To battle the CPU-GPU bandwidth bottleneck, we adopt two key optimizations. 1) We introduce a pipelined double-buffered execution engine that overlaps parameter prefetching, computation, and gradient offloading across multiple CUDA streams, enabling continuous GPU execution. 2) We replace persistent autograd graphs with stateless layer templates, binding weights dynamically as they stream in, eliminating persistent graph metadata while providing flexibility in scheduling. On a single H200 GPU with 1.5TB host memory, MegaTrain reliably trains models up to 120B parameters. It also achieves 1.84times the training throughput of DeepSpeed ZeRO-3 with CPU offloading when training 14B models. MegaTrain also enables 7B model training with 512k token context on a single GH200.


Engineering Breakdown

Plain English

MegaTrain is a system that trains 100B+ parameter language models at full precision using a single GPU by reversing the traditional compute paradigm—instead of keeping parameters on the GPU, it stores them in CPU memory and streams them in as needed. The core innovation is treating GPUs as temporary compute engines rather than permanent parameter storage, combined with pipelined double-buffering that overlaps parameter fetching, computation, and gradient offloading to hide the CPU-GPU bandwidth bottleneck. This approach enables full-precision training of massive models on consumer hardware by eliminating the need for model parallelism or quantization, which typically compromises accuracy or adds implementation complexity.

Core Technical Contribution

The paper's core technical novelty is inverting the memory hierarchy assumption in GPU training—moving persistent state (parameters, optimizer states) to CPU memory while using GPU memory only transiently during forward/backward passes. The authors introduce a pipelined double-buffered execution engine using multiple CUDA streams that overlaps three operations (prefetch, compute, offload) to saturate GPU compute while hiding memory transfer latency. They also replace PyTorch's traditional autograd graphs (which require keeping the entire computation graph in memory) with stateless layer templates that bind weights dynamically during streaming, eliminating graph materialization overhead. This combination of architectural redesign and execution optimization enables single-GPU training without model parallelism, quantization, or other distributed techniques.

How It Works

The system works in layers: for each transformer layer, MegaTrain initiates a prefetch of layer weights from CPU to GPU using one CUDA stream while a second stream executes the forward pass on previously-prefetched weights, and a third stream offloads computed gradients back to CPU memory. Once gradients are available, optimizer updates (momentum, weight updates) happen on the CPU side, then the system moves to the next layer, repeating this three-stream coordination pattern. Rather than building a full autograd DAG before execution, the system uses lightweight layer templates that specify the computation structure but not the actual weight values—weights are bound at runtime as they stream in, dramatically reducing memory overhead. The double-buffering ensures that while the GPU is computing on layer N, layer N+1's parameters are already being prefetched and layer N-1's gradients are being offloaded, creating a pipeline with minimal GPU idle time. Batch size and layer structure are tuned so that the GPU compute time roughly matches the CPU-GPU bandwidth time, preventing the network from becoming the critical bottleneck.

Production Impact

For organizations building LLM training infrastructure, MegaTrain could eliminate the need for multi-GPU setups or expensive model parallelism frameworks for models up to 100B+ parameters, reducing hardware costs dramatically and simplifying the training pipeline. A team could train flagship models on single high-end GPUs (H100, A100) without integrating complex frameworks like DeepSpeed or FSDP, shortening iteration cycles during model development and reducing debugging surface area. The trade-off is CPU-GPU interconnect latency becomes critical—you need high-bandwidth connections (PCIe 5.0 or direct NVLink preferred) and cannot train on cloud instances with slow network connections. Gradient computation and parameter updates move to CPU, so you lose the ability to use GPU-native optimizers or advanced training techniques that assume on-device state; integration with existing training frameworks like Hugging Face Trainer would require custom backends. Memory requirements shift from 'all parameters on GPU' to 'all parameters on CPU + optimizer state on CPU + activations on GPU', so you need sufficient CPU RAM (200GB+) but can train with modest GPU memory (40-80GB).

Limitations and When Not to Use This

The approach assumes high-bandwidth CPU-GPU connectivity; on slower interconnects (standard PCIe 4.0, distant cloud GPUs), the prefetch/offload overhead would dominate and make training slower than traditional dense GPU clusters. The paper does not address multi-GPU setups—extending this to tensor-parallel or pipeline-parallel training across multiple GPUs is non-trivial because the streaming semantics change, and you lose the simplicity of the single-GPU case. It also requires careful tuning of batch size and layer structure to balance GPU computation time with memory transfer time; a poorly-tuned configuration will have GPU stalls or network saturation, negating the benefit. The stateless layer template approach may not generalize to non-standard architectures (mixture-of-experts, complex attention patterns, dynamic computation graphs) without significant redesign. Finally, no comparison to quantization-based approaches (4-bit, 8-bit) is provided—those methods can also fit large models on single GPUs with faster compute, so the speed/accuracy trade-off versus MegaTrain is unclear.

Research Context

MegaTrain builds on a growing line of work challenging the GPU-centric training paradigm, including ZeRO and other gradient checkpointing techniques that spill state to CPU to save memory, but takes the idea much further by making CPU storage the primary assumption rather than a fallback. It relates to recent work on tensor streaming and activation offloading (e.g., Megatron-LM's pipeline parallelism, vLLM's memory management), but differs by focusing on training rather than inference and by treating the entire parameter set as streamed rather than a subset. The paper targets the training efficiency benchmark of 'time to train 100B models,' where prior work typically used 8-16 GPUs or relied on quantization; single-GPU full-precision training at competitive speed would be a significant benchmark improvement. The work opens a research direction on memory-centric system design for ML, potentially enabling future work on heterogeneous compute (training parts on CPU, parts on GPU, parts on other accelerators).


:::tip Subscribe Get weekly breakdowns of papers like this in AI Letters - the newsletter for engineers building production AI systems. :::


Back to Research Lab → · Subscribe to AI Letters →

© 2026 EngineersOfAI. All rights reserved.