Skip to content

[ROCm] Enabled test_linalg tests that were skipped due to skipCUDAIfNoMagmaAndNoCusolver - #180303

Closed
akashveramd wants to merge 5 commits into
pytorch:mainfrom
akashveramd:av_enable_linalg_tests
Closed

akashveramd wants to merge 5 commits into
pytorch:mainfrom
akashveramd:av_enable_linalg_tests

Conversation

@akashveramd

@akashveramd akashveramd commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

In this PR, we have enabled test_linalg tests that were skipped due to skipCUDAIfNoMagmaAndNoCusolver decorator on environments without Magma. It currently uses hipsolver via skipCUDAIfNoMagmaAndNoLinalgsolver decorator.

These linalg tests are now passing for ROCm-
test_det
test_eigh
test_norm_matrix
test_cond
test_cond_errors_and_warnings
test_norm_complex
test_matrix_norm
test_norm_extreme_values
test_norm_vector_degenerate_shapes
test_norm_matrix_degenerate_shapes_old_numpy
test_norm_old
test_norm_complex_old
test_nuclear_norm_axes_small_brute_force_old
test_nuclear_norm_exceptions_old
test_inverse
test_inv_ex_info_device
test_inv_ex_singular
test_inverse_many_batches
test_inverse_errors
test_inverse_errors_large
test_pinv
test_pinv_errors_and_warnings
test_inv_errors_and_warnings
test_solve
test_solve_batched_broadcasting
test_tensorsolve
test_tensorsolve_empty
test_tensorsolve_errors_and_warnings
test_tensorinv
test_tensorinv_empty
test_tensorinv_errors_and_warnings
test_tensorinv_singular_input
test_matrix_rank
test_matrix_rank_atol
test_matrix_rank_atol_rtol
test_matrix_rank_empty
test_matrix_rank_out_errors_and_warnings
test_matrix_rank_basic
test_lu_unpack_check_input
test_lobpcg_basic
test_pinverse
test_matrix_power_non_negative
test_matrix_power_negative
test_linalg_matrix_exp_utils
test_linalg_matrix_exp_boundary_cases
test_matrix_exp_backward_input_validation
test_linalg_matrix_exp_perverse_nan_values
test_linalg_matrix_exp_analytic
test_linalg_matrix_exp_batch
test_linalg_matrix_exp_compare_with_taylor
test_slogdet
test_slogdet_errors_and_warnings
test_nuclear_norm_out
test_lapack_empty
test_ldl_factor
test_ldl_solve

With the added changes the linalg tests are now passing for ROCm and it can be confirmed from the attached log
test_linalg_1.1_c58bd1f97bfa93ee_.log

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang

@pytorch-bot

pytorch-bot Bot commented Apr 14, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 2 New Failures, 7 Unrelated Failures

As of commit 04cad3d with merge base f0780d0 (image):

NEW FAILURES - The following jobs have failed:

UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:

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

@pytorch-bot pytorch-bot Bot added module: rocm AMD GPU support for Pytorch topic: not user facing topic category labels Apr 14, 2026
@jithunnair-amd jithunnair-amd added ciflow/trunk Trigger trunk jobs on your pull request ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 keep-going Don't stop on first failure, keep running tests until the end labels Apr 14, 2026
@jithunnair-amd

Copy link
Copy Markdown
Collaborator

@pytorchbot rebase

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Tried to rebase and push PR #180303, but it was already up to date. Try rebasing against main by issuing:
@pytorchbot rebase -b main

@jithunnair-amd

Copy link
Copy Markdown
Collaborator

@pytorchbot rebase -b main

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/main. Check the current status here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Successfully rebased av_enable_linalg_tests onto refs/remotes/origin/main, please pull locally before adding more changes (for example, via git checkout av_enable_linalg_tests && git pull --rebase)

@pytorchmergebot
pytorchmergebot force-pushed the av_enable_linalg_tests branch from f09ead5 to bfddc37 Compare April 14, 2026 02:26
@pytorch-bot pytorch-bot Bot removed ciflow/trunk Trigger trunk jobs on your pull request ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 labels Apr 14, 2026
@soulitzer
soulitzer requested a review from jeffdaily April 15, 2026 16:19
@soulitzer soulitzer added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Apr 15, 2026
@akashveramd

Copy link
Copy Markdown
Contributor Author

@pytorchbot run ciflow/rocm-mi200

@pytorch-bot

pytorch-bot Bot commented Apr 15, 2026

Copy link
Copy Markdown

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: argument command: invalid choice: 'run' (choose from 'merge', 'revert', 'rebase', 'label', 'drci', 'lint', 'fix-lint', 'apply-lint', 'cherry-pick')

usage: @pytorchbot [-h]
                   
                   {merge,revert,rebase,label,drci,lint,fix-lint,apply-lint,cherry-pick}
                   ...

