-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Enable upper for torch.linalg.cholesky #62434
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
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 49f485a (more details on the Dr. CI page):
❄️ 1 failure tentatively classified as flakybut reruns have not yet been triggered to confirm:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thanks!
Could you also add some tests to make sure the argument works as we expect?
Note that we have the identity cholesky(A, upper=True) == cholesky(A).transpose(-2, -1).conj()
and an equivalent one for cholesky_ex
.
torch/linalg/__init__.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps
whether to return an upper triangular matrix. The tensor returned with
upper=True
is the conjugate transpose of the tensor returned withupper=False
.
Same in cholesky_ex
.
6f704f6
to
96f41fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these seems to be introducing backward incompatible changes to libtorch API (if i understand the CI job correctly). Should we keep those original signatures and redispatch them with default upper=False argument? did torch.cholesky have similar signature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
torch.cholesky
did have a similar signature. Any change in function signature in native_functions.yaml
is marked as backward-incompatible change. If we want to ignore it for now, then an entry to allow_list
in test/backward_compatibility/check_backward_compatibility.py
should be added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as well
96f41fb
to
8852eaf
Compare
@walterddr has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: a bug was discovered in #62434, for some reason comparing the schema name didn't match the allow_list item. So: 1. remove duplicate regex compile 2. make use of the schema string is used instead of just the name Pull Request resolved: #62687 Reviewed By: ezyang Differential Revision: D30102437 Pulled By: walterddr fbshipit-source-id: 541b2ed77948f24daebb08623cadabb034a241e0
e2729f2
to
cad0eb4
Compare
cad0eb4
to
49f485a
Compare
@walterddr has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@walterddr merged this pull request in 3782f3e. |
|
||
# "_ex" stands for experimental | ||
- func: linalg_cholesky_ex(Tensor self, *, bool check_errors=False) -> (Tensor L, Tensor info) | ||
- func: linalg_cholesky_ex(Tensor self, *, bool upper=False, bool check_errors=False) -> (Tensor L, Tensor info) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually an FC-breaking change but it's probably OK because this function is so new
upper (bool, optional): whether to return an upper triangular matrix. | ||
The tensor returned with upper=True is the conjugate transpose of the tensor | ||
returned with upper=False. | ||
check_errors (bool, optional): controls whether to check the content of ``infos``. Default: `False`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix
cc @t-vi |
Fixes #61988