Skip to content

Fix test_sparse_api failures for builds without hipSPARSELt (#4125)#4125

Merged
jerryzh168 merged 1 commit intopytorch:mainfrom
bbeckca:export-D97540060
Mar 24, 2026
Merged

Fix test_sparse_api failures for builds without hipSPARSELt (#4125)#4125
jerryzh168 merged 1 commit intopytorch:mainfrom
bbeckca:export-D97540060

Conversation

@bbeckca
Copy link
Copy Markdown
Contributor

@bbeckca bbeckca commented Mar 20, 2026

Summary:

What: Add a guard in test/sparsity/test_sparse_api.py so tests that depend on hipSPARSELt only run when the backend is available.

Why: These tests currently fail on environments without hipSPARSELt, for example OSS AO nightly. Since the functionality is environment dependent, these test should be conditionally skipped. https://fburl.com/9fpszdqg

FAILED test/sparsity/test_sparse_api.py::TestSemiStructuredSparse::test_sparse - RuntimeError: hipSPARSELt not supported on your machine.

Differential Revision: D97540060

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Mar 20, 2026

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit f8da8fd with merge base bca91b0 (image):

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

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

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 20, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Mar 20, 2026

@bbeckca has exported this pull request. If you are a Meta employee, you can view the originating Diff in D97540060.

@bbeckca
Copy link
Copy Markdown
Contributor Author

bbeckca commented Mar 20, 2026

@pytorchbot label "module: not user facing"

@pytorch-bot pytorch-bot Bot added the module: not user facing Use this tag if you don't want this PR to show up in release notes label Mar 20, 2026
@meta-codesync meta-codesync Bot changed the title Fix test_sparse_api failures for builds without hipSPARSELt Fix test_sparse_api failures for builds without hipSPARSELt (#4125) Mar 20, 2026
bbeckca added a commit to bbeckca/ao that referenced this pull request Mar 20, 2026
…4125)

Summary:

What: Add a guard in test/sparsity/test_sparse_api.py so tests that depend on `hipSPARSELt` only run when the backend is available.

Why: These tests currently fail on environments without hipSPARSELt, for example OSS AO nightly. Since the functionality is environment dependent, these test should be conditionally skipped. https://fburl.com/9fpszdqg

```
FAILED test/sparsity/test_sparse_api.py::TestSemiStructuredSparse::test_sparse - RuntimeError: hipSPARSELt not supported on your machine.
```

Differential Revision: D97540060
@bbeckca bbeckca force-pushed the export-D97540060 branch 2 times, most recently from 671a601 to b85bedf Compare March 23, 2026 16:27
bbeckca added a commit to bbeckca/ao that referenced this pull request Mar 23, 2026
…4125)

Summary:

What: Add a guard in test/sparsity/test_sparse_api.py so tests that depend on `hipSPARSELt` only run when the backend is available.

Why: These tests currently fail on environments without hipSPARSELt, for example OSS AO nightly. Since the functionality is environment dependent, these test should be conditionally skipped. https://fburl.com/9fpszdqg

```
FAILED test/sparsity/test_sparse_api.py::TestSemiStructuredSparse::test_sparse - RuntimeError: hipSPARSELt not supported on your machine.
```

Differential Revision: D97540060
sparsify_(model, semi_sparse_weight())
sparse_result = model(input)

if compile:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we deleting the compile test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not setting any @common_utils.parametrize("compile", [True, False]) so I don't think this path was being used. Would you prefer we enable it as opposed to removing?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, hmm can we add @common_utils.parametrize("compile", [True, False]) to the test as well then?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: Aligned offline. @jcaip will update compile test in follow up diff.

bbeckca added a commit to bbeckca/ao that referenced this pull request Mar 23, 2026
…4125)

Summary:

What: Add a guard in test/sparsity/test_sparse_api.py so tests that depend on `hipSPARSELt` only run when the backend is available.

Why: These tests currently fail on environments without hipSPARSELt, for example OSS AO nightly. Since the functionality is environment dependent, these test should be conditionally skipped. https://fburl.com/9fpszdqg

```
FAILED test/sparsity/test_sparse_api.py::TestSemiStructuredSparse::test_sparse - RuntimeError: hipSPARSELt not supported on your machine.
```

Differential Revision: D97540060
bbeckca added a commit to bbeckca/ao that referenced this pull request Mar 23, 2026
…4125)

Summary:
Pull Request resolved: pytorch#4125

What: Add a guard in test/sparsity/test_sparse_api.py so tests that depend on `hipSPARSELt` only run when the backend is available.

Why: These tests currently fail on environments without hipSPARSELt, for example OSS AO nightly. Since the functionality is environment dependent, these test should be conditionally skipped. https://fburl.com/9fpszdqg

```
FAILED test/sparsity/test_sparse_api.py::TestSemiStructuredSparse::test_sparse - RuntimeError: hipSPARSELt not supported on your machine.
```

Differential Revision: D97540060
bbeckca added a commit to bbeckca/ao that referenced this pull request Mar 23, 2026
…4125)

Summary:

What: Add a guard in test/sparsity/test_sparse_api.py so tests that depend on `hipSPARSELt` only run when the backend is available.

Why: These tests currently fail on environments without hipSPARSELt, for example OSS AO nightly. Since the functionality is environment dependent, these test should be conditionally skipped. https://fburl.com/9fpszdqg

```
FAILED test/sparsity/test_sparse_api.py::TestSemiStructuredSparse::test_sparse - RuntimeError: hipSPARSELt not supported on your machine.
```

Differential Revision: D97540060
bbeckca added a commit to bbeckca/ao that referenced this pull request Mar 23, 2026
…4125)

Summary:

What: Add a guard in test/sparsity/test_sparse_api.py so tests that depend on `hipSPARSELt` only run when the backend is available.

Why: These tests currently fail on environments without hipSPARSELt, for example OSS AO nightly. Since the functionality is environment dependent, these test should be conditionally skipped. https://fburl.com/9fpszdqg

```
FAILED test/sparsity/test_sparse_api.py::TestSemiStructuredSparse::test_sparse - RuntimeError: hipSPARSELt not supported on your machine.
```

Differential Revision: D97540060
…4125)

Summary:

What: Add a guard in test/sparsity/test_sparse_api.py so tests that depend on `hipSPARSELt` only run when the backend is available.

Why: These tests currently fail on environments without hipSPARSELt, for example OSS AO nightly. Since the functionality is environment dependent, these test should be conditionally skipped. https://fburl.com/9fpszdqg

```
FAILED test/sparsity/test_sparse_api.py::TestSemiStructuredSparse::test_sparse - RuntimeError: hipSPARSELt not supported on your machine.
```

Differential Revision: D97540060
@jerryzh168 jerryzh168 merged commit ac0b820 into pytorch:main Mar 24, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported module: not user facing Use this tag if you don't want this PR to show up in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants