Skip to content

[MAGMA] qr: deprecate MAGMA and dispatch to cuSOLVER unconditionally - #173788

Closed
nikitaved wants to merge 5 commits into
gh/nikitaved/28/basefrom
gh/nikitaved/28/head
Closed

nikitaved wants to merge 5 commits into
gh/nikitaved/28/basefrom
gh/nikitaved/28/head

Conversation

@nikitaved

@nikitaved nikitaved commented Jan 29, 2026 •

Copy link
Copy Markdown
Collaborator

Stack from ghstack (oldest at bottom):

Benchmarks on H100:

[--------------- torch.linalg.qr ---------------]                                                                                                                                       
                        |    magma    |  cusolver                                                                                                                                       
1 threads: --------------------------------------                                                                                                                                       
      (16, 4)           |     3003.1  |      53.2                                                                                                                                       
      (4, 16)           |     2985.2  |      77.5                                                                                                                                       
      (16, 16)          |     2635.1  |      60.0                                                                                                                                       
      (128, 32)         |     3004.9  |     189.0                                                                                                                                       
      (32, 128)         |     3107.8  |     135.5                                                                                                                                       
      (128, 128)        |     3688.3  |     611.5                                                                                                                                       
      (512, 128)        |     3862.1  |     457.9                                                                                                                                       
      (128, 512)        |     3645.4  |     669.3                                                                                                                                       
      (512, 512)        |     4815.7  |    1852.4                                                                                                                                       
      (2048, 512)       |     8958.8  |    2949.9                                                                                                                                       
      (512, 2048)       |     5812.5  |    2540.7                                                                                                                                       
      (2048, 2048)      |    20102.2  |   10749.8                                                                                                                                       
      (16, 16, 4)       |    41537.3  |     422.7                                                                                                                                       
      (16, 4, 16)       |    40861.3  |     429.3                                                                                                                                       
      (16, 16, 16)      |    40989.7  |     487.0                                                                                                                                       
      (16, 128, 32)     |    41950.1  |    1143.4                                                                                                                                       
      (16, 32, 128)     |    42032.6  |    2403.0                                                                                                                                       
      (16, 128, 128)    |    46964.5  |    8055.1                                                                                                                                       
      (16, 512, 128)    |    49646.0  |    7125.4                                                                                                                                       
      (16, 128, 512)    |    53973.8  |   49707.0                                                                                                                                       
      (16, 512, 512)    |    75648.4  |   29472.2                                                                                                                                       
      (16, 2048, 512)   |   141360.8  |   47124.6                                                                                                                                       
      (16, 512, 2048)   |    88497.4  |   40474.3                                                                                                                                       
      (16, 2048, 2048)  |   317109.9  |  172659.4                                                                                                                                       
      (64, 16, 4)       |   184853.8  |    1537.2                                                                                                                                       
      (64, 4, 16)       |   183240.0  |    1550.7
      (64, 16, 16)      |   176180.4  |    1722.3
      (64, 128, 32)     |   183096.8  |    3174.2
      (64, 32, 128)     |   171972.2  |    4400.2
      (64, 128, 128)    |   202024.5  |   10570.3
      (64, 512, 128)    |   201352.3  |   28660.5
      (64, 128, 512)    |   279550.8  |   52554.2
      (64, 512, 512)    |   359514.5  |  118561.6
      (64, 2048, 512)   |   598059.6  |  189165.5
      (64, 512, 2048)   |   353265.6  |  162186.6
      (64, 2048, 2048)  |  1334670.0  |  690921.4

Times are in microseconds (us).

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jan 29, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@pytorch-bot pytorch-bot Bot added the release notes: linalg_frontend release notes category label Jan 29, 2026
@pytorch-bot

pytorch-bot Bot commented Jan 29, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/173788

Note: Links to docs will display an error until the docs builds have been completed.

❌ 7 New Failures, 1 Cancelled Job, 4 Unrelated Failures

As of commit 3385049 with merge base 9a0c104 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOB - The following job was cancelled. Please retry:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Comment thread test/test_linalg.py
self.assertEqual(res, expected, msg=f"renorm failed for {p}-norm")

@skipCPUIfNoLapack
@skipCUDAIfNoCusolver

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.

This isn't just skipping RoCM is it? We have hipsolver APIs we could call

@nikitaved nikitaved Feb 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, we are not skipping ROCm. skipCUDAIfRocm is used to skip ROCm. NoCusolver checks for cuSOLVER or hipSOLVER.

[ghstack-poisoned]
nikitaved added a commit that referenced this pull request Feb 3, 2026
@nikitaved

