ZOYKU火線榜

meta-pytorch/autoparallel技術文件

An experimental implementation of compiler-driven automatic sharding of models across a given device mesh.

多語言回退提示:當前倉庫原作者暫未發布在地化文件,已為您無縫切換至官方英文原版(English),排版及程式碼實例完整保真。
極速安裝
pip install autoparallel

AutoParallel

AutoParallel is a PyTorch library that automatically shards and parallelizes models for distributed training. Given a model and a device mesh, it uses linear programming to find an optimal sharding strategy (FSDP, tensor parallelism, or a mix) and applies it — no manual parallelism code required.

Early Development Warning — AutoParallel is experimental. Expect bugs, incomplete features, and APIs that may change. Bugfixes are welcome; please discuss significant changes in the issue tracker before starting work.

New to AutoParallel? Start with the Getting Started guide.

Requirements

Installing

# Via SSH
pip install git+ssh://[email protected]/meta-pytorch/autoparallel.git

# Via HTTPS
pip install git+https://github.com/meta-pytorch/autoparallel.git

Quick start

The simplest way to try AutoParallel is with a HuggingFace model. This runs entirely on a single machine using a fake process group — no multi-GPU setup needed:

pip install transformers
python examples/example_hf.py --model gpt2 --mesh 8

You should see log output ending with Forward + backward OK.

For more examples (LLaMA-3, distributed checkpointing, local_map / MoE), see the examples/ directory.

Documentation

Start here if you're new to AutoParallel:

Troubleshooting and common questions:

Deeper explanations and advanced topics:

Developing

# Run from the repository root
pip install -e .

Modified Python files are reflected immediately.

Run linters before submitting a PR:

pip install pre-commit
pre-commit run --all-files

Run tests (requires a CUDA GPU):

pip install -r requirements-test.txt
pytest tests/

License

AutoParallel is BSD-3 licensed, as found in the LICENSE file.

文件鏡像歸檔自 GitHub 官方源路徑 · 造訪原專案 GitHub
最後同步快照:2026-11-09