Skip to content

Removed deprecated torch.symeig and added torch.linalg.eigh#3272

Merged
JackCaoG merged 1 commit intopytorch:masterfrom
IvanYashchuk:remove-deprecated-symeig
Jan 24, 2023
Merged

Removed deprecated torch.symeig and added torch.linalg.eigh#3272
JackCaoG merged 1 commit intopytorch:masterfrom
IvanYashchuk:remove-deprecated-symeig

Conversation

@IvanYashchuk
Copy link
Copy Markdown
Contributor

@IvanYashchuk IvanYashchuk commented Jan 3, 2022

torch.symeig was deprecated in 1.9 release and will be removed in the next 1.11 release. This PR removes symeig and replaces it with linalg_eigh.

pytorch/pytorch#69857 that removes deprecated functions in PyTorch is currently blocked by pytorch/xla (see this failing CI).

@IvanYashchuk
Copy link
Copy Markdown
Contributor Author

IvanYashchuk commented Jan 4, 2022

Build fails with

/tmp/pytorch/xla/torch_xla/csrc/aten_xla_type.cpp:3009:12: error: prototype for ‘at::Tensor torch_xla::XLANativeFunctions::softplus_backward(const at::Tensor&, const at::Tensor&, const c10::Scalar&, const c10::Scalar&, const at::Tensor&)’ does not match any in class ‘torch_xla::XLANativeFunctions’
 at::Tensor XLANativeFunctions::softplus_backward(const at::Tensor& grad_output,
            ^~~~~~~~~~~~~~~~~~
In file included from /tmp/pytorch/xla/torch_xla/csrc/aten_xla_type.cpp:12:0:
/tmp/pytorch/xla/torch_xla/csrc/XLANativeFunctions.h:296:19: error: candidate is: static at::Tensor torch_xla::XLANativeFunctions::softplus_backward(const at::Tensor&, const at::Tensor&, const c10::Scalar&, const c10::Scalar&)
 static at::Tensor softplus_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & beta, const at::Scalar & threshold);

The same failure is on the master branch.

@JackCaoG
Copy link
Copy Markdown
Collaborator

JackCaoG commented Jan 5, 2022

@IvanYashchuk We are working on the fix, I will keep you updated.

Copy link
Copy Markdown
Collaborator

@JackCaoG JackCaoG left a comment

Choose a reason for hiding this comment

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

Minor nits, don't want to block the merge if it is urgent.

Comment thread test/test_ops.py Outdated
AllowedOpInfoEntry('linalg.cholesky_ex'),
AllowedOpInfoEntry('linalg.eig'),
# Tests fail because absolute values of eigenvectors should be compared
# AllowedOpInfoEntry('linalg.eigh'),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit, can we move this line back to the below disabled list?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

@kit1980
Copy link
Copy Markdown
Contributor

kit1980 commented Aug 30, 2022

@IvanYashchuk Should we revive this PR?

@IvanYashchuk
Copy link
Copy Markdown
Contributor Author

Yes, I'll do it shortly.

IvanYashchuk added a commit to IvanYashchuk/pytorch that referenced this pull request Jan 24, 2023
Updating the pin pointing to pytorch/xla#3272
It should resolve XLA failures introduced after merging pytorch#70988
@IvanYashchuk
Copy link
Copy Markdown
Contributor Author

@JackCaoG, PR removing symeig from PyTorch got merged pytorch/pytorch#70988 and there's a separate PR updating XLA pin to this PR pytorch/pytorch#92897.

commit 61c7b32
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Tue Jan 24 13:42:13 2023 +0200

    clang-format

commit 24540af
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Tue Jan 24 13:40:24 2023 +0200

    Remove symeig, add linalg_eigh to the header

commit 7247ed8
Merge: b83ae64 70cc629
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Tue Jan 24 13:35:03 2023 +0200

    Merge remote-tracking branch 'upstream/master' into remove-deprecated-symeig

commit b83ae64
Merge: e425589 281f369
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Wed Nov 23 11:01:53 2022 +0200

    Merge remote-tracking branch 'upstream/master' into remove-deprecated-symeig

commit e425589
Merge: 7eb9a56 a41a04b
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Sat Jan 29 16:45:49 2022 +0000

    Merge remote-tracking branch 'upstream/master' into remove-deprecated-symeig

commit 7eb9a56
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Sat Jan 29 11:11:38 2022 +0000

    Revert changes to test/test_ops.py

commit 3ca7b74
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Thu Jan 27 11:15:13 2022 +0000

    clang-format-7

commit be7fd91
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Thu Jan 27 10:30:26 2022 +0000

    Skip eigh OpInfo test

commit adae41f
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Thu Jan 27 10:26:58 2022 +0000

    clang-format-7

commit a820fa7
Merge: b826a4b 138a70f
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Thu Jan 27 10:17:17 2022 +0000

    Merge remote-tracking branch 'upstream/master' into remove-deprecated-symeig

commit b826a4b
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Thu Jan 27 10:17:12 2022 +0000

    Revert "Try branch with linalg_qr symbol"

    This reverts commit d01e622.

commit d01e622
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Thu Jan 13 01:41:21 2022 -0600

    Try branch with linalg_qr symbol

commit 83b1fa2
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Fri Jan 14 03:46:35 2022 -0600

    clang-format-7

commit 518d47a
Merge: 37f3e0e 7ff6a2c
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Fri Jan 14 03:45:16 2022 -0600

    Merge remote-tracking branch 'upstream/master' into remove-deprecated-symeig

commit 37f3e0e
Merge: d6c20a2 ddbc333
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Fri Jan 7 08:24:31 2022 +0000

    Merge remote-tracking branch 'upstream/master' into remove-deprecated-symeig

commit d6c20a2
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Mon Jan 3 14:34:57 2022 +0000

    linalg::eigh -> linalg_eigh

commit ac6db4d
Author: Ivan Yashchuk <ivan.yashchuk@aalto.fi>
Date:   Mon Jan 3 14:23:13 2022 +0000

    Removed torch.symeig and added torch.linalg.eigh
@IvanYashchuk IvanYashchuk force-pushed the remove-deprecated-symeig branch from 61c7b32 to ac3973e Compare January 24, 2023 12:05
@JackCaoG JackCaoG merged commit 282567a into pytorch:master Jan 24, 2023
JackCaoG added a commit that referenced this pull request Jan 24, 2023
JackCaoG added a commit that referenced this pull request Jan 24, 2023
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