Add Jax distributed training guide with RNN/MLP examples#77
Open
atoniolo76 wants to merge 8 commits into
Open
Conversation
…ific files, and save metrics data/load weights from checkpoint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creates a Modal training script with 4 entry points:
mlp_train,mlp_sample,rnn_train,rnn_sample. Adds a README explaining the advantages of Jax over PyTorch and how to setup a multi-node cluster using mesh/sharding primitives. Requires third-party library Equinox for neural network convenience.MLP example:
Fit a basic MLP with
hidden_size=64to the x^2 function. Compute the mean-squared error as loss-function and back-propagate with Adam optimizer.RNN example:
Next-character prediction on Chapter 32 from Moby Dick. Computes cross-entropy loss. Vocabulary is a one-hot vector of size 64.
Checklist
latestpython_versionfor the base image, if it is used~=x.y.zor==x.yversion < 1are pinned to patch version,==0.y.z(Modal's internal guide page for this repo is Multi-node examples guidance.)
Outside contributors
You're great! Thanks for your contribution.