Skip to content

Removed torch.qr and added torch.linalg.qr#3273

Open
IvanYashchuk wants to merge 1 commit into
pytorch:masterfrom
IvanYashchuk:remove-deprecated-qr
Open

Removed torch.qr and added torch.linalg.qr#3273
IvanYashchuk wants to merge 1 commit into
pytorch:masterfrom
IvanYashchuk:remove-deprecated-qr

Conversation

@IvanYashchuk
Copy link
Copy Markdown
Contributor

@IvanYashchuk IvanYashchuk commented Jan 3, 2022

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

pytorch/pytorch#70989 that removes deprecated functions in PyTorch is currently blocked by pytorch/xla.

@JackCaoG
Copy link
Copy Markdown
Collaborator

JackCaoG commented Jan 7, 2022

@IvanYashchuk head is green again, please rebase and the build should pass

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.

mostly lgtm

Comment thread test/cpp/test_aten_xla_tensor.cpp Outdated
@JackCaoG
Copy link
Copy Markdown
Collaborator

JackCaoG commented Feb 2, 2022

@IvanYashchuk Is the upstream pr going to make it to the pytorch 1.11? We will do our branch cur soon too.

@IvanYashchuk
Copy link
Copy Markdown
Contributor Author

It won't merged for 1.11 branch cut. Because of some internal issues removing of these deprecated functionality is postponed to the next 1.12 release.

@JackCaoG
Copy link
Copy Markdown
Collaborator

JackCaoG commented Feb 3, 2022

@IvanYashchuk Sounds good. We have a large pr we need to merge to pt/xla 1.10 and I was waiting for you to merge your pr first. I guess in this case I will try to merge that giant pr and it might cause some merge conflicts for you.

Copilot AI review requested due to automatic review settings May 27, 2026 12:39
@IvanYashchuk IvanYashchuk force-pushed the remove-deprecated-qr branch from fcc267a to 9b550e5 Compare May 27, 2026 12:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR migrates XLA QR support from the deprecated aten::qr path to aten::linalg_qr, and updates registrations/tests accordingly.

Changes:

  • Switches the IR op kind and native function entrypoint from qr to linalg_qr.
  • Updates autocast kernel registration to linalg_qr and removes/avoids qr.
  • Updates C++ tests to call torch::linalg_qr and updates the supported-op list.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
torch_xla/csrc/ops/qr.cpp Renames the node’s op kind to aten::linalg_qr.
torch_xla/csrc/autocast_mode.cpp Registers autocast kernel for linalg_qr and drops qr.
torch_xla/csrc/aten_xla_type.cpp Implements XLANativeFunctions::linalg_qr with mode parsing.
codegen/xla_native_functions.yaml Marks linalg_qr as supported (replacing qr).
test/cpp/test_aten_xla_tensor_2.cpp Updates the QR test to use torch::linalg_qr.
test/test_ops.py Removes a commented-out allowed-op entry for qr.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread codegen/xla_native_functions.yaml
Comment thread torch_xla/csrc/aten_xla_type.cpp Outdated
Comment thread torch_xla/csrc/aten_xla_type.cpp
@IvanYashchuk IvanYashchuk force-pushed the remove-deprecated-qr branch from 9b550e5 to 7f160da Compare May 27, 2026 13:18
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