Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[shape_poly] Improve handling of equality shape constraints #23470

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

gnecula
Copy link
Collaborator

@gnecula gnecula commented Sep 6, 2024

This fixes several bugs in presence of equality constraints where the left-hand side is just a dimension variable.

First, such constraints were not applied when parsing variables. Now, with a constraint a == b when we parse "a" we obtain b.

Second, when we evaluate symbolic dimensions that contain dimension variables that are constrained to be equal to something else, we may fail to find the dimension variable in the environment because the environment construction has applied the constraints. We fix this by looking up the unknown dimension variable in the equality constraints.

Fixes: #23437
Fixes: #23456

@gnecula gnecula self-assigned this Sep 6, 2024
@gnecula gnecula added the pull ready Ready for copybara import and testing label Sep 6, 2024
This fixes several bugs in presence of equality constraints where
the left-hand side is just a dimension variable.

First, such constraints were not applied when parsing variables.
Now, with a constraint `a == b` when we parse "a" we obtain `b`.

Second, when we evaluate symbolic dimensions that contain
dimension variables that are constrained to be equal to something
else, we may fail to find the dimension variable in the environment
because the environment construction has applied the constraints.
We fix this by looking up the unknown dimension variable in
the equality constraints.

Fixes: jax-ml#23437
Fixes: jax-ml#23456
@copybara-service copybara-service bot merged commit d776f1d into jax-ml:main Sep 6, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull ready Ready for copybara import and testing
Projects
None yet
1 participant