fix: update scan propagation for JAX 0.11's num_consts/num_carry removal - #180
Conversation
JAX 0.11.0 replaced the scan_p eqn params num_consts/num_carry with ft_in/ft_out (an FTTuple splitting invars into consts/carry/xs groups), breaking _prop_scan with KeyError: 'num_consts'. Derive the counts from ft_in.unpack() instead, and bump the jax floor to >=0.11.0 accordingly. Since jax 0.11.0 requires Python>=3.12, drop Python 3.11 support too. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@adrhill why isn't CI running for this one? |
|
I think because you are not trying to merge into asdex/.github/workflows/ci.yml Lines 1 to 7 in 3209417 |
|
Ah, it's the branch from PR #179. |
|
I merged it, I assume a follow-up commit will trigger CI now. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #180 +/- ##
==========================================
- Coverage 93.81% 93.81% -0.01%
==========================================
Files 61 61
Lines 4056 4055 -1
==========================================
- Hits 3805 3804 -1
Misses 251 251 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| num_consts, num_carry, _num_xs = ( | ||
| len(group) for group in eqn.params["ft_in"].unpack() | ||
| ) |
There was a problem hiding this comment.
If this opens up new use-cases for scan, we should add tests (or at least open an issue documenting this for a follow-up PR, since it is undocumented).
|
We will want to tag a patch release for this. We could also upper bound JAX, but I worry |
|
Unlike Julia, the current Touching on the NumPy version bound you mentioned in #181, I just found this:
|
|
Is this ready to merge @gdalle? |
|
Yes, up to you deciding on lower bounds |
Summary
num_consts/num_carryparams on thescaneqn in favor offt_in/ft_out(anFTTuplesplitting invars into consts/carry/xs groups), which broke_prop_scanwithKeyError: 'num_consts'(21 failing tests intests/_interpret/test_scan.py).num_consts/num_carryfromeqn.params["ft_in"].unpack()instead.jaxfloor to>=0.11.0to match. Sincejax>=0.11.0requires Python>=3.12, also drop Python 3.11 support (requires-python, classifiers, CI matrix).Test plan
uv run pytest— 4002 passed, 1 skipped, 0 faileduv run ruff check ./uv run ruff format --check .uv run ty check🤖 Generated with Claude Code