Skip to content

Commit 8d733b9

Browse files
committed
Add centralized GPU admonition for JAX lectures
- Create _admonition/gpu.md for single-source GPU notice - Update jax_intro.md to use include directive - Update numpy_vs_numba_vs_jax.md to use include directive This makes it easier to maintain consistent GPU notices across all JAX-related lectures.
1 parent 9171836 commit 8d733b9

File tree

3 files changed

+13
-20
lines changed

3 files changed

+13
-20
lines changed

lectures/_admonition/gpu.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
```{admonition} GPU
2+
:class: warning
3+
4+
This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and target JAX for GPU programming.
5+
6+
Free GPUs are available on Google Colab.
7+
To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU.
8+
9+
Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support.
10+
If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]`
11+
```

lectures/jax_intro.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,7 @@ In addition to what's in Anaconda, this lecture will need the following librarie
3333
!pip install jax quantecon
3434
```
3535

36-
```{admonition} GPU
37-
:class: warning
38-
39-
This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and target JAX for GPU programming.
40-
41-
Free GPUs are available on Google Colab.
42-
To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU.
43-
44-
Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support.
45-
If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]`
36+
```{include} _admonition/gpu.md
4637
```
4738

4839
## JAX as a NumPy Replacement

lectures/numpy_vs_numba_vs_jax.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,7 @@ tags: [hide-output]
4848
!pip install quantecon jax
4949
```
5050

51-
```{admonition} GPU
52-
:class: warning
53-
54-
This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and target JAX for GPU programming.
55-
56-
Free GPUs are available on Google Colab.
57-
To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU.
58-
59-
Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support.
60-
If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]`
51+
```{include} _admonition/gpu.md
6152
```
6253

6354
We will use the following imports.

0 commit comments

Comments
 (0)