Skip to content

Commit 9e26123

Browse files
committed
Revert "test: skip cuda tests when sglang import fails"
This reverts commit c5bc7e3.
1 parent c5bc7e3 commit 9e26123

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

tests/test_model_cuda.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,11 @@
1616
# Delay import of SGLExecutor to avoid import errors when sglang is not available
1717
# This allows test collection to succeed even if sglang is not installed
1818
SGLExecutor = None
19-
SGL_EXECUTOR_IMPORT_ERROR = None
2019
try:
2120
from parallax.server.executor.sglang_executor import SGLExecutor
22-
except ImportError as exc:
21+
except ImportError:
2322
# sglang not available, tests will be skipped
24-
SGL_EXECUTOR_IMPORT_ERROR = exc
25-
except Exception as exc:
26-
if is_cuda_available():
27-
raise
28-
SGL_EXECUTOR_IMPORT_ERROR = exc
23+
pass
2924

3025
CUDA_MODEL_REPO = "Qwen/Qwen3-0.6B"
3126
TOTAL_LAYERS = 28
@@ -69,10 +64,7 @@ def test_cuda_shard_prefill(layers_config: List[Tuple[int, int]], ref_model_and_
6964
but uses parallax's SGLExecutor instead of direct model loading.
7065
"""
7166
if SGLExecutor is None:
72-
pytest.skip(
73-
"sglang not available or failed to import "
74-
f"({type(SGL_EXECUTOR_IMPORT_ERROR).__name__}: {SGL_EXECUTOR_IMPORT_ERROR})"
75-
)
67+
pytest.skip("sglang not available (install with 'pip install -e .[gpu]')")
7668
if not is_cuda_available():
7769
pytest.skip("CUDA not available")
7870

@@ -179,10 +171,7 @@ def test_cuda_executor_pipeline(ref_model_and_tokenizer):
179171
This test creates a 2-stage pipeline and verifies it can process requests.
180172
"""
181173
if SGLExecutor is None:
182-
pytest.skip(
183-
"sglang not available or failed to import "
184-
f"({type(SGL_EXECUTOR_IMPORT_ERROR).__name__}: {SGL_EXECUTOR_IMPORT_ERROR})"
185-
)
174+
pytest.skip("sglang not available (install with 'pip install -e .[gpu]')")
186175
if not is_cuda_available():
187176
pytest.skip("CUDA not available")
188177

0 commit comments

Comments
 (0)