Try @pytorchbot --help for more info.

@akashveramd

Copy link
Copy Markdown
Contributor Author

@pytorchbot label ciflow/rocm-mi200

@pytorch-bot pytorch-bot Bot added the ciflow/rocm-mi200 Trigger "default" config CI on ROCm MI200 label Apr 15, 2026
@akashveramd

Copy link
Copy Markdown
Contributor Author

@pytorchbot label ciflow/rocm-mi300

@pytorch-bot pytorch-bot Bot added the ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 label Apr 15, 2026
@pytorch-bot

pytorch-bot Bot commented Apr 15, 2026

Copy link
Copy Markdown

Didn't find following labels among repository labels: ciflow/rocm-mi350

@akashveramd

Copy link
Copy Markdown
Contributor Author

@pytorchbot label ciflow/rocm-mi355

@pytorch-bot pytorch-bot Bot added the ciflow/rocm-mi355 Trigger "default" config CI on ROCm MI355 runners label Apr 15, 2026
@jeffdaily

Copy link
Copy Markdown
Collaborator

@pytorchbot rebase

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Successfully rebased av_enable_linalg_tests onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout av_enable_linalg_tests && git pull --rebase)

@pytorchmergebot
pytorchmergebot force-pushed the av_enable_linalg_tests branch from c25dce2 to 04cad3d Compare April 30, 2026 20:19
@jeffdaily

Copy link
Copy Markdown
Collaborator

@pytorchbot merge -f "unrelated failures; all cuda and lint passing"

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

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

Alokksinha00 pushed a commit to Alokksinha00/pytorch that referenced this pull request May 15, 2026
…oMagmaAndNoCusolver (pytorch#180303)

In this PR, we have enabled test_linalg tests that were skipped due to skipCUDAIfNoMagmaAndNoCusolver decorator on environments without Magma. It currently uses hipsolver via skipCUDAIfNoMagmaAndNoLinalgsolver decorator.

These linalg tests are now passing for ROCm-
**test_matrix_norm
test_inverse
test_inv_ex_info_device
test_inv_ex_singular
test_inverse_many_batches
test_inverse_errors
test_inv_errors_and_warnings
test_solve_batched_broadcasting
test_matrix_power_non_negative**

Pull Request resolved: pytorch#180303
Approved by: https://github.com/jeffdaily
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
…oMagmaAndNoCusolver (pytorch#180303)

In this PR, we have enabled test_linalg tests that were skipped due to skipCUDAIfNoMagmaAndNoCusolver decorator on environments without Magma. It currently uses hipsolver via skipCUDAIfNoMagmaAndNoLinalgsolver decorator.

These linalg tests are now passing for ROCm-
**test_matrix_norm
test_inverse
test_inv_ex_info_device
test_inv_ex_singular
test_inverse_many_batches
test_inverse_errors
test_inv_errors_and_warnings
test_solve_batched_broadcasting
test_matrix_power_non_negative**

Pull Request resolved: pytorch#180303
Approved by: https://github.com/jeffdaily
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…oMagmaAndNoCusolver (pytorch#180303)

In this PR, we have enabled test_linalg tests that were skipped due to skipCUDAIfNoMagmaAndNoCusolver decorator on environments without Magma. It currently uses hipsolver via skipCUDAIfNoMagmaAndNoLinalgsolver decorator.

These linalg tests are now passing for ROCm-
**test_matrix_norm
test_inverse
test_inv_ex_info_device
test_inv_ex_singular
test_inverse_many_batches
test_inverse_errors
test_inv_errors_and_warnings
test_solve_batched_broadcasting
test_matrix_power_non_negative**

Pull Request resolved: pytorch#180303
Approved by: https://github.com/jeffdaily
akashveramd added a commit to akashveramd/pytorch that referenced this pull request Jul 21, 2026
…gmaAndNoCusolver)

Raw cherry-pick of upstream commit 868bcb1.
Conflicts in test/test_linalg.py left unresolved (conflict markers present).

Co-authored-by: Cursor <[email protected]>
akashveramd pushed a commit to akashveramd/pytorch that referenced this pull request Jul 21, 2026
…DAIfNoMagmaAndNoCusolver)

Two conflicts in test/test_linalg.py resolved:

1. Import line (line ~35): Added 'skipCUDAIf' import and replaced
   'skipCUDAIfNoMagmaAndNoCusolver' with 'skipCUDAIfNoMagmaAndNoLinalgsolver'
   (the new unified decorator introduced by this PR).

2. test_eigh decorator + new test (line ~1054): Accepted both changes from
   the PR — inserted new test_det_backward function and replaced
   '@skipCUDAIfNoMagma' with '@skipCUDAIfNoMagmaAndNoLinalgsolver' on test_eigh.

Co-authored-by: Cursor <[email protected]>
akashveramd added a commit to akashveramd/pytorch that referenced this pull request Jul 21, 2026
akashveramd pushed a commit to akashveramd/pytorch that referenced this pull request Jul 21, 2026
…DAIfNoMagmaAndNoCusolver)

