Repository navigation
Conversation
This PR needs a
|
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/173510
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 Cancelled Jobs, 4 Unrelated FailuresAs of commit b1070a8 with merge base aa3b33d ( CANCELLED JOBS - The following jobs were 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. |
|
Recent HIP has a lot of CUSolver APIs (see https://rocm.docs.amd.com/projects/HIPIFY/en/amd-staging/reference/tables/CUSOLVER_API_supported_by_HIP.html). You'll likely need to add missing symbols to the translation Python autogen though for them to be auto replaced. https://github.com/pytorch/pytorch/blob/main/torch/utils/hipify/cuda_to_hip_mappings.py |
| void _warn_once_magma_deprecation(const std::string& op_name, bool force_cusolver = true) { | ||
| if (at::globalContext().linalgPreferredBackend() == at::LinalgBackend::Magma) { | ||
| std::string warn_force_cusolver = force_cusolver | ||
| ? " " + op_name + " will try dispatching to cuSOLVER instead. " + |
There was a problem hiding this comment.
Consider fmtlib::fmt would be cleaner
|
@pytorchbot merge |
|
CUDA 12.6 is cleared. @pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 6 checks: linux-aarch64 / linux-jammy-aarch64-py3.10 / test (openreg, 1, 1, linux.arm64.m7g.4xlarge), windows-arm64-binary-wheel / wheel-py3_13-cpu-test, windows-arm64-binary-wheel / wheel-py3_11-cpu-test, windows-arm64-binary-wheel / wheel-py3_12-cpu-test, linux-binary-libtorch / libtorch-rocm7_1-shared-with-deps-release-build / build, linux-binary-libtorch / libtorch-rocm7_2-shared-with-deps-release-build / build Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…onally (pytorch#173510) As per title. Benchmark script: ```python import torch import torch.utils.benchmark as benchmark from itertools import product results = [] batches = [(), (16,), (64,)] sizes = [16, 128, 512, 2048] for b, n in product(batches, sizes): shape = b + (n, n) print(f"Testing shape={shape}") label = "torch.eig" sub_label = f"{shape}" x = torch.rand(*shape, device="cuda") x = x + x.mH stmt = "torch.linalg.eig(x)" for backend in ("magma", "cusolver"): torch.backends.cuda.preferred_linalg_library(backend) # warm-up for _ in range(5): exec(stmt) results.append(benchmark.Timer( stmt=stmt, globals={'x': x}, label=label, sub_label=sub_label, description=backend, ).blocked_autorange(min_run_time=1)) compare = benchmark.Compare(results) compare.print() ``` Benchmark results (H100): ``` [-------------------- torch.eig -------------------] | magma | cusolver | cusolver speedup 1 threads: ------------------------------------------ (16, 16) | 67215.3 | 893.3 | 75.24 (128, 128) | 390101.4 | 10526.9 | 37.05 (512, 512) | 1614706.1 | 61347.5 | 26.32 (2048, 2048) | 6447301.5 | 356181.2 | 18.10 (16, 16, 16) | 660036.1 | 13095.2 | 50.40 (16, 128, 128) | 6530718.7 | 166647.0 | 39.18 (16, 512, 512) | 20375827.4 | 994115.1 | 20.49 (16, 2048, 2048) | 98335490.6 | 5717112.5 | 17.20 (64, 16, 16) | 2167358.2 | 51977.5 | 41.69 (64, 128, 128) | 25925259.8 | 664574.7 | 39.01 (64, 512, 512) | 84731703.1 | 3946917.0 | 21.46 (64, 2048, 2048) | 380878661.3 | 23008593.5 | 16.55 Times are in microseconds (us). ``` Pull Request resolved: pytorch#173510 Approved by: https://github.com/Skylion007
…nally (pytorch#173515) Benchmarks: ``` [--------------- torch.cholesky --------------] | magma | cusolver 1 threads: ------------------------------------ (16, 16) | 42.8 | 34.8 (128, 128) | 129.7 | 108.6 (512, 512) | 747.0 | 376.1 (2048, 2048) | 22492.2 | 1954.3 (16, 16, 16) | 53.9 | 46.1 (16, 128, 128) | 197.3 | 157.7 (16, 512, 512) | 1471.7 | 834.9 (16, 2048, 2048) | 19921.6 | 10598.4 (64, 16, 16) | 54.3 | 46.1 (64, 128, 128) | 224.8 | 174.5 (64, 512, 512) | 1964.2 | 1261.4 (64, 2048, 2048) | 40397.3 | 22181.2 Times are in microseconds (us). ``` Pull Request resolved: pytorch#173515 Approved by: https://github.com/eqy ghstack dependencies: pytorch#173510
…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
…nconditionally (pytorch#173510)" This reverts commit dea9b90. Reverted pytorch#173510 on behalf of https://github.com/atalman due to See pytorch#174281 ([comment](pytorch#173510 (comment)))
…onally (pytorch#173510) As per title. Benchmark script: ```python import torch import torch.utils.benchmark as benchmark from itertools import product results = [] batches = [(), (16,), (64,)] sizes = [16, 128, 512, 2048] for b, n in product(batches, sizes): shape = b + (n, n) print(f"Testing shape={shape}") label = "torch.eig" sub_label = f"{shape}" x = torch.rand(*shape, device="cuda") x = x + x.mH stmt = "torch.linalg.eig(x)" for backend in ("magma", "cusolver"): torch.backends.cuda.preferred_linalg_library(backend) # warm-up for _ in range(5): exec(stmt) results.append(benchmark.Timer( stmt=stmt, globals={'x': x}, label=label, sub_label=sub_label, description=backend, ).blocked_autorange(min_run_time=1)) compare = benchmark.Compare(results) compare.print() ``` Benchmark results (H100): ``` [-------------------- torch.eig -------------------] | magma | cusolver | cusolver speedup 1 threads: ------------------------------------------ (16, 16) | 67215.3 | 893.3 | 75.24 (128, 128) | 390101.4 | 10526.9 | 37.05 (512, 512) | 1614706.1 | 61347.5 | 26.32 (2048, 2048) | 6447301.5 | 356181.2 | 18.10 (16, 16, 16) | 660036.1 | 13095.2 | 50.40 (16, 128, 128) | 6530718.7 | 166647.0 | 39.18 (16, 512, 512) | 20375827.4 | 994115.1 | 20.49 (16, 2048, 2048) | 98335490.6 | 5717112.5 | 17.20 (64, 16, 16) | 2167358.2 | 51977.5 | 41.69 (64, 128, 128) | 25925259.8 | 664574.7 | 39.01 (64, 512, 512) | 84731703.1 | 3946917.0 | 21.46 (64, 2048, 2048) | 380878661.3 | 23008593.5 | 16.55 Times are in microseconds (us). ``` Pull Request resolved: pytorch#173510 Approved by: https://github.com/Skylion007
…nally (pytorch#173515) Benchmarks: ``` [--------------- torch.cholesky --------------] | magma | cusolver 1 threads: ------------------------------------ (16, 16) | 42.8 | 34.8 (128, 128) | 129.7 | 108.6 (512, 512) | 747.0 | 376.1 (2048, 2048) | 22492.2 | 1954.3 (16, 16, 16) | 53.9 | 46.1 (16, 128, 128) | 197.3 | 157.7 (16, 512, 512) | 1471.7 | 834.9 (16, 2048, 2048) | 19921.6 | 10598.4 (64, 16, 16) | 54.3 | 46.1 (64, 128, 128) | 224.8 | 174.5 (64, 512, 512) | 1964.2 | 1261.4 (64, 2048, 2048) | 40397.3 | 22181.2 Times are in microseconds (us). ``` Pull Request resolved: pytorch#173515 Approved by: https://github.com/eqy ghstack dependencies: pytorch#173510
…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
…nconditionally (pytorch#173510)" This reverts commit dea9b90. Reverted pytorch#173510 on behalf of https://github.com/atalman due to See pytorch#174281 ([comment](pytorch#173510 (comment)))
…onally ghstack-source-id: 78a30f4 Pull-Request: pytorch/pytorch#173510
…onally (pytorch#173510) As per title. Benchmark script: ```python import torch import torch.utils.benchmark as benchmark from itertools import product results = [] batches = [(), (16,), (64,)] sizes = [16, 128, 512, 2048] for b, n in product(batches, sizes): shape = b + (n, n) print(f"Testing shape={shape}") label = "torch.eig" sub_label = f"{shape}" x = torch.rand(*shape, device="cuda") x = x + x.mH stmt = "torch.linalg.eig(x)" for backend in ("magma", "cusolver"): torch.backends.cuda.preferred_linalg_library(backend) # warm-up for _ in range(5): exec(stmt) results.append(benchmark.Timer( stmt=stmt, globals={'x': x}, label=label, sub_label=sub_label, description=backend, ).blocked_autorange(min_run_time=1)) compare = benchmark.Compare(results) compare.print() ``` Benchmark results (H100): ``` [-------------------- torch.eig -------------------] | magma | cusolver | cusolver speedup 1 threads: ------------------------------------------ (16, 16) | 67215.3 | 893.3 | 75.24 (128, 128) | 390101.4 | 10526.9 | 37.05 (512, 512) | 1614706.1 | 61347.5 | 26.32 (2048, 2048) | 6447301.5 | 356181.2 | 18.10 (16, 16, 16) | 660036.1 | 13095.2 | 50.40 (16, 128, 128) | 6530718.7 | 166647.0 | 39.18 (16, 512, 512) | 20375827.4 | 994115.1 | 20.49 (16, 2048, 2048) | 98335490.6 | 5717112.5 | 17.20 (64, 16, 16) | 2167358.2 | 51977.5 | 41.69 (64, 128, 128) | 25925259.8 | 664574.7 | 39.01 (64, 512, 512) | 84731703.1 | 3946917.0 | 21.46 (64, 2048, 2048) | 380878661.3 | 23008593.5 | 16.55 Times are in microseconds (us). ``` Pull Request resolved: pytorch#173510 Approved by: https://github.com/Skylion007, https://github.com/ngimel
…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]>
Stack from ghstack (oldest at bottom):
As per title.
Benchmark script:
Benchmark results (H100):
cc @ptrblck @msaroufim @eqy @jerryzh168 @tinglvv @nWEIdia