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
Getting Involved
- Please read the contributor guide if you are interested in contributing to Alpa.
- Please 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.0.3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6655c3b00c74b87e9f265f8269bf95f599d6fd7272235d493b1f5edc5c3fe153 |
|
MD5 | 3e433e18f3293c64eec1ee0633febeb2 |
|
BLAKE2b-256 | 6bf0d990580a1edd62818ecbd1870b639bc55b473194cd46715b6a5055061295 |
Hashes for alpa-0.0.3-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d625dd298ab486faacf5862bbb19869c00b0bfa707f6659880792cb0dba54c63 |
|
MD5 | 5fcea14b4717ce7fb84882be105a21d3 |
|
BLAKE2b-256 | 768ad8a8d55378e018466c4838a4493c1623247ff74d00e754d81f5d817fffef |
Hashes for alpa-0.0.3-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b4e0cc5bae7d7f9d590dc586c2fac5fd5b7f2e4a0f502726784180653b7f5e8 |
|
MD5 | 08ebdd4d0b55d0c09a7204770d9e97fc |
|
BLAKE2b-256 | c24589dc24df74a9757e552ab69f82671de7b7f9f6dd6660e0f034aac26d532e |