Skip to content

Whole lectures on RunsOn: lecture-python.myst as well as lecture-jax - #19

Merged
mmcky merged 2 commits into
mainfrom
whole-lectures-python-runson
Nov 1, 2026
Merged

mmcky merged 2 commits into
mainfrom
whole-lectures-python-runson

Conversation

@mmcky

@mmcky mmcky commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

For #4: the workflow's whole-lecture job can now run lecture-python.myst's 33 JAX lectures on the T4, as the M5 Pro ran them in #15.

What changes

Before After
run_lectures A boolean: lecture-jax A choice: no, lecture-jax or lecture-python
lecture-python's lectures — lectures-python.txt, at lecture-python.myst 087518ec0
lecture-python's packages — The TITAN RTX run's, plus what the M5 Pro run added (NumPyro, ArviZ, PyMC, pandas-datareader and the rest), at the same versions, from its environment.txt without the macOS-only appnope
Jobs One: the card, then the CPU, lecture by lecture lecture-jax unchanged. lecture-python runs as two jobs in parallel, the card and the CPU on an instance each
Each lecture's cap One hour Two hours for lecture-python (CAP in lectures_set.sh), since imp_sample took 783 s on the M5 Pro and the runner's CPU has 4 cores
The job's cap Five hours Ten hours for lecture-python
Results lectures/results/<host>/<date>/whole/ lecture-python's in lecture-python/, as the M5 Pro's are

Why two jobs: three runs of both platforms are estimated at about ten hours on one g4dn.2xlarge. Split, they take about five, at the same cost. Each platform's three runs still interleave by lecture on one instance.

The workflow keeps its 10 inputs: the lecture set replaces the old boolean rather than adding an input.

Running now from this branch: run 41271786393, estimated at about USD 7 on two g4dn.2xlarge instances, and at most USD 15 under the job caps. The results will follow in their own PR, as #12 followed #10.

🤖 Generated with Claude Code

run_lectures becomes a choice of lecture set. lecture-python fetches the 33
lectures in lectures-python.txt at lecture-python.myst 087518ec0, adds the
M5 Pro run's packages, and runs the card and the CPU as two jobs on their
own instances, since three runs of each would take about ten hours on one.
Each lecture gets two hours there (CAP in lectures_set.sh), against one for
lecture-jax, and each job ten.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 1, 2026 04:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical unresolved defect remains where the log= command substitution returns non-zero under set -e on the default lecture-jax path, breaking that job entirely until a fallback is added.

1 open issue
What changed in this PR

This PR extends the existing benchmark-lectures ("Whole Lectures") RunsOn job in .github/workflows/benchmark.yml so it can run either set of JAX lectures: the existing lecture-jax set, or now lecture-python.myst's 33 JAX lectures (added in #15, listed in lectures/whole/lectures-python.txt). The run_lectures input becomes a 3-way choice (no / lecture-jax / lecture-python). For lecture-python, the card and host CPU run as two parallel jobs on separate instances, with larger per-lecture and per-job caps, results written to a lecture-python/ subdirectory, and extra packages (the M5 Pro run's, minus macOS-only appnope) installed on top of the TITAN RTX environment. This fits issue #4's goal of timing every JAX lecture across devices.

Changes:

  • Convert run_lectures from a boolean to a choice and drive the job via a matrix (["cuda cpu"] for lecture-jax vs ["cuda","cpu"] for lecture-python), with conditional timeout-minutes and a new per-lecture CAP env var.
  • Make lectures_set.sh read the per-lecture timeout from CAP (default 3600s) instead of hardcoding one hour.
  • Document the two lecture sets, caps, and CAP usage in lectures/whole/README.md.
File Description
.github/​workflows/​benchmark.yml Converts the input to a choice, adds a platform matrix, conditional caps/paths, extra-package install, and per-set fetch/output logic
lectures/​whole/​lectures_set.sh Reads per-lecture timeout from CAP (default 3600) and updates the header comment
lectures/​whole/​README.md Adds a table of the two lecture sets, their caps, and notes that CAP controls the per-lecture cap

I found one blocking issue worth highlighting: the log= assignment (line 404) has no || ... fallback, so under the default Actions shell (bash -eo pipefail) it aborts the "Run every lecture" step on the lecture-jax path before any lecture runs — a regression for the previously-working set. The suggested one-line fix adds || true, mirroring the safe out= assignment just above it. The rest of the matrix/cap/artifact logic and the README/script changes are consistent.

Review effort: Balanced

Comment thread .github/workflows/benchmark.yml Resolved
Under the step's set -e, the log= assignment's command substitution
returned non-zero when SET wasn't lecture-python, which stopped the
step before any lecture-jax lecture ran. Copilot's review of #19.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mmcky
mmcky merged commit 14a550c into main Nov 1, 2026
@mmcky
mmcky deleted the whole-lectures-python-runson branch November 1, 2026 09:50
mmcky added a commit that referenced this pull request Nov 1, 2026
Run 41271786393 of the run_lectures job with lecture-python (#19), on
RunsOn's g4dn.2xlarge, three runs of the 33 lectures on each device.
The README's lecture-python section gains the per-lecture table.

run_lecture.py: a lecture that asks for a platform the run withholds
(sargent_surico sets jax_platform_name to cpu, under JAX_PLATFORMS=cuda)
made jax.devices() raise after the cells had run, so no row was written.
It now resets the platform, records platform_error, and keeps the row.

Also corrects the README's sargent_surico comparison with
QuantEcon/lecture-python.myst#1022, whose 157 s is the NUTS cell, not
the lecture.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants