Skip to content

MAINT: remove jax, pyro, torch, and gpu related software installs + GPU admonition #453

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
shell: bash -l {0}
run: |
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
pip install pyro-ppl
pip install --upgrade "jax[cuda12-local]"
pip install numpyro
python scripts/test-jax-install.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/collab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
execution-checks:
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=ubuntu24-gpu-x64/disk=large"
container:
image: docker://us-docker.pkg.dev/colab-images/public/runtime
image: docker://us-docker.pkg.dev/colab-images/public/runtime:latest
options: --gpus all
steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 0 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ dependencies:
- ghp-import==1.1.0
- sphinxcontrib-youtube==1.3.0 #Version 1.3.0 is required as quantecon-book-theme is only compatible with sphinx<=5
- sphinx-togglebutton==0.3.2
# Docker Requirements
- pytz

9 changes: 9 additions & 0 deletions lectures/_admonition/gpu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
```{admonition} GPU
:class: warning

This lecture was built using a machine with the latest CUDA and CUDANN frameworks installed with access to a GPU.

To run this lecture on [Google Colab](https://colab.research.google.com/), click on the "play" icon top right, select Colab, and set the runtime environment to include a GPU.

To run this lecture on your own machine, you need to install the software listed following this notice.
```
14 changes: 12 additions & 2 deletions lectures/ar1_bayes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,25 @@ kernelspec:

# Posterior Distributions for AR(1) Parameters

We'll begin with some Python imports.
```{include} _admonition/gpu.md
```

```{code-cell} ipython3
:tags: [hide-output]

!pip install numpyro jax
```

In addition to what's included in base Anaconda, we need to install the following packages

```{code-cell} ipython3
:tags: [hide-output]

!pip install arviz pymc numpyro jax
!pip install arviz pymc
```

We'll begin with some Python imports.

```{code-cell} ipython3

import arviz as az
Expand Down
13 changes: 12 additions & 1 deletion lectures/back_prop.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@ kernelspec:

# Introduction to Artificial Neural Networks

```{include} _admonition/gpu.md
```

```{code-cell} ipython3
:tags: [skip-execution]

!pip install --upgrade jax
```

In addition to what's included in base Anaconda, we need to install the following packages

```{code-cell} ipython3
:tags: [hide-output]

!pip install --upgrade jax jaxlib kaleido
!pip install kaleido
!conda install -y -c plotly plotly plotly-orca retrying
```

Expand Down
16 changes: 9 additions & 7 deletions lectures/bayes_nonconj.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ kernelspec:

# Non-Conjugate Priors

```{include} _admonition/gpu.md
```

```{code-cell} ipython3
:tags: [hide-output]

!pip install numpyro pyro-ppl torch jax
```

This lecture is a sequel to the {doc}`quantecon lecture <prob_meaning>`.

That lecture offers a Bayesian interpretation of probability in a setting in which the likelihood function and the prior distribution
Expand Down Expand Up @@ -43,13 +52,6 @@ The two Python modules are

As usual, we begin by importing some Python code.

```{code-cell} ipython3
:tags: [hide-output]

# install dependencies
!pip install numpyro pyro-ppl torch jax
```

```{code-cell} ipython3
import numpy as np
import seaborn as sns
Expand Down
9 changes: 5 additions & 4 deletions lectures/mix_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ kernelspec:
(likelihood-ratio-process)=
# Incorrect Models

In addition to what's in Anaconda, this lecture will need the following libraries:
```{include} _admonition/gpu.md
```

```{code-cell} ipython
---
tags: [hide-output]
---
:tags: [hide-output]

!pip install numpyro jax
```

Expand Down
Loading