Giter Site home page Giter Site logo

anj-s / alpa Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alpa-projects/alpa

0.0 0.0 0.0 3.06 MB

Auto parallelization for large-scale neural networks

License: Apache License 2.0

Shell 0.63% C++ 0.04% Python 94.01% Cuda 0.04% CMake 0.04% Jupyter Notebook 4.78% Dockerfile 0.22% Starlark 0.24%

alpa's Introduction

Alpa

Documentation | Slack

Build Jaxlib and Jax CI

Alpa is a system for large-scale distributed training. Alpa is specifically designed for training giant neural networks that cannot fit into a single device. Alpa can automatically generate dstirbuted execution plans that unify data, operator, and pipeline parallelism.

Quick Start

Use Alpa's decorator @parallelize to scale your single-node training code to distributed clusters, even though your model is much bigger than a single device memory.

import alpa

@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

Contributing

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.

alpa's People

Contributors

lebrice avatar merrymercy avatar pkuflyingpig avatar reinaw1012 avatar richardscottoz avatar suquark avatar tarzanzhao avatar yf225 avatar zhisbug avatar zhuohan123 avatar zyhowell avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.