nikitaved commented Feb 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

@Skylion007 , @eqy , could you please have a look?

@nikitaved

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@atalman

atalman commented Feb 4, 2026

Copy link
Copy Markdown
Collaborator

@pytorchmergebot revert -c nosignal -m "See #174281"

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@nikitaved your PR has been successfully reverted.

@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Feb 4, 2026
@atalman

atalman commented Feb 4, 2026

Copy link
Copy Markdown
Collaborator

@nikitaved please reland with ciflow/nightly label attached

[ghstack-poisoned]
@nikitaved nikitaved added ciflow/nightly Trigger all jobs we run nightly (nightly.yml) and removed ciflow/nightly Trigger all jobs we run nightly (nightly.yml) labels Feb 4, 2026
[ghstack-poisoned]
[ghstack-poisoned]
@atalman atalman added the ciflow/binaries Trigger all binary build and upload jobs on the PR label Feb 5, 2026
@nikitaved

Copy link
Copy Markdown
Collaborator Author

Not the cause of #174281.

@pytorchbot merge -i

radeksm pushed a commit to radeksm/pytorch that referenced this pull request Feb 20, 2026
…ytorch#173788)

Benchmarks on H100:
```
[--------------- torch.linalg.qr ---------------]
                        |    magma    |  cusolver
1 threads: --------------------------------------
      (16, 4)           |     3003.1  |      53.2
      (4, 16)           |     2985.2  |      77.5
      (16, 16)          |     2635.1  |      60.0
      (128, 32)         |     3004.9  |     189.0
      (32, 128)         |     3107.8  |     135.5
      (128, 128)        |     3688.3  |     611.5
      (512, 128)        |     3862.1  |     457.9
      (128, 512)        |     3645.4  |     669.3
      (512, 512)        |     4815.7  |    1852.4
      (2048, 512)       |     8958.8  |    2949.9
      (512, 2048)       |     5812.5  |    2540.7
      (2048, 2048)      |    20102.2  |   10749.8
      (16, 16, 4)       |    41537.3  |     422.7
      (16, 4, 16)       |    40861.3  |     429.3
      (16, 16, 16)      |    40989.7  |     487.0
      (16, 128, 32)     |    41950.1  |    1143.4
      (16, 32, 128)     |    42032.6  |    2403.0
      (16, 128, 128)    |    46964.5  |    8055.1
      (16, 512, 128)    |    49646.0  |    7125.4
      (16, 128, 512)    |    53973.8  |   49707.0
      (16, 512, 512)    |    75648.4  |   29472.2
      (16, 2048, 512)   |   141360.8  |   47124.6
      (16, 512, 2048)   |    88497.4  |   40474.3
      (16, 2048, 2048)  |   317109.9  |  172659.4
      (64, 16, 4)       |   184853.8  |    1537.2
      (64, 4, 16)       |   183240.0  |    1550.7
      (64, 16, 16)      |   176180.4  |    1722.3
      (64, 128, 32)     |   183096.8  |    3174.2
      (64, 32, 128)     |   171972.2  |    4400.2
      (64, 128, 128)    |   202024.5  |   10570.3
      (64, 512, 128)    |   201352.3  |   28660.5
      (64, 128, 512)    |   279550.8  |   52554.2
      (64, 512, 512)    |   359514.5  |  118561.6
      (64, 2048, 512)   |   598059.6  |  189165.5
      (64, 512, 2048)   |   353265.6  |  162186.6
      (64, 2048, 2048)  |  1334670.0  |  690921.4

Times are in microseconds (us).
```

Pull Request resolved: pytorch#173788
Approved by: https://github.com/eqy
ghstack dependencies: pytorch#173510, pytorch#173515
radeksm pushed a commit to radeksm/pytorch that referenced this pull request Feb 20, 2026
…ytorch#173788)

