Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JAX MNIST training example using autoscale #32

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

balancap
Copy link
Contributor

@balancap balancap commented Nov 24, 2023

JAX MNIST training example adapted to autoscale: https://github.com/google/jax/blob/main/examples/mnist_classifier.py

3 main modifications:

  • as_scaled_array on model state;
  • as_scaled_array on micro-batch;
  • @jsa.autoscale on update function;

@balancap balancap marked this pull request as draft November 24, 2023 11:09
@balancap balancap force-pushed the autoscale-mnist-training-example branch 6 times, most recently from 734f90f to b0254b5 Compare November 27, 2023 16:19
@balancap balancap changed the title Add JAX MNIST training example. Add JAX MNIST training example using autoscale Nov 27, 2023
@balancap balancap marked this pull request as ready for review November 27, 2023 16:20
@balancap balancap force-pushed the autoscale-mnist-training-example branch from b0254b5 to e2c5d08 Compare November 27, 2023 16:20
@balancap
Copy link
Contributor Author

@awf Sorry it was not clear. The training code is copied from the JAX MNIST example, including imperfections!

Official JAX MNIST example: https://github.com/google/flax/blob/main/examples/mnist/train.py

3 main modifications:
* `as_scaled_array` on model state;
* `as_scaled_array` on micro-batch;
* `@jsa.autoscale` on `update` function;
@balancap balancap force-pushed the autoscale-mnist-training-example branch from e2c5d08 to 206e78f Compare November 28, 2023 09:32
@balancap balancap merged commit ec9f1fe into main Nov 28, 2023
2 checks passed
@balancap balancap deleted the autoscale-mnist-training-example branch November 28, 2023 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants