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 miscellaneous dtype functions #2090

Merged

Conversation

ramiro050
Copy link
Collaborator

@ramiro050 ramiro050 commented May 3, 2023

This PR moves the FullyUnrollPrimLoopOp,
FoldPrimUncheckedCastOp and AbstractlyInterpretListOpsWithinABlock
patterns to the SimplifyAbstractInterpCalculationsUtils.cpp file so
that the dtype simplification pipeline can also use them.

In addition, the Aten__Getitem__TOp and PrimTupleUnpackOp
canonicalizers are added to the dtype simplification pipeline to deal
with the ops generated by the aten.cat dtype function.

Lastly, the dtype functions for the following ops are added:

  • AtenAtan2Op
  • AtenLinearOp
  • AtenMaxPool2dWithIndicesOp
  • AtenCatOp
  • Aten_ShapeAsTensorOp
  • AtenScalarImplicitOp
  • PrimNumToTensorScalarOp

@li-plus
Copy link
Collaborator

li-plus commented May 4, 2023

Would you make the CI pass? Maybe re-running it would help.

@ramiro050 ramiro050 force-pushed the add-misc-dtype-funcs branch 2 times, most recently from ccedcdb to 72b156d Compare May 4, 2023 21:22
ramiro050 added 2 commits May 4, 2023 22:32
This commit moves the `FullyUnrollPrimLoopOp`,
`FoldPrimUncheckedCastOp` and `AbstractlyInterpretListOpsWithinABlock`
patterns to the `SimplifyAbstractInterpCalculationsUtils.cpp` file so
that the dtype simplification pipeline can also use them.

In addition, the `Aten__Getitem__TOp` and `PrimTupleUnpackOp`
canonicalizers are added to the dtype simplification pipeline to deal
with the ops generated by the `aten.cat` dtype function.
This commit adds dtype functions for:

- AtenAtan2Op
- AtenLinearOp
- AtenMaxPool2dWithIndicesOp
- AtenCatOp
- Aten_ShapeAsTensorOp
- AtenScalarImplicitOp
- PrimNumToTensorScalarOp
@ramiro050 ramiro050 force-pushed the add-misc-dtype-funcs branch from 72b156d to 49cc402 Compare May 4, 2023 22:34
@ramiro050
Copy link
Collaborator Author

Would you make the CI pass? Maybe re-running it would help.

Done! @li-plus, PTAL


using namespace mlir;
using namespace mlir::torch;
using namespace mlir::torch::Torch;

namespace {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: all the patterns added here came from SimplifyShapeCalculations.cpp and have not been modified in any way.

Copy link
Collaborator

@li-plus li-plus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

@ramiro050 ramiro050 merged commit 423f94a into llvm:dtype-functions-staging May 5, 2023
@ramiro050 ramiro050 deleted the add-misc-dtype-funcs branch May 5, 2023 17:02
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