You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by "andrewmusselman (via GitHub)" <gi...@apache.org> on 2026/10/20 17:57:35 UTC
[PR] [Test] Skip QDP tests without a usable GPU or PyTorch arch support (#1331) [mahout]
andrewmusselman opened a new pull request, #1550:
URL: https://github.com/apache/mahout/pull/1550
### Purpose of PR
Most of Pattern A in #1331 was already fixed on main by #1321 and #1416; this PR closes the two remaining gaps and adds Pattern B. Tests that launch PyTorch kernels on CUDA now skip when the installed PyTorch wheel has no kernels for the GPU's compute capability, using the same check as production code (`qumat_qdp.loader._select_torch_device`, from #1323). No assertions change.
### Related Issues or PRs
Closes #1331 (Pattern A mostly fixed by #1321 and #1416; builds on #1323)
### Changes Made
- `testing/qdp_python/test_dlpack_validation.py`: module-level `pytestmark` replaces per-test `torch.cuda.is_available()` checks; the shared `qdp_engine` fixture in `testing/conftest.py` also skips without a usable device.
- `testing/conftest.py`: new `gpu_torch` marker; `_torch_cuda_skip_reason()` / `_cuda_compatible_with_torch()` call `_select_torch_device` itself; the probe runs lazily, once. Marker registered in `pyproject.toml`.
- `testing/qdp_python/test_gpu_guards.py`: unit tests with a monkeypatched `torch.cuda` (supported, unsupported, absent GPU).
- Apply `gpu_torch` to tests that run PyTorch on CUDA: 47 in `test_bindings.py`, 11 in `test_numpy.py`, 2 in `test_high_fidelity.py`; `test_torch_ref.py` drops its local arch-check copy.
### Testing
- Main did not reproduce the issue on a no-GPU box with a stub build (`testing/qdp testing/qdp_python`: 132 passed, 156 skipped, 0 failed).
- Simulated with a fake `libcuda.so` and a scratch plugin (not part of the patch): torch reporting sm_61 went from 137 failures to 36 (108 tests now skip with the arch reason); sm_86 with a stub `_qdp` went from 23 to 12 (dlpack tests now skip). Remaining failures are artifacts of the simulation.
- Full `pytest testing` with the stub build: 735 passed, 156 skipped (main: 721 / 156).
- ruff and ruff format clean; `ty` adds no new diagnostics.
- Not verified: anything on real hardware (a supported GPU or a Pascal card).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01GuXmXRXdNF43h2FoQcNAZb
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@mahout.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Test] Skip QDP tests without a usable GPU or PyTorch arch support (#1331) [mahout]
Posted by "400Ping (via GitHub)" <gi...@apache.org>.
400Ping commented on code in PR #1550:
URL: https://github.com/apache/mahout/pull/1550#discussion_r4423124132
##########
testing/conftest.py:
##########
@@ -70,23 +74,85 @@ def _gpu_available() -> bool:
_GPU_AVAILABLE = _gpu_available()
Review Comment:
Right default for developer machines (and -rs prints the reason). If a GPU runner is ever added, this branch should hard-fail under an opt-in env var so a broken torch install on the runner cannot go green by skipping. Follow-up, not for this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@mahout.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org