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
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.1.3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89d788c8f288b3a3b894b2efbcb0ae40f8b3f38b521b6a45cc23c956a659674c |
|
MD5 | 5b1d3cb5eb9a809590a3eabcf8aeb106 |
|
BLAKE2b-256 | d5a0eb85144976e7745cb6b614e629152a4e8762d1e06b2d2e370f374edb17cc |
Hashes for alpa-0.1.3-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 510d13adb9dc4adae73044c7827040c49502efa6e67881ffaede5f76ce5aa40f |
|
MD5 | 299b40f8b04e64630d4652459415f525 |
|
BLAKE2b-256 | 20dbb663588d918dabd7190b5163e2908a5d5290b341b8e15e8cf20bfa3ed424 |
Hashes for alpa-0.1.3-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a85c658d72d7018af3d0db066613ea3037c9602edb7df46b5ae2427cabcab558 |
|
MD5 | 76c2c8e351c5150e35e365e7f4446134 |
|
BLAKE2b-256 | 0260d0a5c728659316a4f10d6da82f5feff94300a9b3298a8b374eb3bb87efcb |