Skip to content

Commit a529e01

Browse files
authored
Merge branch 'main' into fix-deprecation+future
2 parents fef0379 + ec27970 commit a529e01

18 files changed

+187
-99
lines changed

.github/runs-on.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
images:
2+
quantecon_ubuntu2404:
3+
platform: "linux"
4+
arch: "x64"
5+
ami: "ami-09baf66e396fa7cfd"

.github/workflows/cache.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,27 @@ on:
66
workflow_dispatch:
77
jobs:
88
cache:
9-
runs-on: quantecon-gpu
10-
container:
11-
image: ghcr.io/quantecon/lecture-python-container:cuda-12.8.1-anaconda-2024-10-py312
12-
options: --gpus all
9+
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=quantecon_ubuntu2404/disk=large"
1310
steps:
1411
- uses: actions/checkout@v4
1512
with:
1613
ref: ${{ github.event.pull_request.head.sha }}
14+
- name: Setup Anaconda
15+
uses: conda-incubator/setup-miniconda@v3
16+
with:
17+
auto-update-conda: true
18+
auto-activate-base: true
19+
miniconda-version: 'latest'
20+
python-version: "3.12"
21+
environment-file: environment.yml
22+
activate-environment: quantecon
23+
- name: Install JAX, Numpyro, PyTorch
24+
shell: bash -l {0}
25+
run: |
26+
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
27+
pip install --upgrade "jax[cuda12-local]"
28+
pip install numpyro
29+
python scripts/test-jax-install.py
1730
- name: Check nvidia drivers
1831
shell: bash -l {0}
1932
run: |

.github/workflows/ci.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
name: Build Project [using jupyter-book]
2-
on: [pull_request]
2+
on:
3+
pull_request:
4+
workflow_dispatch:
35
jobs:
46
preview:
5-
runs-on: quantecon-gpu
6-
container:
7-
image: ghcr.io/quantecon/lecture-python-container:cuda-12.8.1-anaconda-2024-10-py312
8-
options: --gpus all
7+
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=quantecon_ubuntu2404/disk=large"
98
steps:
109
- uses: actions/checkout@v4
1110
with:
1211
ref: ${{ github.event.pull_request.head.sha }}
13-
# Check nvidia drivers
14-
- name: nvidia Drivers
12+
- name: Setup Anaconda
13+
uses: conda-incubator/setup-miniconda@v3
14+
with:
15+
auto-update-conda: true
16+
auto-activate-base: true
17+
miniconda-version: 'latest'
18+
python-version: "3.12"
19+
environment-file: environment.yml
20+
activate-environment: quantecon
21+
- name: Install JAX, Numpyro, PyTorch
22+
shell: bash -l {0}
23+
run: |
24+
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
25+
pip install pyro-ppl
26+
pip install --upgrade "jax[cuda12-local]"
27+
pip install numpyro pyro-ppl
28+
python scripts/test-jax-install.py
29+
- name: Check nvidia Drivers
1530
shell: bash -l {0}
1631
run: nvidia-smi
1732
- name: Display Conda Environment Versions
@@ -21,7 +36,7 @@ jobs:
2136
shell: bash -l {0}
2237
run: pip list
2338
- name: Download "build" folder (cache)
24-
uses: dawidd6/action-download-artifact@v8
39+
uses: dawidd6/action-download-artifact@v9
2540
with:
2641
workflow: cache.yml
2742
branch: main

.github/workflows/collab.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Build Project on Google Collab (Execution)
22
on: [pull_request]
33
jobs:
44
execution-checks:
5-
runs-on: quantecon-gpu
5+
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=ubuntu24-gpu-x64/disk=large"
66
container:
7-
image: docker://us-docker.pkg.dev/colab-images/public/runtime
7+
image: docker://us-docker.pkg.dev/colab-images/public/runtime:latest
88
options: --gpus all
99
steps:
1010
- uses: actions/checkout@v4
@@ -22,7 +22,7 @@ jobs:
2222
shell: bash -l {0}
2323
run: pip list
2424
- name: Download "build" folder (cache)
25-
uses: dawidd6/action-download-artifact@v8
25+
uses: dawidd6/action-download-artifact@v9
2626
with:
2727
workflow: cache.yml
2828
branch: main
@@ -32,7 +32,7 @@ jobs:
3232
- name: Install Build Software
3333
shell: bash -l {0}
3434
run: |
35-
pip install jupyter-book==0.15.1 docutils==0.17.1 quantecon-book-theme==0.7.2 sphinx-tojupyter==0.3.0 sphinxext-rediraffe==0.2.7 sphinx-reredirects sphinx-exercise==0.4.1 sphinxcontrib-youtube==1.1.0 sphinx-togglebutton==0.3.1 arviz==0.13.0 sphinx-proof
35+
pip install jupyter-book==1.0.3 quantecon-book-theme==0.8.2 sphinx-tojupyter==0.3.0 sphinxext-rediraffe==0.2.7 sphinxcontrib-youtube==1.3.0 sphinx-togglebutton==0.3.2 arviz sphinx-proof sphinx-exercise sphinx-reredirects
3636
# Build of HTML (Execution Testing)
3737
- name: Build HTML
3838
shell: bash -l {0}

