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

[TorchToLinalg]Lower torch.gcd to linalg and scf #3732

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bratislavSyrmia
Copy link

Add verify() method to check if tensors are of
integer type. Also check if tensors are of same shape, or if the second tensor is a single element tensor.

Add e2e tests. Put them into onnx and stablehlo
xfailed sets.

@bratislavSyrmia
Copy link
Author

force push: added math::cttz instead of counting trailing zeros manually

Add verify() method to check if tensors are of
integer type. Also check if tensors are of same shape,
or if the second tensor is a single element tensor.

Add e2e tests. Put them into onnx and stablehlo
xfailed sets.
@bratislavSyrmia bratislavSyrmia force-pushed the lower_torch_aten_gcd_to_linalg_and_scf branch from 0815cd1 to 53b1ec3 Compare October 1, 2024 09:18
Copy link
Collaborator

@vivekkhandelwal1 vivekkhandelwal1 left a comment

Choose a reason for hiding this comment

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

Hi @bratislavSyrmia, I would like you to explore a non-loop path for this lowering, since these kind of lowerings usually causes issues in the downstream pipeline especially the code-generation part.

@IanWood1
Copy link
Contributor

Hi @bratislavSyrmia, I would like you to explore a non-loop path for this lowering, since these kind of lowerings usually causes issues in the downstream pipeline especially the code-generation part.

@vivekkhandelwal1 out of curiosity, do you have an algorithm/solution in mind? The best I could think of was to use linalg.generic's library_call attr and define a GCD function but maybe that runs into the same problem.

@vivekkhandelwal1
Copy link
Collaborator

Hi @bratislavSyrmia, I would like you to explore a non-loop path for this lowering, since these kind of lowerings usually causes issues in the downstream pipeline especially the code-generation part.

@vivekkhandelwal1 out of curiosity, do you have an algorithm/solution in mind? The best I could think of was to use linalg.generic's library_call attr and define a GCD function but maybe that runs into the same problem.

Hi @IanWood1, I did not spend time on thinking about it that's why I asked @bratislavSyrmia to explore the possibility of any such solution.

But if there exists a solution based on linalg.generic then it would still be a better approach then the current one.

@bratislavSyrmia
Copy link
Author

Hi @bratislavSyrmia, I would like you to explore a non-loop path for this lowering, since these kind of lowerings usually causes issues in the downstream pipeline especially the code-generation part.

@vivekkhandelwal1 out of curiosity, do you have an algorithm/solution in mind? The best I could think of was to use linalg.generic's library_call attr and define a GCD function but maybe that runs into the same problem.

Hi @IanWood1, I did not spend time on thinking about it that's why I asked @bratislavSyrmia to explore the possibility of any such solution.

But if there exists a solution based on linalg.generic then it would still be a better approach then the current one.

I have thought about it but I have no idea how I would find the greatest common divisor between two numbers without using loops

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