NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Maya: Optimizing Deep Learning Training Workloads using Emulated Virtual Accelerators

Srihas Yarlagadda, Amey Agrawal, Elton Pinto, Hakesh Darapaneni, Mitali Meratwal, Shivam Mittal, Pranavi Bajjuri, Srinivas Sridharan, Alexey TumanovarXiv 2025 · DOI

Introduction

Training modern foundation models, such as GPT-4 or Llama-3, has become a monumental engineering challenge. These models require parallelizing computation across thousands of GPUs, often incurring costs in the hundreds of millions of dollars. To maximize hardware utilization and minimize waste, engineers must navigate a complex landscape of parallelization strategies—including tensor, pipeline, and data parallelism—alongside memory optimizations like activation checkpointing and ZeRO.

Finding the optimal "recipe" for these configurations is notoriously difficult. Trial-and-error on production-scale clusters is prohibitively expensive, yet the cost of a sub-optimal configuration can lead to millions of dollars in wasted compute. Maya addresses this challenge by providing a transparent device emulation framework that allows for accurate performance prediction and automated configuration tuning without the need for physical GPU clusters.

The Challenge: The Semantic Gap

To avoid the costs of physical testing, researchers have previously developed performance simulators such as Calculon, AMPed, and Proteus. However, these tools suffer from a fundamental "semantic gap." They typically require users to manually translate PyTorch code into custom, tool-specific specification languages. During this translation, subtle framework-level optimizations and implementation details are often lost, leading to inaccurate predictions—sometimes off by as much as 1000%.

This creates a difficult trade-off: existing tools are either easy to use but restricted to specific model architectures, or general-purpose but too complex to configure accurately. Maya eliminates this trade-off by operating at the "narrow waist" of the software stack: the CUDA API.

System Design and Methodology

Maya introduces transparent device emulation, a technique that allows unmodified training scripts to run in a virtualized environment. The system is built on four primary pillars:

1. API Interception

Maya uses LD_PRELOAD to intercept CUDA API calls from standard training scripts. Instead of executing these calls on real GPUs, Maya treats compute kernels as "no-ops." It skips the actual mathematical computations while meticulously tracking the device state, memory allocations, and synchronization events on the host CPU. This allows Maya to capture the exact sequence of operations a real program would execute.

2. Worker Deduplication

Simulating massive clusters (e.g., 16,000 GPUs) would normally impose massive CPU overhead. Maya overcomes this through worker deduplication. By hashing operation sequences, Maya identifies workers performing identical tasks—such as different ranks in a data-parallel setup. It then stops emulating redundant workers, focusing resources only on unique execution paths. This allows a single CPU node to simulate hyperscale deployments.

3. End-to-End Simulation

The execution traces generated during emulation are fed into a discrete-event simulator. Maya utilizes Random Forest regressors, trained on hardware microbenchmarks, to predict the runtime of individual kernels and network collectives. This hybrid approach combines the accuracy of trace-based simulation with the speed of machine learning-based performance modeling.

To find the best configuration, Maya includes an automated tuning engine. It explores the configuration space using algorithms like CMA-ES and employs "fidelity-preserving pruning." For instance, if a specific configuration results in an Out-of-Memory (OOM) error, Maya intelligently skips evaluating even more memory-intensive variations of that setup, drastically accelerating the search process.

Key Insights: The Decoupled Control Flow

The core insight enabling Maya is that the control flow of deep learning training scripts on the CPU rarely depends on the actual numerical results of GPU computations. Because the logic of "what to do next" is decoupled from the math of "what the gradient is," Maya can return dummy tensors and still maintain a faithful representation of the workload's execution logic. This bypasses the need for manual model translation and ensures that framework-specific optimizations (like torch.compile or FSDP) are captured automatically.

Evaluation and Results

Maya was evaluated against real-world deployments on NVIDIA H100, V100, and A40 clusters using models ranging from ResNet152 to the GPT-3 family (up to 145.6B parameters).

  • High Fidelity: Maya achieves a prediction error of less than 5% for end-to-end training runtimes across diverse models and hardware setups.
  • Cost Efficiency: By identifying optimal configurations that baseline tools missed, Maya reduced training costs by up to 56% compared to configurations suggested by Proteus, Calculon, or AMPed. In most cases, Maya's suggested configuration was within 2% of the true theoretical optimal.
  • Search Speed: The automated search engine can evaluate thousands of potential configurations and identify a near-optimal setup in under an hour on a single CPU node.
  • Scalability: Through deduplication, Maya successfully simulated the scaling behavior of clusters containing up to 16,000 GPUs.

Limitations and Future Work

While highly effective, Maya has specific limitations. It struggles with dynamic control flow where CPU logic does depend on GPU values, such as certain implementations of Mixture-of-Experts (MoE) models. Additionally, it does not currently model fine-grained Streaming Multiprocessor (SM) contention when compute and network kernels compete for the same hardware resources simultaneously. Finally, because it relies on host-side timing for CPU overheads, significant performance differences between the emulation CPU and the target cluster CPU can introduce minor inaccuracies.

Conclusion

Maya represents a significant step forward in making large-scale AI training more accessible and efficient. By bridging the semantic gap through transparent emulation, it provides engineers with a high-fidelity "digital twin" of their GPU clusters, enabling massive cost savings and faster deployment cycles for the next generation of foundation models.

Summary updated

BibTeX
@misc{yarlagadda2025maya,
  author = {Srihas Yarlagadda and Amey Agrawal and Elton Pinto and Hakesh Darapaneni and Mitali Meratwal and Shivam Mittal and Pranavi Bajjuri and Srinivas Sridharan and Alexey Tumanov},
  title = {{Maya: Optimizing Deep Learning Training Workloads using Emulated Virtual Accelerators}},
  year = {2025},
  eprint = {2503.20191},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.20191},
}
Figure