Skip to content

[Test] Convert 8 @onlyCUDA to @onlyAccelerator for test_linalg - #183587

Closed
RiyaP2508 wants to merge 6 commits into
gh/RiyaP2508/11/basefrom
gh/RiyaP2508/11/head
Closed

RiyaP2508 wants to merge 6 commits into
gh/RiyaP2508/11/basefrom
gh/RiyaP2508/11/head

Conversation

@RiyaP2508

@RiyaP2508 RiyaP2508 commented May 13, 2026 •

Copy link
Copy Markdown
Collaborator

Stack from ghstack (oldest at bottom):

Summary

Convert 8 tests verified to have no CUDA-specific code in body from @onlyCUDA to @onlyAccelerator, making them runnable on XPU, HPU, and PrivateUse1 backends.

  • 6 clean swaps: test_norm_fused_type_promotion, test_powsum_dtype_kwarg, test_foreach_powsum_dtype_kwarg, test_triangular_solve_large, test_lu_solve_large_matrices, test_triu_tril_large_matrix_64bit
  • 2 with .cuda() → .to(device) fix: test_matmul_45724, test_logaddexp_cpu_vs_accelerator_complex (renamed)

Test plan

  • TEST_CONFIG=cuda python3 test/run_test.py -i test_linalg — all passed
  • Syntax check passes

cc: @fffrog @albanD

@pytorch-bot

pytorch-bot Bot commented May 13, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 2 New Failures

As of commit 8c7ade4 with merge base 12b535b (image):

NEW FAILURES - The following jobs have failed:

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

Convert 8 tests verified to have no CUDA-specific code in body:
- 6 clean swaps: test_norm_fused_type_promotion, test_powsum_dtype_kwarg,
  test_foreach_powsum_dtype_kwarg, test_triangular_solve_large,
  test_lu_solve_large_matrices, test_triu_tril_large_matrix_64bit
- 2 with .cuda() -> .to(device) fix: test_matmul_45724,
  test_logaddexp_cpu_vs_accelerator_complex (renamed)

[ghstack-poisoned]
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #183588

…nalg"


## Summary

Convert 8 tests verified to have no CUDA-specific code in body from `onlyCUDA` to `onlyAccelerator`, making them runnable on XPU, HPU, and PrivateUse1 backends.

- 6 clean swaps: `test_norm_fused_type_promotion`, `test_powsum_dtype_kwarg`, `test_foreach_powsum_dtype_kwarg`, `test_triangular_solve_large`, `test_lu_solve_large_matrices`, `test_triu_tril_large_matrix_64bit`
- 2 with `.cuda()` → `.to(device)` fix: `test_matmul_45724`, `test_logaddexp_cpu_vs_accelerator_complex` (renamed)

## Test plan
- [x] `TEST_CONFIG=cuda python3 test/run_test.py -i test_linalg` — all passed
- [x] Syntax check passes

cc: fffrog albanD 

[ghstack-poisoned]
@fffrog fffrog moved this from Backlog to Ready for Merge in PyTorch Test Refactoring May 19, 2026
RiyaP2508 added 4 commits May 30, 2026 15:54
…nalg"


## Summary

Convert 8 tests verified to have no CUDA-specific code in body from `onlyCUDA` to `onlyAccelerator`, making them runnable on XPU, HPU, and PrivateUse1 backends.

- 6 clean swaps: `test_norm_fused_type_promotion`, `test_powsum_dtype_kwarg`, `test_foreach_powsum_dtype_kwarg`, `test_triangular_solve_large`, `test_lu_solve_large_matrices`, `test_triu_tril_large_matrix_64bit`
- 2 with `.cuda()` → `.to(device)` fix: `test_matmul_45724`, `test_logaddexp_cpu_vs_accelerator_complex` (renamed)

## Test plan
- [x] `TEST_CONFIG=cuda python3 test/run_test.py -i test_linalg` — all passed
- [x] Syntax check passes

cc: fffrog albanD 

[ghstack-poisoned]
…nalg"


## Summary

Convert 8 tests verified to have no CUDA-specific code in body from `onlyCUDA` to `onlyAccelerator`, making them runnable on XPU, HPU, and PrivateUse1 backends.

- 6 clean swaps: `test_norm_fused_type_promotion`, `test_powsum_dtype_kwarg`, `test_foreach_powsum_dtype_kwarg`, `test_triangular_solve_large`, `test_lu_solve_large_matrices`, `test_triu_tril_large_matrix_64bit`
- 2 with `.cuda()` → `.to(device)` fix: `test_matmul_45724`, `test_logaddexp_cpu_vs_accelerator_complex` (renamed)

## Test plan
- [x] `TEST_CONFIG=cuda python3 test/run_test.py -i test_linalg` — all passed
- [x] Syntax check passes

cc: fffrog albanD 

[ghstack-poisoned]
…nalg"


## Summary

Convert 8 tests verified to have no CUDA-specific code in body from `onlyCUDA` to `onlyAccelerator`, making them runnable on XPU, HPU, and PrivateUse1 backends.

- 6 clean swaps: `test_norm_fused_type_promotion`, `test_powsum_dtype_kwarg`, `test_foreach_powsum_dtype_kwarg`, `test_triangular_solve_large`, `test_lu_solve_large_matrices`, `test_triu_tril_large_matrix_64bit`
- 2 with `.cuda()` → `.to(device)` fix: `test_matmul_45724`, `test_logaddexp_cpu_vs_accelerator_complex` (renamed)

## Test plan
- [x] `TEST_CONFIG=cuda python3 test/run_test.py -i test_linalg` — all passed
- [x] Syntax check passes

cc: fffrog albanD 

[ghstack-poisoned]
…nalg"


## Summary

Convert 8 tests verified to have no CUDA-specific code in body from `onlyCUDA` to `onlyAccelerator`, making them runnable on XPU, HPU, and PrivateUse1 backends.

- 6 clean swaps: `test_norm_fused_type_promotion`, `test_powsum_dtype_kwarg`, `test_foreach_powsum_dtype_kwarg`, `test_triangular_solve_large`, `test_lu_solve_large_matrices`, `test_triu_tril_large_matrix_64bit`
- 2 with `.cuda()` → `.to(device)` fix: `test_matmul_45724`, `test_logaddexp_cpu_vs_accelerator_complex` (renamed)

## Test plan
- [x] `TEST_CONFIG=cuda python3 test/run_test.py -i test_linalg` — all passed
- [x] Syntax check passes

cc: fffrog albanD 

[ghstack-poisoned]
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #183588

1 similar comment
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #183588

pytorchmergebot pushed a commit that referenced this pull request Jun 2, 2026
…linalg (#183588)

## Summary

Add `_get_other_device()` helper to `TestLinalg` and replace 16 hardcoded `torch.cuda.is_available()` + `'cuda'` wrong-device error-path blocks with device-agnostic equivalents using `torch.accelerator`. Also replace `complement_device` helper and convert 6 `device_type == 'cuda'` tolerance branches to `device_type != 'cpu'`.

## Test plan
- [x] `TEST_CONFIG=cuda python3 test/run_test.py -i test_linalg` - all passed
- [x] Syntax check passes

cC: @fffrog @albanD
Pull Request resolved: #183588
Approved by: https://github.com/Skylion007, https://github.com/fffrog
ghstack dependencies: #183586, #183587
@github-project-automation github-project-automation Bot moved this from Ready for Merge to Done in PyTorch Test Refactoring Jun 2, 2026
@github-actions
github-actions Bot deleted the gh/RiyaP2508/11/head branch July 2, 2026 02:29
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…ch#183587)

## Summary

Convert 8 tests verified to have no CUDA-specific code in body from `@onlyCUDA` to `@onlyAccelerator`, making them runnable on XPU, HPU, and PrivateUse1 backends.

- 6 clean swaps: `test_norm_fused_type_promotion`, `test_powsum_dtype_kwarg`, `test_foreach_powsum_dtype_kwarg`, `test_triangular_solve_large`, `test_lu_solve_large_matrices`, `test_triu_tril_large_matrix_64bit`
- 2 with `.cuda()` → `.to(device)` fix: `test_matmul_45724`, `test_logaddexp_cpu_vs_accelerator_complex` (renamed)

## Test plan
- [x] `TEST_CONFIG=cuda python3 test/run_test.py -i test_linalg` — all passed
- [x] Syntax check passes

Pull Request resolved: pytorch#183587
Approved by: https://github.com/Skylion007, https://github.com/fffrog
ghstack dependencies: pytorch#183586
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…linalg (pytorch#183588)

## Summary

Add `_get_other_device()` helper to `TestLinalg` and replace 16 hardcoded `torch.cuda.is_available()` + `'cuda'` wrong-device error-path blocks with device-agnostic equivalents using `torch.accelerator`. Also replace `complement_device` helper and convert 6 `device_type == 'cuda'` tolerance branches to `device_type != 'cpu'`.

## Test plan
- [x] `TEST_CONFIG=cuda python3 test/run_test.py -i test_linalg` - all passed
- [x] Syntax check passes

cC: @fffrog @albanD
Pull Request resolved: pytorch#183588
Approved by: https://github.com/Skylion007, https://github.com/fffrog
ghstack dependencies: pytorch#183586, pytorch#183587
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…ch#183587)

## Summary

Convert 8 tests verified to have no CUDA-specific code in body from `@onlyCUDA` to `@onlyAccelerator`, making them runnable on XPU, HPU, and PrivateUse1 backends.

- 6 clean swaps: `test_norm_fused_type_promotion`, `test_powsum_dtype_kwarg`, `test_foreach_powsum_dtype_kwarg`, `test_triangular_solve_large`, `test_lu_solve_large_matrices`, `test_triu_tril_large_matrix_64bit`
- 2 with `.cuda()` → `.to(device)` fix: `test_matmul_45724`, `test_logaddexp_cpu_vs_accelerator_complex` (renamed)

## Test plan
- [x] `TEST_CONFIG=cuda python3 test/run_test.py -i test_linalg` — all passed
- [x] Syntax check passes

Pull Request resolved: pytorch#183587
Approved by: https://github.com/Skylion007, https://github.com/fffrog
ghstack dependencies: pytorch#183586
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…linalg (pytorch#183588)

## Summary

Add `_get_other_device()` helper to `TestLinalg` and replace 16 hardcoded `torch.cuda.is_available()` + `'cuda'` wrong-device error-path blocks with device-agnostic equivalents using `torch.accelerator`. Also replace `complement_device` helper and convert 6 `device_type == 'cuda'` tolerance branches to `device_type != 'cpu'`.

## Test plan
- [x] `TEST_CONFIG=cuda python3 test/run_test.py -i test_linalg` - all passed
- [x] Syntax check passes

cC: @fffrog @albanD
Pull Request resolved: pytorch#183588
Approved by: https://github.com/Skylion007, https://github.com/fffrog
ghstack dependencies: pytorch#183586, pytorch#183587
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants