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.

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