Skip to content

Align cdiv behavior for negative numbers between Python and JAX paths. - #40198

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_970570489
Open

Align cdiv behavior for negative numbers between Python and JAX paths.#40198
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_970570489

Conversation

@copybara-service

Copy link
Copy Markdown

Align cdiv behavior for negative numbers between Python and JAX paths.

This change updates the cdiv implementation in pallas/utils.py to use truncation division instead of floor division when evaluating with Python integers (the is_dim path). This ensures consistency with the JAX lax.div path, which also uses truncation division. A new test suite is added to verify cdiv behavior across various inputs, JIT compilation, and property-based tests.

This change updates the cdiv implementation in pallas/utils.py to use truncation division instead of floor division when evaluating with Python integers (the is_dim path). This ensures consistency with the JAX lax.div path, which also uses truncation division. A new test suite is added to verify cdiv behavior across various inputs, JIT compilation, and property-based tests.

PiperOrigin-RevId: 970570489
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.

1 participant