refactor: unify CUDA skip guards in tests
- add skip_no_fp8 (CUDA + fp8_mm kernel + cc 8.9+) to tests/conftest.py - use skip_no_cuda / skip_no_kernel / skip_no_fp8 directly in test modules - drop _GPU alias and tests.extension.conftest re-exports - remove unused imports (Union in hf_adapter, make_grpo_config in data conftest)
This commit is contained in:
@@ -15,8 +15,17 @@ from tests.helpers import (
|
||||
|
||||
CUDA_AVAIL = torch.cuda.is_available()
|
||||
KERNEL_AVAIL = CUDA_AVAIL and all(is_available(k) for k in KERNEL_NAMES)
|
||||
FP8_AVAIL = (
|
||||
CUDA_AVAIL
|
||||
and is_available("fp8_mm")
|
||||
and torch.cuda.get_device_capability() >= (8, 9)
|
||||
)
|
||||
skip_no_cuda = pytest.mark.skipif(not CUDA_AVAIL, reason="CUDA not available")
|
||||
skip_no_kernel = pytest.mark.skipif(not KERNEL_AVAIL, reason="CUDA kernels not built")
|
||||
skip_no_fp8 = pytest.mark.skipif(
|
||||
not FP8_AVAIL,
|
||||
reason="fused FP8 MMA requires a built kernel and compute capability 8.9+",
|
||||
)
|
||||
|
||||
|
||||
def pytest_configure(config):
|
||||
|
||||
Reference in New Issue
Block a user