From 946c4163c02f04eaba53d2165196cad8d42df739 Mon Sep 17 00:00:00 2001 From: mmcky Date: Sat, 1 Apr 2023 17:27:10 +1100 Subject: [PATCH 01/11] ENH: Upgrade docker with anaconda==2023.02 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d59e10f60..ffd972e1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: needs: deploy-runner runs-on: [self-hosted, cml-gpu] container: - image: docker://mmcky/quantecon-lecture-python:py39-anaconda-2022-10-jb-0.15.1 + image: docker://mmcky/quantecon-lecture-python:py310-anaconda-2023-03-jb-0.15.1 options: --gpus all steps: - uses: actions/checkout@v3 From 82a17c59dcd991e53401c01c8736bcb84b0aa071 Mon Sep 17 00:00:00 2001 From: mmcky Date: Sun, 2 Apr 2023 13:35:08 +1000 Subject: [PATCH 02/11] update matplotlib project='3d' --- lectures/linear_algebra.md | 4 ++-- lectures/lln_clt.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lectures/linear_algebra.md b/lectures/linear_algebra.md index 90700f460..95816b841 100644 --- a/lectures/linear_algebra.md +++ b/lectures/linear_algebra.md @@ -288,8 +288,8 @@ The span is a two-dimensional plane passing through these two points and the ori --- tags: [output_scroll] --- -fig = plt.figure(figsize=(10, 8)) -ax = fig.gca(projection='3d') +fig = plt.figure(figsize=(10, 8), projection='3d') +ax = fig.gca() x_min, x_max = -5, 5 y_min, y_max = -5, 5 diff --git a/lectures/lln_clt.md b/lectures/lln_clt.md index 96d542d44..631ca4551 100644 --- a/lectures/lln_clt.md +++ b/lectures/lln_clt.md @@ -478,8 +478,8 @@ S = Z.cumsum(axis=1) Y = (1 / np.sqrt(ns)) * S # Plot -fig = plt.figure(figsize = (10, 6)) -ax = fig.gca(projection='3d') +fig = plt.figure(figsize = (10, 6), projection='3d') +ax = fig.gca() a, b = -3, 3 gs = 100 From 2ede848540d9f03dd7e9efe3da7db890e01b314b Mon Sep 17 00:00:00 2001 From: mmcky Date: Sun, 2 Apr 2023 13:38:02 +1000 Subject: [PATCH 03/11] change matplotlib syntax --- lectures/linear_algebra.md | 3 +-- lectures/lln_clt.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lectures/linear_algebra.md b/lectures/linear_algebra.md index 95816b841..796bf346b 100644 --- a/lectures/linear_algebra.md +++ b/lectures/linear_algebra.md @@ -288,8 +288,7 @@ The span is a two-dimensional plane passing through these two points and the ori --- tags: [output_scroll] --- -fig = plt.figure(figsize=(10, 8), projection='3d') -ax = fig.gca() +ax = plt.figure(figsize=(10, 8)).add_subplot(projection='3d') x_min, x_max = -5, 5 y_min, y_max = -5, 5 diff --git a/lectures/lln_clt.md b/lectures/lln_clt.md index 631ca4551..0e0fbb511 100644 --- a/lectures/lln_clt.md +++ b/lectures/lln_clt.md @@ -478,8 +478,7 @@ S = Z.cumsum(axis=1) Y = (1 / np.sqrt(ns)) * S # Plot -fig = plt.figure(figsize = (10, 6), projection='3d') -ax = fig.gca() +ax = plt.figure(figsize = (10, 6)).add_subplot(projection='3d') a, b = -3, 3 gs = 100 From ef1e6134b58c110383b0ca9120a17bb180f18f31 Mon Sep 17 00:00:00 2001 From: mmcky Date: Sun, 2 Apr 2023 13:48:22 +1000 Subject: [PATCH 04/11] update env --- environment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/environment.yml b/environment.yml index 69915c7a1..2dbcbdafe 100644 --- a/environment.yml +++ b/environment.yml @@ -11,9 +11,9 @@ dependencies: - sphinx-tojupyter==0.3.0 - sphinxext-rediraffe==0.2.7 - sphinx-exercise==0.4.1 - - ghp-import==1.1.0 - - sphinxcontrib-youtube==1.1.0 - - sphinx-togglebutton==0.3.1 + - ghp-import==2.1.0 + - sphinxcontrib-youtube==1.2.0 + - sphinx-togglebutton==0.3.2 - arviz==0.13.0 - kaleido # Docker Requirements From f2b8a677fad6b4e00b8a445afc32b97393924b8a Mon Sep 17 00:00:00 2001 From: mmcky Date: Sun, 2 Apr 2023 14:01:29 +1000 Subject: [PATCH 05/11] remove jax install from github actions --- .github/workflows/ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4795bf06..1ff9be74f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,13 +30,6 @@ jobs: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} - # Install Hardware Dependant Libraries - - name: Install Jax and Upgrade CUDA - shell: bash -l {0} - run: | - pip install --upgrade "jax[cuda]==0.4.2" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html - pip install --upgrade "numpyro[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html - nvidia-smi # Check nvidia drivers - name: nvidia Drivers shell: bash -l {0} From bd8b3a7bc25c04c5436f061a8320a0367785d5ad Mon Sep 17 00:00:00 2001 From: mmcky Date: Sun, 2 Apr 2023 14:04:13 +1000 Subject: [PATCH 06/11] TST: full build --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ff9be74f..4b6e5b65a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,13 +40,13 @@ jobs: - name: Display Pip Versions shell: bash -l {0} run: pip list - - name: Download "build" folder (cache) - uses: dawidd6/action-download-artifact@v2 - with: - workflow: cache.yml - branch: main - name: build-cache - path: _build + # - name: Download "build" folder (cache) + # uses: dawidd6/action-download-artifact@v2 + # with: + # workflow: cache.yml + # branch: main + # name: build-cache + # path: _build # Build Assets (Download Notebooks and PDF via LaTeX) - name: Build Download Notebooks (sphinx-tojupyter) shell: bash -l {0} From b6377116ab25893bb6a2d52e3476d24afd1050dd Mon Sep 17 00:00:00 2001 From: mmcky Date: Sun, 2 Apr 2023 19:30:37 +1000 Subject: [PATCH 07/11] upgrade to cuda12 + jax --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b6e5b65a..0703ea3b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: needs: deploy-runner runs-on: [self-hosted, cml-gpu] container: - image: docker://mmcky/quantecon-lecture-python:py310-anaconda-2023-03-jb-0.15.1 + image: docker://mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-03-py310 options: --gpus all steps: - uses: actions/checkout@v3 From 4ff0256182d2b5228d44cc37425a36beb3ff2d93 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 4 Apr 2023 10:39:48 +1000 Subject: [PATCH 08/11] update all workflows and update environment --- .github/workflows/cache.yml | 6 ++---- .github/workflows/ci.yml | 17 +++++++++-------- .github/workflows/execution.yml | 6 +++--- .github/workflows/linkcheck.yml | 4 ++-- .github/workflows/publish.yml | 6 ++---- environment.yml | 4 ++-- 6 files changed, 20 insertions(+), 23 deletions(-) diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 56f84f9c7..112cfb485 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -27,17 +27,15 @@ jobs: needs: deploy-runner runs-on: [self-hosted, cml-gpu] container: - image: docker://mmcky/quantecon-lecture-python:py39-anaconda-2022-10-jb-0.15.1 + image: docker://mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-03-py310 options: --gpus all steps: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} - - name: Install Jax and Upgrade CUDA + - name: Check nvidia drivers shell: bash -l {0} run: | - pip install --upgrade "jax[cuda]==0.4.2" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html - pip install --upgrade "numpyro[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html nvidia-smi - name: Build HTML shell: bash -l {0} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0703ea3b5..8a96424bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,8 @@ jobs: --cloud-region=us-west-2 \ --cloud-type=p3.2xlarge \ --labels=cml-gpu \ - --cloud-hdd-size=40 + --cloud-hdd-size=40 \ + --cloud-startup-script=cml/update_nvidia.sh preview: needs: deploy-runner runs-on: [self-hosted, cml-gpu] @@ -40,13 +41,13 @@ jobs: - name: Display Pip Versions shell: bash -l {0} run: pip list - # - name: Download "build" folder (cache) - # uses: dawidd6/action-download-artifact@v2 - # with: - # workflow: cache.yml - # branch: main - # name: build-cache - # path: _build + - name: Download "build" folder (cache) + uses: dawidd6/action-download-artifact@v2 + with: + workflow: cache.yml + branch: main + name: build-cache + path: _build # Build Assets (Download Notebooks and PDF via LaTeX) - name: Build Download Notebooks (sphinx-tojupyter) shell: bash -l {0} diff --git a/.github/workflows/execution.yml b/.github/workflows/execution.yml index 14f3c36a7..ea13ba59a 100644 --- a/.github/workflows/execution.yml +++ b/.github/workflows/execution.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["3.9"] + python-version: ["3.10"] steps: - name: Checkout uses: actions/checkout@v2 @@ -54,7 +54,7 @@ jobs: fail-fast: false matrix: os: ["macos-latest"] - python-version: ["3.8"] + python-version: ["3.10"] steps: - name: Checkout uses: actions/checkout@v2 @@ -86,7 +86,7 @@ jobs: # fail-fast: false # matrix: # os: ["windows-latest"] - # python-version: ["3.8"] + # python-version: ["3.10"] # steps: # - name: Checkout # uses: actions/checkout@v2 diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index f4a13f090..2421da92f 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["3.9"] + python-version: ["3.10"] steps: - name: Checkout uses: actions/checkout@v2 @@ -23,7 +23,7 @@ jobs: auto-update-conda: true auto-activate-base: true miniconda-version: 'latest' - python-version: 3.9 + python-version: '3.10' environment-file: environment.yml activate-environment: quantecon - name: Download "build" folder (cache) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 10d28aced..8cf25e342 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,7 +28,7 @@ jobs: needs: deploy-runner runs-on: [self-hosted, cml-gpu] container: - image: docker://mmcky/quantecon-lecture-python:py39-anaconda-2022-10-jb-0.15.1 + image: docker://mmcky/quantecon-lecture-python:cuda-12.1.0-anaconda-2023-03-py310 options: --gpus all steps: - name: Checkout @@ -36,11 +36,9 @@ jobs: - name: Install Git (required to commit notebooks) shell: bash -l {0} run: apt-get install -y git - - name: Install Jax and Upgrade CUDA + - name: Check nvidia drivers shell: bash -l {0} run: | - pip install --upgrade "jax[cuda]==0.4.2" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html - pip install --upgrade "numpyro[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html nvidia-smi - name: Display Conda Environment Versions shell: bash -l {0} diff --git a/environment.yml b/environment.yml index 2dbcbdafe..926adb7ff 100644 --- a/environment.yml +++ b/environment.yml @@ -2,8 +2,8 @@ name: quantecon channels: - default dependencies: - - python=3.9 - - anaconda=2022.10 + - python=3.10 + - anaconda=2023.03 - pip - pip: - jupyter-book==0.15.1 From 3cfd394ea4f6d9f3adb283b8e5311d2644b29f38 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 4 Apr 2023 10:41:44 +1000 Subject: [PATCH 09/11] remove upgrade script --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35bb403c6..be092b5a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,6 @@ jobs: --cloud-type=p3.2xlarge \ --labels=cml-gpu \ --cloud-hdd-size=40 \ - --cloud-startup-script=cml/update_nvidia.sh preview: needs: deploy-runner runs-on: [self-hosted, cml-gpu] From 5276888f38e78e42921b516317065a6d9e2563d4 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 4 Apr 2023 10:42:31 +1000 Subject: [PATCH 10/11] fix syntax --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be092b5a9..0703ea3b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: --cloud-region=us-west-2 \ --cloud-type=p3.2xlarge \ --labels=cml-gpu \ - --cloud-hdd-size=40 \ + --cloud-hdd-size=40 preview: needs: deploy-runner runs-on: [self-hosted, cml-gpu] From ac96d1f21460be79031d6472f40e946260f8ad55 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 4 Apr 2023 13:39:36 +1000 Subject: [PATCH 11/11] re-enable cache --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0703ea3b5..96e909895 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,13 +40,13 @@ jobs: - name: Display Pip Versions shell: bash -l {0} run: pip list - # - name: Download "build" folder (cache) - # uses: dawidd6/action-download-artifact@v2 - # with: - # workflow: cache.yml - # branch: main - # name: build-cache - # path: _build + - name: Download "build" folder (cache) + uses: dawidd6/action-download-artifact@v2 + with: + workflow: cache.yml + branch: main + name: build-cache + path: _build # Build Assets (Download Notebooks and PDF via LaTeX) - name: Build Download Notebooks (sphinx-tojupyter) shell: bash -l {0}