arXiv:2611.08660cs.DCNov 2026

Manuscript Offprint

arXiv:2611.08660

AutoParallel: Composable, PyTorch-Native Automatic Parallelism for Production Training

Kaijian Wang, Sanket Purandare, Aditya Venkataraman, Will Constable, Ivan Kobzarev, Elias Ellison, Simon Fan, Edward Z. Yang, Davide Italiano, Patrick Labatut, Yuke Wang, Francisco Massa

Kaijian Wang1,2,∗^{1,2,*}, Sanket Purandare1^{1}, Aditya Venkataraman1^{1}, Will Constable1^{1}, Ivan Kobzarev1^{1}, Elias Ellison1^{1}, Simon Fan1^{1}, Edward Z. Yang1^{1}, Davide Italiano1^{1}, Patrick Labatut1^{1}, Yuke Wang2^{2}, Francisco Massa1,†^{1,\dagger}

1^{1}Meta Superintelligence Labs, 2^{2}Rice University

†^{\dagger}Project lead, *Work done during an internship at Meta

Training large models requires multiple interacting forms of parallelism. As models and clusters scale, finding and maintaining efficient parallelization plans becomes essential for training performance. Diverse model architectures, workloads, and hardware topologies demand flexible strategies, yet production PyTorch systems typically rely on hand-written recipes that are costly to adapt and tend to reuse familiar patterns, which may be suboptimal for a given workload. We present AutoParallel, a PyTorch-native planner for distributed model training. AutoParallel searches parallelization choices jointly across the training computation, allowing established techniques to be combined and unconventional strategies to emerge. It expresses its decisions using native PyTorch abstractions and produces ordinary PyTorch programs, avoiding a separate execution runtime while composing directly with the PyTorch compilation and training stack. AutoParallel also composes automatic decisions with model-specific distributed code, allowing dynamic or specialized regions to remain under user control. Plans are inspectable and replayable artifacts. Across dense, hybrid, and mixture-of-experts models on meshes of up to four dimensions and 128 NVIDIA H100 GPUs, AutoParallel matches or exceeds expert-written TorchTitan recipes on most configurations, with throughput gains of up to 18.3%, and discovers plans that uniform expert recipes do not express.

Date: October 30, 2026

Code: https://github.com/meta-pytorch/autoparallel

Meta

1 Introduction

Model training has grown at an extraordinary pace. The Hugging Face Hub alone hosts over three million models (Tazi et al., 2025); inside organizations, teams routinely train and fine-tune models for tasks spanning natural language, vision, multimodal generation, and more. Widely adopted frameworks such as PyTorch (Paszke et al., 2019), combined with open model architectures and community libraries, have lowered the barrier to training models.

Achieving efficient training, however, is far from straightforward. Scaling model training beyond a single accelerator requires carefully combining multiple forms of parallelism, including Data Parallelism (Rajbhandari et al., 2020; Zhao et al., 2023), Tensor Parallelism (Shoeybi et al., 2019; Korthikanti et al., 2023), Context Parallelism (Liu et al., 2023a), Pipeline Parallelism (Huang et al., 2019; Narayanan et al., 2019), and Expert Parallelism (Fedus et al., 2022), together with system-level optimizations including activation recomputation (Chen et al., 2016; Korthikanti et al., 2023), mixed precision (Micikevicius et al., 2018), and deep learning compilers (Ansel et al., 2024). Moreover, identifying an effective training configuration is highly context-specific: it depends jointly on model architecture, workload shapes, and hardware topology (Narayanan et al., 2021).

Hand-tuning a distributed training recipe requires dedicated infrastructure expertise and iterative experimentation, and this cost is amortized only when a single configuration is reused across a long production run. In practice, this makes hand-optimization economical for a narrow regime: a small number of flagship models, each trained by a dedicated team over weeks or months. It does not scale to the broader landscape of model training, where researchers iterate on new architectures faster than recipes can be tuned, product teams train many models for different tasks without a dedicated infrastructure effort for each, and open-source practitioners need efficient training out of the box. A recent benchmarking study by Hugging Face (Tazi et al., 2025) illustrates the scale of this challenge: of 3,306 parallelism configurations for LLaMA models on up to 512 H100 GPUs, nearly half failed with out-of-memory errors, and the sweep cost approximately $469K while covering only a narrow slice of the configuration space.