.github/workflows/linkcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
environment-file: environment.yml
2828
activate-environment: quantecon
2929
- name: Download "build" folder (cache)
30-
uses: dawidd6/action-download-artifact@v8
30+
uses: dawidd6/action-download-artifact@v9
3131
with:
3232
workflow: cache.yml
3333
branch: main

.github/workflows/publish.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,26 @@ on:
66
jobs:
77
publish:
88
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
9-
runs-on: quantecon-gpu
10-
container:
11-
image: ghcr.io/quantecon/lecture-python-container:cuda-12.8.1-anaconda-2024-10-py312
12-
options: --gpus all
9+
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=quantecon_ubuntu2404/disk=large"
1310
steps:
1411
- name: Checkout
1512
uses: actions/checkout@v4
16-
- name: Install Git (required to commit notebooks)
13+
- name: Setup Anaconda
14+
uses: conda-incubator/setup-miniconda@v3
15+
with:
16+
auto-update-conda: true
17+
auto-activate-base: true
18+
miniconda-version: 'latest'
19+
python-version: "3.12"
20+
environment-file: environment.yml
21+
activate-environment: quantecon
22+
- name: Install JAX, Numpyro, PyTorch
1723
shell: bash -l {0}
18-
run: apt-get install -y git
24+
run: |
25+
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
26+
pip install --upgrade "jax[cuda12-local]"
27+
pip install numpyro
28+
python scripts/test-jax-install.py
1929
- name: Check nvidia drivers
2030
shell: bash -l {0}
2131
run: |
@@ -28,7 +38,7 @@ jobs:
2838
run: pip list
2939
# Download Build Cache from cache.yml
3040
- name: Download "build" folder (cache)
31-
uses: dawidd6/action-download-artifact@v8
41+
uses: dawidd6/action-download-artifact@v9
3242
with:
3343
workflow: cache.yml
3444
branch: main

environment.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,3 @@ dependencies:
1616
- ghp-import==1.1.0
1717
- sphinxcontrib-youtube==1.3.0 #Version 1.3.0 is required as quantecon-book-theme is only compatible with sphinx<=5
1818
- sphinx-togglebutton==0.3.2
19-
# Docker Requirements
20-
- pytz
21-

lectures/_admonition/gpu.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```{admonition} GPU
2+
:class: warning
3+
4+
This lecture was built using a machine with the latest CUDA and CUDANN frameworks installed with access to a GPU.
5+
6+
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.
7+
8+
To run this lecture on your own machine, you need to install the software listed following this notice.
9+
```

lectures/ar1_bayes.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,25 @@ kernelspec:
1313

1414
# Posterior Distributions for AR(1) Parameters
1515

16-
We'll begin with some Python imports.
16+
```{include} _admonition/gpu.md
17+
```
1718

19+
```{code-cell} ipython3
20+
:tags: [hide-output]
21+
22+
!pip install numpyro jax
23+
```
24+
25+
In addition to what's included in base Anaconda, we need to install the following packages
1826

1927
```{code-cell} ipython3
2028
:tags: [hide-output]
2129
22-
!pip install arviz pymc numpyro jax
30+
!pip install arviz pymc
2331
```
2432

33+
We'll begin with some Python imports.
34+
2535
```{code-cell} ipython3
2636
2737
import arviz as az

lectures/back_prop.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,21 @@ kernelspec:
1313

1414
# Introduction to Artificial Neural Networks
1515

16+
```{include} _admonition/gpu.md
17+
```
18+
19+
```{code-cell} ipython3
20+
:tags: [skip-execution]
21+
22+
!pip install --upgrade jax
23+
```
24+
25+
In addition to what's included in base Anaconda, we need to install the following packages
26+
1627
```{code-cell} ipython3
1728
:tags: [hide-output]
1829
19-
!pip install --upgrade jax jaxlib kaleido
30+
!pip install kaleido
2031
!conda install -y -c plotly plotly plotly-orca retrying
2132
```
2233

0 commit comments

Comments
 (0)