Kept both skipCUDAIfNoMagmaAndNoCusolver and skipCUDAIfNoMagmaAndNoLinalgsolver in
imports (2.11 still has tests using the former). Added skipCUDAIf import.
Dropped test_det_backward (requires C++ changes from two unrelated PRs pytorch#171225/pytorch#177498).
All 22 decorator swaps from the upstream PR applied as-is.

Co-authored-by: Cursor <[email protected]>
jithunnair-amd pushed a commit to ROCm/pytorch that referenced this pull request Jul 27, 2026
…ma dependency (#3455)

## Summary

Backports 6 upstream PyTorch PRs to `release/2.13` that enable ROCm
linear algebra tests and remove the Magma dependency by routing through
hipSOLVER (ROCm >= 7.14):

- **pytorch#180303** – Replace `skipCUDAIfNoMagmaAndNoCusolver` with
`skipCUDAIfNoMagmaAndNoLinalgsolver` across linalg tests and OpInfo
definitions, enabling tests on ROCm via hipSOLVER
- **pytorch#187703** – Re-enable `test_preferred_linalg_library` test for ROCm
- **pytorch#185557** – Enable `linalg.eig` / `ldl_solve` via hipSOLVER `xgeev`
(ROCm >= 7.14); enable `test_linalg_solve` and `test_triangular_solve`
via cuBLAS path
- **pytorch#187011** – Merge `test_norm_matrix_degenerate_shapes` variants into
a single test that handles both old and new NumPy behavior
- **pytorch#186122** – Enable `test_inverse_errors_large` and
`test_lu_solve_batched_many_batches` linalg tests on ROCm
- **pytorch#188720** – Enable `cholesky_ex` via hipSOLVER and remove Magma
dependency for autogenerated linalg tests

## Key C++ changes
- `BatchLinearAlgebraLib.cpp/h`, `CUDASolver.cpp/h`: extend `xgeev`,
`xpotrs`, `ldl_solve` and related 64-bit solver paths to compile and run
on ROCm >= 7.14 (`USE_ROCM && ROCM_VERSION >= 71400`)
- `BatchLinearAlgebra.cpp`: route `linalg_eig_kernel` through hipSOLVER
`xgeev` on ROCm >= 7.14 instead of Magma
- `cuda_to_hip_mappings.py`: add hipify mappings for `cusolverDnXgeev`,
`cusolverDnCreateParams`/`DestroyParams`, and related symbols

## Test changes
- Replace `@skipCUDAIfNoMagma` / `@skipCUDAIfNoMagmaAndNoCusolver` with
`@skipCUDAIfNoMagmaAndNoLinalgsolver` across `test_linalg.py`,
`common_methods_invocations.py`, and `opinfo/definitions/linalg.py`
- Remove ROCm-specific `skipIf` skips for
`test_linalg_eig_stride_consistency` in inductor tests
- Add ROCm version guard (`ROCM_VERSION < (7, 14)`) for `linalg.eig` /
`linalg.eigvals` OpInfos on older ROCm without hipSOLVER `xgeev` support

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport
@jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang
@jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10
@aditew01 @voznesenskym @penguinwu @EikanWang @Guobing-Chen @zhuhaozhe
@blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames
@chauhang @aakhundov @coconutruben @azahed98

Co-authored-by: Akash Verma <[email protected]>
Co-authored-by: Cursor <[email protected]>
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…oMagmaAndNoCusolver (pytorch#180303)

In this PR, we have enabled test_linalg tests that were skipped due to skipCUDAIfNoMagmaAndNoCusolver decorator on environments without Magma. It currently uses hipsolver via skipCUDAIfNoMagmaAndNoLinalgsolver decorator.

These linalg tests are now passing for ROCm-
**test_matrix_norm
test_inverse
test_inv_ex_info_device
test_inv_ex_singular
test_inverse_many_batches
test_inverse_errors
test_inv_errors_and_warnings
test_solve_batched_broadcasting
test_matrix_power_non_negative**

Pull Request resolved: pytorch#180303
Approved by: https://github.com/jeffdaily
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rocm-mi200 Trigger "default" config CI on ROCm MI200 ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 ciflow/rocm-mi355 Trigger "default" config CI on ROCm MI355 runners ciflow/rocm-nightly Trigger "default" config CI on a nightly build of ROCm from theRock on MI300 ciflow/trunk Trigger trunk jobs on your pull request keep-going Don't stop on first failure, keep running tests until the end Merged module: rocm AMD GPU support for Pytorch open source topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants