Alpa automatically parallelizes large tensor computation graphs and runs them on a distributed cluster.
Project description
Alpa
Alpa is a system for training large-scale neural networks. Scaling neural networks to hundreds of billions of parameters has enabled dramatic breakthroughs such as GPT-3, but training these large-scale neural networks requires complicated distributed training techniques. Alpa aims to automate large-scale distributed training with just a few lines of code.
The key features of Alpa include:
💻 Automatic Parallelization. Alpa automatically parallelizes users' single-device code on distributed clusters with data, operator, and pipeline parallelism.
🚀 Excellent Performance. Alpa achieves linear scaling on training models with billions of parameters on distributed clusters.
✨ Tight Integration with Machine Learning Ecosystem. Alpa is backed by open-source, high-performance, and production-ready libraries such as Jax, XLA, and Ray
Quick Start
Use Alpa's decorator @parallelize
to scale your single-device training code to distributed clusters.
import alpa
# Parallelize the training step in Jax by simply using a decorator
@alpa.parallelize
def train_step(model_state, batch):
def loss_func(params):
out = model_state.forward(params, batch["x"])
return jnp.mean((out - batch["y"]) ** 2)
grads = grad(loss_func)(model_state.params)
new_model_state = model_state.apply_gradient(grads)
return new_model_state
# The training loop now automatically runs on your designated cluster
model_state = create_train_state()
for batch in data_loader:
model_state = train_step(model_state, batch)
Check out the Alpa Documentation site for installation instructions, tutorials, examples, and more.
More Information
- Alpa paper (OSDI'22)
- Google AI blog
- Alpa talk slides
- Big model tutorial (ICML'22)
Getting Involved
- Please read the contributor guide if you are interested in contributing to Alpa.
- Connect to Alpa contributors via the Alpa slack.
License
Alpa is licensed under the Apache-2.0 license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for alpa-0.1.5-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17fa4eda3dd8b8732c5f56533a62f72a3ae3e99de311fe2eeb72fd29fa0f6ca2 |
|
MD5 | 83236baf48fbfccf80959ac3d344755d |
|
BLAKE2b-256 | f2e9c6e4a03a52465cb6780315313b8725d526a8e5aea587971eb434891e7a99 |
Hashes for alpa-0.1.5-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ef14ddc2cbf598d5c078f0c68a1cf310e05e1abad222dde9c99e8ad75fb72bd |
|
MD5 | 34660613797408f766911ca4972e9747 |
|
BLAKE2b-256 | a31f90447e51a00eebef42954e5c3893f54ca11171774e75c20c65bf6efa62ae |
Hashes for alpa-0.1.5-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bedc9415d11d0de6c89bee7d3af72a16b74963fa700b14882b45f41233f4a4d |
|
MD5 | 8bdab3a40a703540c12aa800d34ce279 |
|
BLAKE2b-256 | fc24446ef28e62fd0978f349a0c38afebe28c26000be4c633496a697dfe3c289 |