@@ -185,7 +185,8 @@ test-smoke: ## Run CPU smoke tests (~few min, no GPU required)
185185SMOKE_DIR := tests/smoke
186186.PHONY : test-smoke-gpu
187187test-smoke-gpu : # # Run GPU smoke tests (requires CUDA)
188- # -n 0 disables xdist. Groups are split for GPU memory isolation.
188+ # Uses PYTEST_NO_XDIST_CMD (-n 0) because CUDA device-side asserts poison
189+ # xdist workers. Groups are split for GPU memory isolation.
189190#
190191# When adding a new GPU smoke test file:
191192# - Train-only (no vLLM): add pytest.mark.requires_gpu -> auto-discovered below
@@ -194,23 +195,21 @@ test-smoke-gpu: ## Run GPU smoke tests (requires CUDA)
194195# - Downloads from Hub: also add pytest.mark.smollm2 (or similar) -> auto-discovered below
195196#
196197# 1) Train-only tests share a process (no vLLM, safe to batch).
197- $(PYTEST_CMD ) $(SMOKE_DIR)/ -n 0 -m "requires_gpu and not vllm and not smollm2 and not unsloth"
198+ $(PYTEST_NO_XDIST_CMD ) $(SMOKE_DIR)/ -m "requires_gpu and not vllm and not smollm2 and not unsloth"
198199# 2) Each vLLM test file gets its own process -- vLLM pre-allocates all GPU
199200# memory and never releases it within a process.
200- $(PYTEST_CMD ) $(SMOKE_DIR)/test_nss_generation_gpu.py -n 0
201- $(PYTEST_CMD ) $(SMOKE_DIR)/test_nss_resume_gpu.py -n 0
202- $(PYTEST_CMD ) $(SMOKE_DIR)/test_nss_structured_gen_gpu.py -n 0
203- $(PYTEST_CMD ) $(SMOKE_DIR)/test_nss_timeseries_gpu.py -n 0
201+ $(PYTEST_NO_XDIST_CMD ) $(SMOKE_DIR)/test_nss_generation_gpu.py
202+ $(PYTEST_NO_XDIST_CMD ) $(SMOKE_DIR)/test_nss_resume_gpu.py
203+ $(PYTEST_NO_XDIST_CMD ) $(SMOKE_DIR)/test_nss_structured_gen_gpu.py
204+ $(PYTEST_NO_XDIST_CMD ) $(SMOKE_DIR)/test_nss_timeseries_gpu.py
204205# 3) SmolLM2 (Hub download + vLLM) and Unsloth (patches transformers) are marker-isolated.
205- $(PYTEST_CMD ) $(SMOKE_DIR)/ -n 0 -m "requires_gpu and smollm2"
206- $(PYTEST_CMD ) $(SMOKE_DIR)/ -n 0 -m "requires_gpu and unsloth"
206+ $(PYTEST_NO_XDIST_CMD ) $(SMOKE_DIR)/ -m "requires_gpu and smollm2"
207+ $(PYTEST_NO_XDIST_CMD ) $(SMOKE_DIR)/ -m "requires_gpu and unsloth"
207208
208209
209210E2E_TEST_FILE := $(NSS_ROOT_PATH ) /tests/e2e/test_safe_synthesizer.py
210211.PHONY : test-gpu-integration
211- test-gpu-integration : # # Run GPU integration tests (smoke GPU + e2e)
212- # -n 0 disables xdist: CUDA device-side asserts poison the worker, cascading to all subsequent tests.
213- # Separate invocations: (1) local tiny-model tests, (2) SmolLM2 Hub test, (3) Unsloth (process-isolated from DP).
212+ test-gpu-integration : # # Run GPU e2e tests (default + DP configs)
214213 pushd $(NSS_ROOT_PATH ) && \
215214 $(PYTEST_CMD ) $(E2E_TEST_FILE ) -k default && \
216215 $(PYTEST_CMD ) $(E2E_TEST_FILE ) -k dp
0 commit comments