From a7935127be6de4cdaf26710eb3b93e8696a6df53 Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Mon, 18 Aug 2025 10:21:21 +1000 Subject: [PATCH 01/12] updates experiments --- lectures/back_prop.md | 20 +++++++++++--------- lectures/status.md | 12 ++++++------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lectures/back_prop.md b/lectures/back_prop.md index 9780ef8c3..76d5d1700 100644 --- a/lectures/back_prop.md +++ b/lectures/back_prop.md @@ -16,6 +16,17 @@ kernelspec: ```{include} _admonition/gpu.md ``` +In addition to what's included in base Anaconda, we need to install the following packages + +```{code-cell} ipython3 +:tags: [hide-output] + +!pip install kaleido +!conda install -y -c plotly plotly plotly-orca retrying +``` + +We also need to install JAX to run this lecture + ```{code-cell} ipython3 :tags: [skip-execution] @@ -28,15 +39,6 @@ import jax print(f"JAX backend: {jax.devices()[0].platform}") ``` -In addition to what's included in base Anaconda, we need to install the following packages - -```{code-cell} ipython3 -:tags: [hide-output] - -!pip install kaleido -!conda install -y -c plotly plotly plotly-orca retrying -``` - ```{note} If you are running this on Google Colab the above cell will present an error. This is because Google Colab doesn't use Anaconda to manage diff --git a/lectures/status.md b/lectures/status.md index ca1d9dd2e..2ec414c48 100644 --- a/lectures/status.md +++ b/lectures/status.md @@ -33,16 +33,16 @@ and the following package versions !conda list ``` +This lecture series has access to the following GPU + +```{code-cell} ipython +!nvidia-smi +``` + You can check the backend used by JAX using: ```{code-cell} ipython3 import jax # Check if JAX is using GPU print(f"JAX backend: {jax.devices()[0].platform}") -``` - -and this lecture series also has access to the following GPU - -```{code-cell} ipython -!nvidia-smi ``` \ No newline at end of file From 237102eea07fd47f56a56e1e75de0eea63a29a73 Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Mon, 18 Aug 2025 11:54:43 +1000 Subject: [PATCH 02/12] remove latex in interactive plot --- lectures/back_prop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lectures/back_prop.md b/lectures/back_prop.md index 76d5d1700..2c6480a49 100644 --- a/lectures/back_prop.md +++ b/lectures/back_prop.md @@ -523,7 +523,7 @@ predictions = vmap(compute_xδw_seq, in_axes=(None, 0))(params_ex1, grid)[0][:, ```{code-cell} ipython3 fig = go.Figure() -fig.add_trace(go.Scatter(x=grid, y=f_val, name=r'$-3x+2$')) +fig.add_trace(go.Scatter(x=grid, y=f_val, name=r'-3x+2')) fig.add_trace(go.Scatter(x=grid, y=predictions, name='Approximation')) # Export to PNG file From 660bfa2c932cb19d94fbace8e175958b794f44d9 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 18 Aug 2025 16:48:51 +1000 Subject: [PATCH 03/12] tmp: upload build reports from sphinx-tojupyter --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62a60d062..72ad37d7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,9 +51,8 @@ jobs: cp -u _build/jupyter/*.ipynb _build/html/_notebooks - name: Upload Execution Reports (Download Notebooks) uses: actions/upload-artifact@v4 - if: failure() with: - name: execution-reports + name: execution-reports-notebooks path: _build/jupyter/reports - name: Build PDF from LaTeX shell: bash -l {0} From fea2da00e1c7cfcf5bedebbf4c6d20e6e703a3c1 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 18 Aug 2025 17:18:39 +1000 Subject: [PATCH 04/12] tst: upgrade kaleido in the pip install? --- lectures/back_prop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lectures/back_prop.md b/lectures/back_prop.md index 2c6480a49..2115ebf49 100644 --- a/lectures/back_prop.md +++ b/lectures/back_prop.md @@ -21,7 +21,7 @@ In addition to what's included in base Anaconda, we need to install the followin ```{code-cell} ipython3 :tags: [hide-output] -!pip install kaleido +!pip install -U kaleido !conda install -y -c plotly plotly plotly-orca retrying ``` From 21416a9822f143eb28ec62db596f6e67514870b3 Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 21 Aug 2025 11:06:36 +1000 Subject: [PATCH 05/12] FIX: -c plolty not giving a recent enough version of plotly --- lectures/back_prop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lectures/back_prop.md b/lectures/back_prop.md index 2115ebf49..d17c1b8ec 100644 --- a/lectures/back_prop.md +++ b/lectures/back_prop.md @@ -21,8 +21,8 @@ In addition to what's included in base Anaconda, we need to install the followin ```{code-cell} ipython3 :tags: [hide-output] -!pip install -U kaleido -!conda install -y -c plotly plotly plotly-orca retrying +!pip install -U kaleido plotly +!conda install -y -c plotly plotly-orca ``` We also need to install JAX to run this lecture From 35e53e52b65542302fdaea24cd92d835e5365bc1 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Thu, 21 Aug 2025 11:35:44 +1000 Subject: [PATCH 06/12] Update lectures/back_prop.md --- lectures/back_prop.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lectures/back_prop.md b/lectures/back_prop.md index d17c1b8ec..36397a0c5 100644 --- a/lectures/back_prop.md +++ b/lectures/back_prop.md @@ -23,6 +23,7 @@ In addition to what's included in base Anaconda, we need to install the followin !pip install -U kaleido plotly !conda install -y -c plotly plotly-orca +!plotly_get_chrome ``` We also need to install JAX to run this lecture From 8e8526f3bd2faba23a2e42f7824dc9c99c6c6642 Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 21 Aug 2025 14:28:29 +1000 Subject: [PATCH 07/12] install chrome in linux, remove from back_prop --- .github/workflows/ci.yml | 6 ++++++ lectures/back_prop.md | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72ad37d7b..ac6122bb4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,12 @@ jobs: pip install --upgrade "jax[cuda12-local]==0.6.2" pip install numpyro pyro-ppl python scripts/test-jax-install.py + - name: Install Chrome + shell: bash -l {0} + run: | + wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + sudo apt install -y ./google-chrome-stable_current_amd64.deb + google-chrome --version - name: Check nvidia Drivers shell: bash -l {0} run: nvidia-smi diff --git a/lectures/back_prop.md b/lectures/back_prop.md index 36397a0c5..d17c1b8ec 100644 --- a/lectures/back_prop.md +++ b/lectures/back_prop.md @@ -23,7 +23,6 @@ In addition to what's included in base Anaconda, we need to install the followin !pip install -U kaleido plotly !conda install -y -c plotly plotly-orca -!plotly_get_chrome ``` We also need to install JAX to run this lecture From 37ad72cf5b4dfbb961fba582cd2b544424a0e331 Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 21 Aug 2025 15:29:13 +1000 Subject: [PATCH 08/12] revert to use in-lecture option using kaleido to install chrome --- .github/workflows/ci.yml | 12 ++++++------ lectures/back_prop.md | 21 ++++++++++++--------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac6122bb4..07a1c145d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,12 +26,12 @@ jobs: pip install --upgrade "jax[cuda12-local]==0.6.2" pip install numpyro pyro-ppl python scripts/test-jax-install.py - - name: Install Chrome - shell: bash -l {0} - run: | - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - sudo apt install -y ./google-chrome-stable_current_amd64.deb - google-chrome --version + # - name: Install Chrome + # shell: bash -l {0} + # run: | + # wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + # sudo apt install -y ./google-chrome-stable_current_amd64.deb + # google-chrome --version - name: Check nvidia Drivers shell: bash -l {0} run: nvidia-smi diff --git a/lectures/back_prop.md b/lectures/back_prop.md index d17c1b8ec..cc87b71ab 100644 --- a/lectures/back_prop.md +++ b/lectures/back_prop.md @@ -23,6 +23,17 @@ In addition to what's included in base Anaconda, we need to install the followin !pip install -U kaleido plotly !conda install -y -c plotly plotly-orca + +# kaleido needs chrome to build images +import kaleido +kaleido.get_chrome_sync() +``` + +```{note} +If you are running this on Google Colab the above cell will +present an error. This is because Google Colab doesn't use Anaconda to manage +the Python packages. However this lecture will still execute as Google Colab +has `plotly` installed. ``` We also need to install JAX to run this lecture @@ -35,15 +46,7 @@ We also need to install JAX to run this lecture ```{code-cell} ipython3 import jax -## to check that gpu is activated in environment -print(f"JAX backend: {jax.devices()[0].platform}") -``` - -```{note} -If you are running this on Google Colab the above cell will -present an error. This is because Google Colab doesn't use Anaconda to manage -the Python packages. However this lecture will still execute as Google Colab -has `plotly` installed. +print(f"JAX backend: {jax.devices()[0].platform}") # to check that gpu is activated in environment ``` ## Overview From 3ee8924de8e27bd6d52661d6a8ecf8a263a04302 Mon Sep 17 00:00:00 2001 From: mmcky Date: Fri, 22 Aug 2025 10:39:58 +1000 Subject: [PATCH 09/12] add new mimetype being emited --- lectures/_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/lectures/_config.yml b/lectures/_config.yml index 23a9a0c04..13c48b763 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -41,6 +41,7 @@ sphinx: # HTML ['html', 'application/vnd.jupyter.widget-view+json', 10], ['html', 'application/javascript', 20], + ['html', 'application/vnd.colab-display-data+json', 25], ['html', 'text/html', 30], ['html', 'text/latex', 40], ['html', 'image/svg+xml', 50], From 17ff8a01ed832d4c978e9ef04bc0c02f105b0083 Mon Sep 17 00:00:00 2001 From: mmcky Date: Fri, 22 Aug 2025 11:49:12 +1000 Subject: [PATCH 10/12] suppress unknown mimetype warnings -- colab as specialized output json now --- lectures/_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lectures/_config.yml b/lectures/_config.yml index 13c48b763..9fde9a122 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -37,11 +37,11 @@ sphinx: # false-positive links linkcheck_ignore: ['https://online.stat.psu.edu/stat415/book/export/html/834'] bibtex_reference_style: author_year + suppress_warnings: ["mystnb.unknown_mime_type"] nb_mime_priority_overrides: [ # HTML ['html', 'application/vnd.jupyter.widget-view+json', 10], ['html', 'application/javascript', 20], - ['html', 'application/vnd.colab-display-data+json', 25], ['html', 'text/html', 30], ['html', 'text/latex', 40], ['html', 'image/svg+xml', 50], From ab7560d44501b70317c2907e9a6fde4e5c8bb316 Mon Sep 17 00:00:00 2001 From: mmcky Date: Fri, 22 Aug 2025 12:27:44 +1000 Subject: [PATCH 11/12] tidy up and revert $ in plotly --- .github/workflows/ci.yml | 6 ------ lectures/back_prop.md | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07a1c145d..72ad37d7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,12 +26,6 @@ jobs: pip install --upgrade "jax[cuda12-local]==0.6.2" pip install numpyro pyro-ppl python scripts/test-jax-install.py - # - name: Install Chrome - # shell: bash -l {0} - # run: | - # wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - # sudo apt install -y ./google-chrome-stable_current_amd64.deb - # google-chrome --version - name: Check nvidia Drivers shell: bash -l {0} run: nvidia-smi diff --git a/lectures/back_prop.md b/lectures/back_prop.md index cc87b71ab..038d36983 100644 --- a/lectures/back_prop.md +++ b/lectures/back_prop.md @@ -526,7 +526,7 @@ predictions = vmap(compute_xδw_seq, in_axes=(None, 0))(params_ex1, grid)[0][:, ```{code-cell} ipython3 fig = go.Figure() -fig.add_trace(go.Scatter(x=grid, y=f_val, name=r'-3x+2')) +fig.add_trace(go.Scatter(x=grid, y=f_val, name=r'$-3x+2$')) fig.add_trace(go.Scatter(x=grid, y=predictions, name='Approximation')) # Export to PNG file From f62a9652dc1a60774c01069deb521cd8af878544 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Fri, 22 Aug 2025 14:30:09 +1000 Subject: [PATCH 12/12] Update .github/workflows/ci.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72ad37d7b..b559f4501 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,7 @@ jobs: cp -u _build/jupyter/*.ipynb _build/html/_notebooks - name: Upload Execution Reports (Download Notebooks) uses: actions/upload-artifact@v4 + if: failure() with: name: execution-reports-notebooks path: _build/jupyter/reports