A substantial body of prior work (Jia et al., 2019; Shazeer et al., 2018; Zheng et al., 2022; Xu et al., 2021; Miao et al., 2023; Jia et al., 2022; Unger et al., 2022; Lin et al., 2024, 2025) has demonstrated that automatic parallelization is feasible. Despite these advances, automatic parallelism has not replaced manual recipe development in practice. The key barriers are threefold: (1) many prior systems rely on non-PyTorch runtimes or specialized compiler stacks, placing them outside the frameworks most practitioners actually use; (2) they often produce opaque solutions that are difficult to inspect, modify, or debug, offering no guarantee of matching the quality of hand-tuned production recipes; and (3) they compose poorly with the optimizations that production training requires, including compilation, activation checkpointing, and mixed precision. Moreover, modern training recipes increasingly involve dynamic parallelism patterns, such as context parallelism and data-dependent expert routing in mixture-of-experts layers. These patterns require specialized communication primitives beyond static operator placement, and existing systems that operate on static computation graphs cannot readily support them. As a result, although PyTorch is widely used for both research and production training (Paszke et al., 2019; Ansel et al., 2024), PyTorch practitioners still lack an automatic path from model definition to efficient distributed training (§2.3, §7).

Figure

Figure 1 AutoParallel system overview. Colored boxes schematically illustrate tensor sharding, and bold outlines mark the strategy selected for each operator. The orange local_map region keeps its user-declared placements, and user constraints feed back into the search.

In this paper, we present AutoParallel, a PyTorch-native single-program, multiple-data (SPMD) planner for distributed model training that closes this gap. As Figure 1 shows, we add a planning layer between graph capture and plan materialization in the PyTorch stack: it enumerates valid DTensor placements for every operator in the joint forward-backward graph, selects one per operator under a hardware-aware cost model, and emits an ordinary PyTorch module that the existing compiler stack executes without a separate runtime (§5). For dynamic parallelism patterns such as context parallelism and mixture-of-experts, we provide composition boundaries that let manually parallelized regions interoperate with auto-planned computation (§5.3). AutoParallel is open source¹ (Meta PyTorch, 2026), has been presented at the PyTorch Conference (Massa et al., 2025; Purandare and Huang, 2026), and is integrated into TorchTitan's GraphTrainer for production training (PyTorch Team, 2026).

We evaluate AutoParallel on dense, hybrid, mixture-of-experts, and long-context workloads across multi-dimensional meshes and up to 128 NVIDIA H100 GPUs, comparing against expert-written TorchTitan (Liang et al., 2024) recipes under matched meshes and runtime optimizations (§6). AutoParallel matches or exceeds the expert recipes on most configurations without per-model tuning, and when the workload changes, replanning recovers the performance that a stale plan leaves behind. This paper makes the following contributions:

  • Graph-wide placement planning. We formulate SPMD parallelization as a single optimization over the joint forward-backward graph under a hardware-aware cost model. We introduce a scalable approximate

¹https://github.com/meta-pytorch/autoparallel solver that produces near-optimal plans on instances small enough to verify against an exact solver and scales to meshes where exact solving is infeasible.

  • Native recipe generation. We materialize decisions as an ordinary PyTorch program with no separate runtime and integrate it with TorchTitan's GraphTrainer (Purandare and Huang, 2026; PyTorch Team, 2026) for full-graph Inductor compilation with communication-computation overlap and collective bucketing.

  • Practical control and composition. We make plans inspectable and replayable, allow users to constrain placements, and compose them with user-controlled dynamic parallelism regions (context parallelism, mixture-of-experts) via explicit placement contracts (§3, §5).

  • Production evaluation. We report end-to-end performance against expert recipes, replanning across sequence lengths, planner scalability, and cost-model fidelity (§6 and Appendix B).

References (39)