Giter Club home page Giter Club logo

jax-perlmutter-tutorials's Introduction

JAX Perlmutter Tutorials

Collection of tips and tutorials for running JAX on Perlmutter

Tutorials

  1. First Introduction to JAX | colab
    Authors: @EiffL
    Covers the basic concepts of JAX with a few examples and common gotchas. Presented in July 2021.

  2. DESC DC2 Telecon: Practical introduction to JAX | colab
    Authors: @EiffL
    Covers a few examples of JAX uses cases: implemeting Limber integration, Fisher forecasts, running parallel MCMCs, fitting galaxy light profiles. Presented in Dec. 2021.

Installing JAX on Perlmutter (Aug. 2022)

Installing JAX in the default python environment

Installing JAX on Perlmutter is easy if you follow these steps:

module load python cudnn/8.2.0 nccl/2.11.4 cudatoolkit
pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_releases.html

And that's it, but note that to run properly, JAX will require that you load the following modules: cudnn/8.2.0 nccl/2.11.4 cudatoolkit.

Making JAX available in JupyterLab

To make sure the necessary modules are loaded when you run your notebooks on JupyterLab, you will then need to create a custom Jupyter kernel.

  1. Create a template kernel
python -m ipykernel install --user --name jax --display-name JAX

This will create a template kernel named JAX, which we now need to modify slightly.

Go to the newly created kernel directory:

cd $HOME/.local/share/jupyter/kernels/jax
ls

You should see in this directory a kernel.json which we will edit in the next step.

  1. Edit kernel with custom startup script

Open the kernel.json file and edit to the following:

{
 "argv": [
  "{resource_dir}/kernel-helper.sh",
  "python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "JAX",
 "language": "python",
 "metadata": {
  "debugger": true
 }
}

Now, in addition, create a new file in the same directory named kernel-helper.sh with the following content:

#!/bin/bash -l
module load python cudnn/8.2.0 nccl/2.11.4 cudatoolkit
exec "$@"

Give execution privileges to this file

chmod u+x kernel-helper.sh

And that should be it. Now when you launch the JAX kernel on Perlmutter you should be able to run your jax code without issue.

jax-perlmutter-tutorials's People

Contributors

eiffl avatar smericks avatar

Stargazers

Radi Radev avatar Benjamin Remy avatar Ismael Mendoza avatar Alexandre Boucaud avatar

Watchers

James Cloos avatar Rachel Mandelbaum avatar Seth Digel avatar Heather Kelly avatar Tony Johnson avatar Katrin Heitmann avatar  avatar

Forkers

smericks

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.