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

feat: add lu_unpack function in Torch Frontend #27062

Closed
wants to merge 2 commits into from

Conversation

p1utoze
Copy link
Contributor

@p1utoze p1utoze commented Oct 17, 2023

PR Description

The lu_unpack function is limited to scipy, torch and paddle. As there are no backend functions implemented yet in Experimental API, I have written a custom and generic unpack for the 2D LU matrix along with the conversion of pivot indices to permutation matrix.
The multi-dimensional lu_unpack is a bit more complex and cluttered in the front-end function. It's better if it is implemented in the Experimental API.

Things to highlight:

  • Vectorizing pivot indices to permutation matrix may speed up computation but there are edge cases (repeated indices) in which results in mismatch from original torch.lu_unpack()
  • PyTorch lu unpack() supports only float and complex types

Related Issue

Closes #26225

Checklist

  • Did you add a function?
  • Did you add the tests?
  • Did you run your tests and are your tests passing?
  • Did pre-commit not fail on any check?
  • Did you follow the steps we provided?

Socials

@p1utoze p1utoze changed the title feat: add lu_unpack() torch frontend function feat: add lu_unpack function in Torch Frontend Oct 17, 2023
@ivy-leaves ivy-leaves added the PyTorch Frontend Developing the PyTorch Frontend, checklist triggered by commenting add_frontend_checklist label Oct 17, 2023
@github-actions
Copy link
Contributor

Thank you for this PR, here is the CI results:


This pull request does not result in any additional test failures. Congratulations!

@Sam-Armstrong
Copy link
Contributor

Sam-Armstrong commented Jul 11, 2024

closing, as the test fails. feel free to re-open if you get it working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PyTorch Frontend Developing the PyTorch Frontend, checklist triggered by commenting add_frontend_checklist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lu_unpack
5 participants