Skip to content

[ROCm] Re-enable test_preferred_linalg_library test for ROCm - #187703

Closed
akashveramd wants to merge 3 commits into
pytorch:mainfrom
akashveramd:av_enable_test_preferred_linalg_library_test
Closed

akashveramd wants to merge 3 commits into
pytorch:mainfrom
akashveramd:av_enable_test_preferred_linalg_library_test

Conversation

@akashveramd

@akashveramd akashveramd commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

@pytorch-bot

pytorch-bot Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (19 Unrelated Failures)

As of commit f86258b with merge base 00640fd (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 Jun 18, 2026
@jithunnair-amd jithunnair-amd added ci-no-td Do not run TD on this PR 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 open source ciflow/rocm-mi200 Trigger "default" config CI on ROCm MI200 ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 labels Jun 18, 2026
@akashveramd
akashveramd marked this pull request as ready for review June 26, 2026 00:16
@jithunnair-amd

Copy link
Copy Markdown
Collaborator

@pytorchbot merge -f "unrelated failures"

@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

akashveramd added a commit to akashveramd/pytorch that referenced this pull request Jul 21, 2026
…rary for ROCm

Raw cherry-pick of upstream commit a9fb86c.
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
…nalg_library for ROCm

Conflict in test/test_linalg.py resolved:

Large conflict spanning the end of TestLinalg class through EOF.
HEAD had test_preferred_linalg_library in TestLinalg with @skipCUDAIfNoMagma.
PR brings in the full TestLinalgCudaOnly class (with many TunableOp tests) and
a refactored test_preferred_linalg_library that uses @onlyCUDA and conditionally
tests Magma only when torch.cuda.has_magma is True.

Resolution:
- Kept HEAD version of test_logaddexp_cpu_vs_cuda_complex (out_gpu style,
  not the upstream out_accelerator refactoring which was not part of this PR)
- Added full TestLinalgCudaOnly class from the PR (contains the updated
  test_preferred_linalg_library plus all TunableOp tests)
- Removed duplicate old test_preferred_linalg_library from TestLinalg class
- Restored skipCUDAIfNoMagma to import (still used by 4 tests in TestLinalg
  that will be addressed by later PRs in this series)

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
…nalg_library for ROCm

Applied the 13-line upstream change only to TestLinalg.test_preferred_linalg_library:
- Removed @skipCUDAIfNoMagma decorator
- Guarded the 'magma' backend path with if torch.cuda.has_magma:
Dropped the entire upstream TestLinalgCudaOnly block (it does not exist in 2.11;
all those tests live in TestLinalg). File footer and line count match the 2.11 baseline.

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]>
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/rocm-mi200 Trigger "default" config CI on ROCm MI200 ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants