Task Description
Our test suite currently applies both:
@pytest.mark.gpu
@pytest.mark.skipif(not torch.cuda.is_available(), ...)
on GPU-related tests.
However, based on our existing project workflow and pyproject.toml configuration:
-
GPU tests are already excluded by default via:
addopts = ["-m", "not gpu and not slow"]
-
GPU tests are triggered only manually, e.g., pytest -m gpu
-
CUDA-dependent imports are already guarded using:
pytest.importorskip("torch")
pytest.importorskip("transformers")
Given these behaviors, the skipif decorator may be redundant and could unintentionally hide misconfigured environments, especially when someone intentionally runs pytest -m gpu but lacks a valid CUDA setup.
This issue proposes to evaluate whether GPU tests should use only @pytest.mark.gpu, removing the extra skipif layer to simplify the logic and make failures more explicit when GPU tests are intentionally invoked.
The goal is to align our testing strategy with how we already structure markers and CI execution.
Additional Context
- GPU tests are currently excluded by default in
pyproject.toml
- GPU dependencies are guarded using
pytest.importorskip
- Running
pytest -m gpu explicitly expresses intent to use a CUDA-enabled environment
- Removing
skipif may help surface configuration issues rather than silently skipping tests
Task Description
Our test suite currently applies both:
@pytest.mark.gpu@pytest.mark.skipif(not torch.cuda.is_available(), ...)on GPU-related tests.
However, based on our existing project workflow and
pyproject.tomlconfiguration:GPU tests are already excluded by default via:
GPU tests are triggered only manually, e.g.,
pytest -m gpuCUDA-dependent imports are already guarded using:
Given these behaviors, the
skipifdecorator may be redundant and could unintentionally hide misconfigured environments, especially when someone intentionally runspytest -m gpubut lacks a valid CUDA setup.This issue proposes to evaluate whether GPU tests should use only
@pytest.mark.gpu, removing the extraskipiflayer to simplify the logic and make failures more explicit when GPU tests are intentionally invoked.The goal is to align our testing strategy with how we already structure markers and CI execution.
Additional Context
pyproject.tomlpytest.importorskippytest -m gpuexplicitly expresses intent to use a CUDA-enabled environmentskipifmay help surface configuration issues rather than silently skipping tests