Repository navigation
Whole lectures on RunsOn: lecture-python.myst as well as lecture-jax - #19
Conversation
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]>
There was a problem hiding this comment.
🟡 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_lecturesfrom a boolean to achoiceand drive the job via a matrix (["cuda cpu"]for lecture-jax vs["cuda","cpu"]for lecture-python), with conditionaltimeout-minutesand a new per-lectureCAPenv var. - Make
lectures_set.shread the per-lecture timeout fromCAP(default 3600s) instead of hardcoding one hour. - Document the two lecture sets, caps, and
CAPusage inlectures/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
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]>
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]>

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
run_lecturesno,lecture-jaxorlecture-pythonlectures-python.txt, at lecture-python.myst087518ec0environment.txtwithout the macOS-onlyappnopeCAPinlectures_set.sh), sinceimp_sampletook 783 s on the M5 Pro and the runner's CPU has 4 coreslectures/results/<host>/<date>/whole/lecture-python/, as the M5 Pro's areWhy 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.2xlargeinstances, 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