Skip to content

[TorchToLinalg] : Lower count_nonzero to Linalg-on-Tensors #4145

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

Conversation

um-urosmarkovic
Copy link
Contributor

@um-urosmarkovic um-urosmarkovic commented Apr 17, 2025

  • Lowered count_nonzero op to Linalg-on-Tensors
  • Decomposed aten.count_nonzero using aten.ne.Scalar and aten.sum/aten.sum.dim_IntList
  • Added tests to torch-mlir/projects/pt1/python/torch_mlir_e2e_test/test_suite/reduction.py

@um-urosmarkovic um-urosmarkovic force-pushed the feature/um-urosmarkovic/count_nonzero branch from 0d5418c to 441c238 Compare April 18, 2025 02:08
@um-urosmarkovic
Copy link
Contributor Author

um-urosmarkovic commented Apr 18, 2025

Hi @vivekkhandelwal1 , could you please approve the workflows when you get the chance? Thanks in advance!

@um-urosmarkovic um-urosmarkovic force-pushed the feature/um-urosmarkovic/count_nonzero branch from 441c238 to 6525c97 Compare April 19, 2025 12:07
@um-urosmarkovic
Copy link
Contributor Author

Hi @vivekkhandelwal1 , I’ve rebased the branch and the CI workflows need maintainer approval again. Could you please click “Approve and run” when you have a moment? Thanks!

@um-urosmarkovic um-urosmarkovic force-pushed the feature/um-urosmarkovic/count_nonzero branch from 6525c97 to d474f6b Compare April 22, 2025 11:46
@um-urosmarkovic
Copy link
Contributor Author

Thanks for the review, @vivekkhandelwal1! I think I have addressed all requested changes—please let me know if there’s anything else to fix.

@um-urosmarkovic um-urosmarkovic force-pushed the feature/um-urosmarkovic/count_nonzero branch from d474f6b to 79c50e1 Compare April 22, 2025 11:52
@um-urosmarkovic um-urosmarkovic force-pushed the feature/um-urosmarkovic/count_nonzero branch from 79c50e1 to 1573ce3 Compare April 22, 2025 12:44
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.

LGTM

@um-urosmarkovic
Copy link
Contributor Author

Thanks @vivekkhandelwal1 ! Could you, please, help me merge it? I don’t have the permissions. Much appreciated!

@vivekkhandelwal1 vivekkhandelwal1 merged commit 2cd3ff9 into llvm:main May 6, 2025
3 checks passed
@um-urosmarkovic um-urosmarkovic deleted the feature/um-urosmarkovic/count_nonzero branch May 9, 2025 07:59
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