Repository navigation
fix(colab): ask for a restart only when an upgraded module is already loaded - #218
Merged
Merged
Conversation
… 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>
Collaborator
Author
|
Merging with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #217.
Summary
_ensure_jax_floor(2026.11.12.1) asked for a runtime restart whenever jax or numpy was insys.modules. Importingautonerves.setup_colabitself 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:
ColabRestartRequiredis raised only if an upgraded module (jax/jaxlibornumpy) 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
ColabRestartRequiredmessage names the loaded module.Test Plan
🤖 Generated with Claude Code