Skip to content

Commit 6b49755

Browse files
committed
Add GPU warning
1 parent 975be52 commit 6b49755

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lectures/wealth_dynamics.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ kernelspec:
1919

2020
# Wealth Distribution Dynamics
2121

22+
```{admonition} GPU Warning
23+
:class: dropdown, warning
24+
This lecture is built using [hardware](status:machine-details) that has access to a GPU and uses JAX for GPU programming. As a result, the lecture will be slower when running on a machine without a GPU.
25+
26+
Free GPUs are available on Google Colab. To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU.
27+
28+
Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax#pip-installation-gpu-cuda) for installing JAX with GPU support.
29+
```
30+
2231
```{contents} Contents
2332
:depth: 2
2433
```
@@ -30,6 +39,9 @@ In addition to what's in Anaconda, this lecture will need the following librarie
3039
tags: [hide-output]
3140
---
3241
!pip install quantecon
42+
# If your machine has CUDA support, please follow the guide in GPU Warning.
43+
# Otherwise, run the line below:
44+
!pip install --upgrade "jax[CPU]"
3345
```
3446

3547
## Overview
@@ -448,7 +460,6 @@ size = (1,)
448460
```
449461

450462
```{code-cell} ipython3
451-
%%time
452463
qe.tic()
453464
w_jax_result = wealth_time_series_jax(wdy.y_mean, ts_length, wdy, size).block_until_ready()
454465
glue("wealth_time_series_jax_time_1", qe.toc())

0 commit comments

Comments
 (0)