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

Enable import_symbolic_shape_expressions in the FxImporter. #179

Merged
merged 2 commits into from
Sep 30, 2024

Conversation

stellaraccident
Copy link
Collaborator

  • Adds an option to aot.export(import_symbolic_shape_expressions=True) to enable emission of torch-mlir symbolic shape constraints. This is currently set to False until IREE is ready to ingest these by default.

Rough sequence of work in IREE proper:

  • Custom lowering of torch.symbolic_int and torch.bind_symbolic_shape ops to IREE util "assume" ops. Note that we are only planning to lower "terminal" bindings (basically function arguments and a couple of other such categories).
  • Canonicalizations to ensure that assume equalities are == 0 (versus the native form from torch where they assume a non zero equality).
  • Fusion will clone corresponding bindings on dependent dims into dispatch regions.
  • Existing linalg shape analysis extended and queryable by codegen.

* Adds an option to `aot.export(import_symbolic_shape_expressions=True)` to enable emission of torch-mlir symbolic shape constraints. This is currently set to False until IREE is ready to ingest these by default.

Rough sequence of work in IREE proper:

* Custom lowering of `torch.symbolic_int` and `torch.bind_symbolic_shape` ops to IREE util "assume" ops. Note that we are only planning to lower "terminal" bindings (basically function arguments and a couple of other such categories).
* Canonicalizations to ensure that assume equalities are == 0 (versus the native form from torch where they assume a non zero equality).
* Fusion will clone corresponding bindings on dependent dims into dispatch regions.
* Existing linalg shape analysis extended and queryable by codegen.

Signed-off-by: Stella Laurenzo <stellaraccident@gmail.com>
@stellaraccident stellaraccident force-pushed the enable_torch_symbolic_constraints branch from ef57f73 to 731ecda Compare September 30, 2024 22:31
Signed-off-by: Stella Laurenzo <stellaraccident@gmail.com>
@stellaraccident stellaraccident marked this pull request as ready for review September 30, 2024 22:41
@stellaraccident stellaraccident merged commit 621cbe1 into main Sep 30, 2024
4 of 8 checks passed
@stellaraccident stellaraccident deleted the enable_torch_symbolic_constraints branch September 30, 2024 22:47
stellaraccident added a commit that referenced this pull request Oct 13, 2024
* Adds an option to `aot.export(import_symbolic_shape_expressions=True)`
to enable emission of torch-mlir symbolic shape constraints. This is
currently set to False until IREE is ready to ingest these by default.

Rough sequence of work in IREE proper:

* Custom lowering of `torch.symbolic_int` and
`torch.bind_symbolic_shape` ops to IREE util "assume" ops. Note that we
are only planning to lower "terminal" bindings (basically function
arguments and a couple of other such categories).
* Canonicalizations to ensure that assume equalities are == 0 (versus
the native form from torch where they assume a non zero equality).
* Fusion will clone corresponding bindings on dependent dims into
dispatch regions.
* Existing linalg shape analysis extended and queryable by codegen.

---------

Signed-off-by: Stella Laurenzo <stellaraccident@gmail.com>
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.

2 participants