Benchmarks on H100:
```
[--------------- torch.linalg.qr ---------------]
                        |    magma    |  cusolver
1 threads: --------------------------------------
      (16, 4)           |     3003.1  |      53.2
      (4, 16)           |     2985.2  |      77.5
      (16, 16)          |     2635.1  |      60.0
      (128, 32)         |     3004.9  |     189.0
      (32, 128)         |     3107.8  |     135.5
      (128, 128)        |     3688.3  |     611.5
      (512, 128)        |     3862.1  |     457.9
      (128, 512)        |     3645.4  |     669.3
      (512, 512)        |     4815.7  |    1852.4
      (2048, 512)       |     8958.8  |    2949.9
      (512, 2048)       |     5812.5  |    2540.7
      (2048, 2048)      |    20102.2  |   10749.8
      (16, 16, 4)       |    41537.3  |     422.7
      (16, 4, 16)       |    40861.3  |     429.3
      (16, 16, 16)      |    40989.7  |     487.0
      (16, 128, 32)     |    41950.1  |    1143.4
      (16, 32, 128)     |    42032.6  |    2403.0
      (16, 128, 128)    |    46964.5  |    8055.1
      (16, 512, 128)    |    49646.0  |    7125.4
      (16, 128, 512)    |    53973.8  |   49707.0
      (16, 512, 512)    |    75648.4  |   29472.2
      (16, 2048, 512)   |   141360.8  |   47124.6
      (16, 512, 2048)   |    88497.4  |   40474.3
      (16, 2048, 2048)  |   317109.9  |  172659.4
      (64, 16, 4)       |   184853.8  |    1537.2
      (64, 4, 16)       |   183240.0  |    1550.7
      (64, 16, 16)      |   176180.4  |    1722.3
      (64, 128, 32)     |   183096.8  |    3174.2
      (64, 32, 128)     |   171972.2  |    4400.2
      (64, 128, 128)    |   202024.5  |   10570.3
      (64, 512, 128)    |   201352.3  |   28660.5
      (64, 128, 512)    |   279550.8  |   52554.2
      (64, 512, 512)    |   359514.5  |  118561.6
      (64, 2048, 512)   |   598059.6  |  189165.5
      (64, 512, 2048)   |   353265.6  |  162186.6
      (64, 2048, 2048)  |  1334670.0  |  690921.4

Times are in microseconds (us).
```

Pull Request resolved: pytorch#173788
Approved by: https://github.com/eqy
ghstack dependencies: pytorch#173515
libohao1201 pushed a commit to libohao1201/pytorch that referenced this pull request Mar 2, 2026
…ytorch#173788)

Benchmarks on H100:
```
[--------------- torch.linalg.qr ---------------]
                        |    magma    |  cusolver
1 threads: --------------------------------------
      (16, 4)           |     3003.1  |      53.2
      (4, 16)           |     2985.2  |      77.5
      (16, 16)          |     2635.1  |      60.0
      (128, 32)         |     3004.9  |     189.0
      (32, 128)         |     3107.8  |     135.5
      (128, 128)        |     3688.3  |     611.5
      (512, 128)        |     3862.1  |     457.9
      (128, 512)        |     3645.4  |     669.3
      (512, 512)        |     4815.7  |    1852.4
      (2048, 512)       |     8958.8  |    2949.9
      (512, 2048)       |     5812.5  |    2540.7
      (2048, 2048)      |    20102.2  |   10749.8
      (16, 16, 4)       |    41537.3  |     422.7
      (16, 4, 16)       |    40861.3  |     429.3
      (16, 16, 16)      |    40989.7  |     487.0
      (16, 128, 32)     |    41950.1  |    1143.4
      (16, 32, 128)     |    42032.6  |    2403.0
      (16, 128, 128)    |    46964.5  |    8055.1
      (16, 512, 128)    |    49646.0  |    7125.4
      (16, 128, 512)    |    53973.8  |   49707.0
      (16, 512, 512)    |    75648.4  |   29472.2
      (16, 2048, 512)   |   141360.8  |   47124.6
      (16, 512, 2048)   |    88497.4  |   40474.3
      (16, 2048, 2048)  |   317109.9  |  172659.4
      (64, 16, 4)       |   184853.8  |    1537.2
      (64, 4, 16)       |   183240.0  |    1550.7
      (64, 16, 16)      |   176180.4  |    1722.3
      (64, 128, 32)     |   183096.8  |    3174.2
      (64, 32, 128)     |   171972.2  |    4400.2
      (64, 128, 128)    |   202024.5  |   10570.3
      (64, 512, 128)    |   201352.3  |   28660.5
      (64, 128, 512)    |   279550.8  |   52554.2
      (64, 512, 512)    |   359514.5  |  118561.6
      (64, 2048, 512)   |   598059.6  |  189165.5
      (64, 512, 2048)   |   353265.6  |  162186.6
      (64, 2048, 2048)  |  1334670.0  |  690921.4

Times are in microseconds (us).
```

Pull Request resolved: pytorch#173788
Approved by: https://github.com/eqy
ghstack dependencies: pytorch#173510, pytorch#173515
@github-actions
github-actions Bot deleted the gh/nikitaved/28/head branch March 9, 2026 02:22
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR ciflow/binaries Trigger all binary build and upload jobs on the PR ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: linalg_frontend release notes category Reverted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants