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

Added 2 Ops: Floor divide scalar and Floor divide scalar mode #3156

Merged
merged 23 commits into from
Apr 15, 2024

Conversation

IanWood1
Copy link
Contributor

@IanWood1 IanWood1 commented Apr 12, 2024

  • Added linalg lowering for AtenFloorDivideScalarOp
    • Needed AtenDivScalarModeOp for the decomp.
  • Added linalg lowering for AtenDivScalarModeOp
    • Moved linalg payload logic to createDivModePayload() since the logic was nearly identical for both AtenDivScalarModeOp and AtenDivTensorModeOp. Just a template function
  • Added AtenDivScalarModeOp lowering for stablehlo

Pytorch's torch.floor_divide() in a previous version (for a reason unknown to me) preformed a truncation instead of "floor". The already implemented op AtenFloorDivideTensorOp was done before this change. However, this wasn't caught because our testcases only tested positive floor division. I changed this to floor as well as adding a few test cases.

@IanWood1 IanWood1 closed this Apr 14, 2024
@IanWood1 IanWood1 reopened this Apr 14, 2024
@IanWood1 IanWood1 marked this pull request as ready for review April 15, 2024 04:15
@IanWood1
Copy link
Contributor Author

lib/Conversion/TorchToLinalg/Uncategorized.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToLinalg/Uncategorized.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToStablehlo/Basic.cpp Outdated Show resolved Hide resolved
@IanWood1
Copy link
Contributor Author

made requested changes: use non-member functions and removed includes

@renxida renxida removed the request for review from vivekkhandelwal1 April 15, 2024 19:21
@IanWood1 IanWood1 requested a review from rsuderman April 15, 2024 19:22
@rsuderman rsuderman merged commit 5708ee7 into llvm:main Apr 15, 2024
3 checks passed
@IanWood1
Copy link
Contributor Author

closes #3143

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