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

Add Scalarization Patterns for AtenToDtypeOp, AtenNegOp, AtenRemainderTensorOp #3861

Merged
merged 11 commits into from
Nov 12, 2024

Conversation

zjgarvey
Copy link
Collaborator

@zjgarvey zjgarvey commented Nov 9, 2024

  1. adds a lowering for aten.neg.int and aten.remainder.int to arith.
  2. adds a scalarization pattern for aten.neg and aten.remainder.Tensor ops.
  3. improves folding of aten.mul.int
  4. adds a scalarization pattern for aten.to.dtype which relies on scalar cast ops and basic C++ casting between double and int64_t.
  5. improves rank-0 case handling for FoldAtenSplatPattern
  6. removes a bug with aten.unflatten.int decomposition incorrectly generating a constant size int from a dynamic shape.
  7. simplifies the dim list for aten.unflatten.int ops generated from the aten.view canonicalization in scalarize shapes.

All of these changes were necessary to unblock iree-org/iree#18899.

@zjgarvey zjgarvey marked this pull request as ready for review November 11, 2024 19:32
lib/Conversion/TorchToArith/TorchToArith.cpp Outdated Show resolved Hide resolved
lib/Dialect/Torch/IR/TorchOps.cpp Outdated Show resolved Hide resolved
lib/Dialect/Torch/Transforms/ScalarizeShapes.cpp Outdated Show resolved Hide resolved
lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp Outdated Show resolved Hide resolved
lib/Dialect/Torch/Transforms/ScalarizeShapes.cpp Outdated Show resolved Hide resolved
@zjgarvey zjgarvey merged commit cd38ecf into llvm:main Nov 12, 2024
3 checks passed
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.

3 participants