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

Fix torch linalg cholesky_ex #28773

Merged

Conversation

Daniel4078
Copy link
Contributor

PR Description

Related Issue

Closes #28772

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

@Daniel4078
Copy link
Contributor Author

Daniel4078 commented Jun 22, 2024

@Sam-Armstrong This experimental function is supposed to quckly and directly returning the LAPACK error codes (https://www.netlib.org/lapack/lug/node136.html) as its return when the normal cholesky would fail, by directly checking for the error before calcuating the cholesky value (https://pytorch.org/docs/stable/generated/torch.linalg.cholesky_ex.html). Though I don't know how to implement and test for that behavior. Though the tests are passing for now it seems.

@Daniel4078 Daniel4078 marked this pull request as ready for review June 22, 2024 00:02
Copy link
Contributor

@Sam-Armstrong Sam-Armstrong left a comment

Choose a reason for hiding this comment

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

I think we can just return a regular tuple rather than a named tuple, I know the torch function returns a named tuple, but practically I don't think there would really be a difference and I'm concerned that the named tuple could possibly cause problems for the transpiler. Otherwise the changes look good. Thanks @Daniel4078!

@Sam-Armstrong
Copy link
Contributor

I don't think you need to implement/test the LAPACK error codes right now, that's probably out of scope for the moment.

@Daniel4078
Copy link
Contributor Author

Daniel4078 commented Jun 27, 2024

I think we can just return a regular tuple rather than a named tuple, I know the torch function returns a named tuple, but practically I don't think there would really be a difference and I'm concerned that the named tuple could possibly cause problems for the transpiler. Otherwise the changes look good. Thanks @Daniel4078!

The reason why I use named tuple is that some other backend functions like ivy.svd did already return named tuple (

) and they seem to work fine.

Copy link
Contributor

@Sam-Armstrong Sam-Armstrong left a comment

Choose a reason for hiding this comment

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

Ah yeah, I think this is fine on second thought. Thanks a lot @Daniel4078!

@Sam-Armstrong Sam-Armstrong merged commit 5173264 into ivy-llc:main Jun 27, 2024
3 of 6 checks passed
@Daniel4078 Daniel4078 deleted the fix-torch-frontend-linalg.cholesky_ex branch June 27, 2024 23:09
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.

Fix Frontend Failing Test: torch - linalg.cholesky_ex
2 participants