fix: make_mask uses deprecated jnp.bool instead of jnp.bool_ - #3371
Conversation
Greptile SummaryThis PR updates the bottom-right sliding-window mask helper to use
Confidence Score: 5/5The PR appears safe to merge with no blocking failure remaining. No blocking failure remains. Important Files Changed
Reviews (3): Last reviewed commit: "fix: make_mask uses deprecated jnp.bool ..." | Re-trigger Greptile |
| segment_pos_kv, | ||
| window_size, | ||
| dtype=jnp.bool, | ||
| dtype=jnp.bool_, |
There was a problem hiding this comment.
We seem to have a few other call sites of jnp.bool? If it's deprecated, could we fix those ones as well? Thanks.
I think we can get away with the test as well.
ff215b1 to
bcdd90f
Compare
|
@greptile-apps thanks for the review. I addressed the feedback as follows:
The branch has been amended to a single signed-off commit (bcdd90f) and force-pushed. |
|
The updated test is solid. The monkeypatching approach correctly intercepts the
One minor thing worth flagging: else make_swa_mask(segment_pos_q, segment_pos_kv, window_size, dtype=jnp.bool_)It's always passed as a keyword here, so this is fine for the current code. The test is tight enough. Overall, the fix is correct and the regression test is meaningfully stronger than the earlier version. LGTM. |
- Replace jnp.bool with jnp.bool_ in the bottom-right sliding-window mask path of make_mask. - Strengthen the regression test to capture the dtype actually passed to make_swa_mask, so reverting to jnp.bool fails the assertion. - No other jnp.bool call sites remain in tests/jax. Signed-off-by: Andrew White <andrewwhitecdw@users.noreply.github.com>
effc667 to
5f10860
Compare
This PR addresses the following issue in
tests/jax/test_fused_attn.py: make_mask uses deprecated jnp.bool instead of jnp.bool_.Changes
tests/jax/test_fused_attn.py: make_mask uses deprecated jnp.bool instead of jnp.bool_.Details
Tests
tests/jax/test_fused_attn.pyGreptile feedback addressed
test_make_mask_bottom_right_swa_dtypeto capture thedtypeactually passed tomake_swa_mask; reverting tojnp.boolnow fails the assertion.jnp.boolcall sites remain intests/jax.Local verification:
python3 -m py_compile tests/jax/test_fused_attn.pypassed. Full pytest execution was not feasible because JAX is not installed in this environment.