Fix: Modernize sharding detection and error messages for JAX 0.8.2 compatibility (#422) - #423
Fix: Modernize sharding detection and error messages for JAX 0.8.2 compatibility (#422)#423Ashutosh0x wants to merge 2 commits into
Conversation
|
Hi @Ashutosh0x thanks for the PR! Happy to accept it if you could address my comment + fix the style warnings from the CI. |
66b2b6a to
ba1e5fc
Compare
|
Thanks @hbq1! I've addressed the feedback:
Ready for another look! |
|
@hbq1 Since the PR is approved and CI is green, could you please merge it from your side? Thanks! |
|
@hbq1 gentle follow-up on this one, with a status check rather than just a ping. I re-verified against if not jax.typeof(x).sharding.is_fully_replicated:
return True
else:
return len(x.sharding.device_set) > 1
Current state, for whoever picks it up:
One caveat worth flagging: the green CI on this PR is from January, including the |
Resolves #422. This PR modernizes the _check_sharding function to use the leaf.sharding attribute directly for jax.Array objects, bypassing jax.typeof(leaf) which could be unreliable or inconsistent in newer JAX versions (0.4.35+ and the upcoming 0.8.x). It also refines sharding-related error messages to be more accurate while maintaining backward compatibility with existing test regexes.