openxla / xla

A machine learning compiler for GPUs, CPUs, and ML accelerators
Apache License 2.0
2.55k stars 394 forks source link

Fix removal of constraints using dimensions in RemoveUnusedSymbols. #14901

Closed copybara-service[bot] closed 1 month ago

copybara-service[bot] commented 1 month ago

Fix removal of constraints using dimensions in RemoveUnusedSymbols.

Removing a constraint on a dimension is invalid, even if the dimension is unused in the affine map. The constraint still restricts the domain of the map.

In some cases we could use the constraint to tighten the bounds of the unused dimension instead, e.g. if both d0 and s0 are unused in:

d0 in [0, 100]
s0 in [2, 3]
d0 + s0 in [2, 3]

We could change the bound of d0 to [0, 1]. But this is not always possible and requires some extra work.