Repository navigation
[ROCm] Enable linalg tests for eig, ldl_solve operator (hipsolver) & enable test_linalg_solve, test_triangular_solve linalg tests with cuBLAS path - #185557
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/185557
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 16 Unrelated Failures, 2 Unclassified FailuresAs of commit 9464b44 with merge base e354c85 ( NEW FAILURE - The following job has failed:
UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
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. |
4f4b95e to
0195063
Compare
|
|
81c8587 to
55438b5
Compare
|
@pytorchbot /remove-label ciflow/rocm-mi300 |
|
❌ 🤖 pytorchbot command failed: Try |
55438b5 to
084a6e7
Compare
759ba58 to
c24a5df
Compare
e0cbb01 to
db3a00e
Compare
jithunnair-amd
left a comment
There was a problem hiding this comment.
Thanks @akashveramd! This is a big step in reducing ROCm PyTorch's dependence on Magma.
|
@pytorchbot merge -f "unrelated failures" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…enable test_linalg_solve, test_triangular_solve linalg tests with cuBLAS path (pytorch#185557) This PR enabled 59 linalg tests for ROCm. However, the set of 8 tests are still skipped as they are slow tests. Here is the breakdown of the enabled tests based on failure type- 1. Enabled 31 linalg tests for ROCm with the hipsolver backend for the eig operator. 1. test_eig_cuda_complex_eigenvectors_cuda_float32 2. test_eig_cuda_complex_eigenvectors_cuda_float64 3. test_eig_errors_and_warnings_cuda_complex128 4. test_eig_errors_and_warnings_cuda_complex64 5. test_eig_errors_and_warnings_cuda_float32 6. test_eig_errors_and_warnings_cuda_float64 7. test_eig_identity_cuda_complex128 8. test_eig_identity_cuda_complex64 9. test_eig_identity_cuda_float32 10. test_eig_identity_cuda_float64 11. test_eig_numpy_cuda_complex128 12. test_eig_numpy_cuda_float64 13. test_eig_out_variants_cuda_complex128 14. test_eig_out_variants_cuda_complex64 15. test_eig_out_variants_cuda_float32 16. test_eig_out_variants_cuda_float64 17. test_eig_with_nan_cuda_complex128 18. test_eig_with_nan_cuda_complex64 19. test_eig_with_nan_cuda_float32 20. test_eig_with_nan_cuda_float64 21. test_eigvals_errors_and_warnings_cuda_complex128 22. test_eigvals_errors_and_warnings_cuda_complex64 23. test_eigvals_errors_and_warnings_cuda_float32 24. test_eigvals_errors_and_warnings_cuda_float64 25. test_eigvals_numpy_cuda_complex128 26. test_eigvals_numpy_cuda_float64 27. test_eigvals_out_variants_cuda_complex128 28. test_eigvals_out_variants_cuda_complex64 29. test_eigvals_out_variants_cuda_float32 30. test_eigvals_out_variants_cuda_float64 31. test_invariance_error_spectral_decompositions_cuda_complex128 2. Enabled 24 linalg tests for ROCm by dropping MAGMA dependency and using the cuBLAS path instead. However, 8 set of tests (test_linalg_solve_triangular_large_* & test_triangular_solve_batched_many_batches_*) are skipped due to slow tests. 1. test_linalg_solve_triangular_large_cuda_complex128 2. test_linalg_solve_triangular_large_cuda_complex64 3. test_linalg_solve_triangular_large_cuda_float32 4. test_linalg_solve_triangular_large_cuda_float64 5. test_triangular_solve_batched_broadcasting_cuda_complex128 6. test_triangular_solve_batched_broadcasting_cuda_complex64 7. test_triangular_solve_batched_broadcasting_cuda_float32 8. test_triangular_solve_batched_broadcasting_cuda_float64 9. test_triangular_solve_batched_cuda_complex128 10. test_triangular_solve_batched_cuda_complex64 11. test_triangular_solve_batched_cuda_float32 12. test_triangular_solve_batched_cuda_float64 13. test_triangular_solve_batched_many_batches_cuda_complex128 14. test_triangular_solve_batched_many_batches_cuda_complex64 15. test_triangular_solve_batched_many_batches_cuda_float32 16. test_triangular_solve_batched_many_batches_cuda_float64 17. test_triangular_solve_cuda_complex128 18. test_triangular_solve_cuda_complex64 19. test_triangular_solve_cuda_float32 20. test_triangular_solve_cuda_float64 21. test_triangular_solve_out_errors_and_warnings_cuda_complex128 22. test_triangular_solve_out_errors_and_warnings_cuda_complex64 23. test_triangular_solve_out_errors_and_warnings_cuda_float32 24. test_triangular_solve_out_errors_and_warnings_cuda_float64 4. Enabled 4 test_ldl_solve linalg tests for ROCm using the hipSOLVER path for the ldl_solve operator. 1. test_ldl_solve_cuda_complex128 2. test_ldl_solve_cuda_complex64 3. test_ldl_solve_cuda_float32 4. test_ldl_solve_cuda_float64 ### Validation * Tested locally on upstream with **ghcr.io/pytorch/ci-image:pytorch-linux-noble-rocm-nightly-py3** rocm-nightly image and all the enabled tests passed. * All the tests listed above (except for the ones marked slow in the test code) passed in rocm-nightly CI (confirmed by checking the [test-reports artifact for shard 1](https://gha-artifacts.s3.amazonaws.com/pytorch/pytorch/28393196697/1/artifact/test-reports-test-default-1-6-linux.rocm.gpu.gfx942.1_84144454605.zip) from the [PR HUD page](https://hud.pytorch.org/pytorch/pytorch/pull/185557?sha=9464b44b4c96b34fde9fdac8dd6ceeec0a353560#rocm-nightly) Pull Request resolved: pytorch#185557 Approved by: https://github.com/jithunnair-amd, https://github.com/jeffdaily Co-authored-by: Cursor <[email protected]>
… test_linalg_solve/triangular_solve via cuBLAS Raw cherry-pick of upstream commit 3184cda. Conflicts in: - aten/src/ATen/native/cuda/linalg/BatchLinearAlgebra.cpp - test/test_linalg.py (conflict markers present in those files) Co-authored-by: Cursor <[email protected]>
…pSOLVER, test_linalg_solve/triangular_solve via cuBLAS Conflicts in two files resolved: BatchLinearAlgebra.cpp (2 conflicts): 1. apply_magma_eig guard (line ~1193): HEAD had no outer #if guard; PR changes guard condition to !(CUSOLVER>=11702) && !(ROCm>=71400). Resolved by adding the PR's new guard + corresponding #endif before linalg_eig_kernel (guard was absent in release/2.11 baseline but present in PR's upstream context). 2. linalg_eig_kernel body (line ~1279): HEAD had CUDA-only cusolver dispatch with switch-case fallthrough to Magma. PR simplifies to #if/(CUSOLVER||ROCm)/#else Magma/#endif. Resolved by taking PR version; also removed duplicate linalg_eig_magma call that was left after the conflict. test/test_linalg.py (11 conflicts): 1. Import line: merged HEAD and PR — kept skipCUDAIfRocm + skipCUDAIfNoMagma from HEAD; added skipCUDAIfNoMagmaAndNoCusolver + e4m3_type/e5m2_type from PR; dropped onlyAccelerator (not defined in release/2.11). 2-11. Eig test decorator conflicts: all resolved by taking PR's version — replaces old @skipCUDAIfNoMagma/@skipCUDAIfNoMagmaAndNoCusolver decorators with the new @skipCUDAIf(not TEST_WITH_ROCM and cuda<(12,8) and not has_magma, ...). Also removed test_eig_check_magma (slow Magma-only test dropped by PR). Co-authored-by: Cursor <[email protected]>
…pt optional force_cusolver arg PR pytorch#185557 introduced a 2-argument call: _warn_once_magma_deprecation("linalg.eig", /*force_cusolver=*/false) But the function on release/2.11 only accepted 1 argument, which would cause a compile error. Added optional bool force_cusolver = true parameter and adjusted the warning message to omit the cuSOLVER fallback hint when force_cusolver is false (matching upstream behavior). Co-authored-by: Cursor <[email protected]>
… test_linalg_solve/triangular_solve via cuBLAS Co-authored-by: Cursor <[email protected]>
…pSOLVER, test_linalg_solve/triangular_solve via cuBLAS test/test_linalg.py: - Removed all @skipCUDAIf(TEST_WITH_ROCM and not torch.cuda.has_magma, ...) decorators from eig tests (PR's intended change) - Removed @skipCUDAIfRocm from ldl_solve test; added ROCm >= 7.14 skipCUDAIf guard - Restored test_eig_check_magma (removed upstream by pytorch#173510, not by this PR) - Import: kept skipCUDAIfNoMagmaAndNoCusolver (still used by other 2.11 tests) BatchLinearAlgebra.cpp: - Added #if guard around apply_magma_eig + linalg_eig_magma - Restored TORCH_INTERNAL_ASSERT_DEBUG_ONLY(input.is_cuda()) in linalg_eig_kernel - Widened #if condition to include (USE_ROCM && ROCM_VERSION >= 71400) - Replaced _warn_once_magma_deprecation with upstream verbatim implementation Co-authored-by: Cursor <[email protected]>
…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]>
…enable test_linalg_solve, test_triangular_solve linalg tests with cuBLAS path (pytorch#185557) This PR enabled 59 linalg tests for ROCm. However, the set of 8 tests are still skipped as they are slow tests. Here is the breakdown of the enabled tests based on failure type- 1. Enabled 31 linalg tests for ROCm with the hipsolver backend for the eig operator. 1. test_eig_cuda_complex_eigenvectors_cuda_float32 2. test_eig_cuda_complex_eigenvectors_cuda_float64 3. test_eig_errors_and_warnings_cuda_complex128 4. test_eig_errors_and_warnings_cuda_complex64 5. test_eig_errors_and_warnings_cuda_float32 6. test_eig_errors_and_warnings_cuda_float64 7. test_eig_identity_cuda_complex128 8. test_eig_identity_cuda_complex64 9. test_eig_identity_cuda_float32 10. test_eig_identity_cuda_float64 11. test_eig_numpy_cuda_complex128 12. test_eig_numpy_cuda_float64 13. test_eig_out_variants_cuda_complex128 14. test_eig_out_variants_cuda_complex64 15. test_eig_out_variants_cuda_float32 16. test_eig_out_variants_cuda_float64 17. test_eig_with_nan_cuda_complex128 18. test_eig_with_nan_cuda_complex64 19. test_eig_with_nan_cuda_float32 20. test_eig_with_nan_cuda_float64 21. test_eigvals_errors_and_warnings_cuda_complex128 22. test_eigvals_errors_and_warnings_cuda_complex64 23. test_eigvals_errors_and_warnings_cuda_float32 24. test_eigvals_errors_and_warnings_cuda_float64 25. test_eigvals_numpy_cuda_complex128 26. test_eigvals_numpy_cuda_float64 27. test_eigvals_out_variants_cuda_complex128 28. test_eigvals_out_variants_cuda_complex64 29. test_eigvals_out_variants_cuda_float32 30. test_eigvals_out_variants_cuda_float64 31. test_invariance_error_spectral_decompositions_cuda_complex128 2. Enabled 24 linalg tests for ROCm by dropping MAGMA dependency and using the cuBLAS path instead. However, 8 set of tests (test_linalg_solve_triangular_large_* & test_triangular_solve_batched_many_batches_*) are skipped due to slow tests. 1. test_linalg_solve_triangular_large_cuda_complex128 2. test_linalg_solve_triangular_large_cuda_complex64 3. test_linalg_solve_triangular_large_cuda_float32 4. test_linalg_solve_triangular_large_cuda_float64 5. test_triangular_solve_batched_broadcasting_cuda_complex128 6. test_triangular_solve_batched_broadcasting_cuda_complex64 7. test_triangular_solve_batched_broadcasting_cuda_float32 8. test_triangular_solve_batched_broadcasting_cuda_float64 9. test_triangular_solve_batched_cuda_complex128 10. test_triangular_solve_batched_cuda_complex64 11. test_triangular_solve_batched_cuda_float32 12. test_triangular_solve_batched_cuda_float64 13. test_triangular_solve_batched_many_batches_cuda_complex128 14. test_triangular_solve_batched_many_batches_cuda_complex64 15. test_triangular_solve_batched_many_batches_cuda_float32 16. test_triangular_solve_batched_many_batches_cuda_float64 17. test_triangular_solve_cuda_complex128 18. test_triangular_solve_cuda_complex64 19. test_triangular_solve_cuda_float32 20. test_triangular_solve_cuda_float64 21. test_triangular_solve_out_errors_and_warnings_cuda_complex128 22. test_triangular_solve_out_errors_and_warnings_cuda_complex64 23. test_triangular_solve_out_errors_and_warnings_cuda_float32 24. test_triangular_solve_out_errors_and_warnings_cuda_float64 4. Enabled 4 test_ldl_solve linalg tests for ROCm using the hipSOLVER path for the ldl_solve operator. 1. test_ldl_solve_cuda_complex128 2. test_ldl_solve_cuda_complex64 3. test_ldl_solve_cuda_float32 4. test_ldl_solve_cuda_float64 ### Validation * Tested locally on upstream with **ghcr.io/pytorch/ci-image:pytorch-linux-noble-rocm-nightly-py3** rocm-nightly image and all the enabled tests passed. * All the tests listed above (except for the ones marked slow in the test code) passed in rocm-nightly CI (confirmed by checking the [test-reports artifact for shard 1](https://gha-artifacts.s3.amazonaws.com/pytorch/pytorch/28393196697/1/artifact/test-reports-test-default-1-6-linux.rocm.gpu.gfx942.1_84144454605.zip) from the [PR HUD page](https://hud.pytorch.org/pytorch/pytorch/pull/185557?sha=9464b44b4c96b34fde9fdac8dd6ceeec0a353560#rocm-nightly) Pull Request resolved: pytorch#185557 Approved by: https://github.com/jithunnair-amd, https://github.com/jeffdaily Co-authored-by: Cursor <[email protected]>
This PR enabled 59 linalg tests for ROCm. However, the set of 8 tests are still skipped as they are slow tests. Here is the breakdown of the enabled tests based on failure type-
Enabled 31 linalg tests for ROCm with the hipsolver backend for the eig operator.
Enabled 24 linalg tests for ROCm by dropping MAGMA dependency and using the cuBLAS path instead. However, 8 set of tests (test_linalg_solve_triangular_large_* & test_triangular_solve_batched_many_batches_*) are skipped due to slow tests.
Enabled 4 test_ldl_solve linalg tests for ROCm using the hipSOLVER path for the ldl_solve operator.
Validation
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang