Skip to content

fix(colab): ask for a restart only when an upgraded module is already loaded - #218

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/colab-restart-fix
Nov 12, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/colab-restart-fix

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Fixes #217.

Summary

_ensure_jax_floor (2026.11.12.1) asked for a runtime restart whenever jax or numpy was in sys.modules. Importing autonerves.setup_colab itself loads numpy (not jax), so on live Colab (jax 0.11.1, numpy 2.4.6) every user was told to restart after a jax-only upgrade, and Heart's Colab gate (check F) failed (setup cell rc=1, Heart run 43238247828).

Now:

  • only what is below the floor is upgraded: jax+jaxlib together, numpy only if < 2.2, the matching CUDA plugin with jax;
  • ColabRestartRequired is raised only if an upgraded module (jax/jaxlib or numpy) is already loaded, and the message names it.

On Colab jax isn't imported before the setup cell, so the common case completes with no restart.

API Changes

None. Behaviour change: fewer restart prompts; the ColabRestartRequired message names the loaded module.

Test Plan

  • New gate tests, including the live-Colab case (old jax, numpy 2.4.6 loaded, jax not loaded: upgrade jax only, no restart). Control: 5/8 fail against the released bootstrap.
  • Nerves suite: 308 passed.
  • CI, including the colab-gate check.
  • Check F clears after the next release (it audits the released bootstrap).

🤖 Generated with Claude Code

… loaded

_ensure_jax_floor raised ColabRestartRequired whenever jax OR numpy was in
sys.modules. Importing setup_colab itself loads numpy, so on live Colab (jax
0.11.1, numpy 2.4.6) every user was asked to restart after a jax-only
upgrade, and Heart's Colab gate (check F) failed. Now only what is below the
floor is upgraded (jax+jaxlib together, numpy only if <2.2, the CUDA plugin
with jax), and a restart is requested only if an upgraded module is already
loaded. On Colab jax is not loaded before the setup cell, so most users need
no restart.

Fixes #217

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Nov 12, 2026
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Merging with colab-gate red, on the maintainer's instruction (2026-11-12). That gate always runs the released 2026.11.12.1 bootstrap; its traceback shows the old message, so it can't see this branch and goes green only after the next release. Branch evidence: unit tests green, plus a local live-Colab simulation (jax 0.11.1 + numpy 2.4.6, real pip, this branch's setup_colab): jax upgraded only, no restart, and the same process then runs jax 0.12.0.1.

@Jammy2211
Jammy2211 merged commit 5aa847f into main Nov 12, 2026
3 of 4 checks passed
@Jammy2211
Jammy2211 deleted the feature/colab-restart-fix branch November 12, 2026 15:49
@pyautolabs-bot pyautolabs-bot Bot removed the pending-release PR queued for the next release build label Nov 13, 2026
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.

fix(colab): ask for a restart only when an upgraded module is already loaded

1 participant