Skip to content

Commit c95d5eb

Browse files
committed
fixed test
Signed-off-by: weijiac <weijiac@NVIDIA.com>
1 parent 8143f33 commit c95d5eb

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

tests/stages/video/caption/conftest.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,6 @@
2121

2222
import pytest
2323

24-
# ---------------------------------------------------------------------------
25-
# vLLM 0.14+ spawns its EngineCore via fork() by default. If any prior code
26-
# (e.g. HF AutoProcessor) has created threads, the forked child inherits
27-
# their lock state and deadlocks. Forcing spawn avoids this entirely.
28-
# TOKENIZERS_PARALLELISM=false prevents HF fast-tokenizer threads from being
29-
# created in the first place (belt-and-suspenders).
30-
# Both must be set before any import that might start threads.
31-
# ---------------------------------------------------------------------------
32-
os.environ.setdefault("VLLM_WORKER_MULTIPROC_METHOD", "spawn")
33-
os.environ.setdefault("TOKENIZERS_PARALLELISM", "false")
34-
_custom_hf = os.environ.get("CUSTOM_HF_DATASET", "")
35-
if _custom_hf:
36-
os.environ.setdefault("HF_HOME", _custom_hf)
37-
3824
# ---------------------------------------------------------------------------
3925
# Override the session-level autouse Ray cluster fixture from the root conftest.
4026
# Integration tests call stages directly — no Ray pipeline needed.
@@ -87,6 +73,16 @@ def enhancement_stage():
8773
8874
setup() loads vLLM's LLM() with Qwen2.5-14B-Instruct via HF auto-download.
8975
"""
76+
# Set env vars here (not module-level) so they don't affect other GPU tests
77+
# collected in the same pytest session (e.g. tests/core/test_serve.py).
78+
# vLLM 0.14+ spawns its EngineCore via fork() by default; forcing spawn
79+
# avoids deadlocks when HF AutoProcessor has already created threads.
80+
os.environ.setdefault("VLLM_WORKER_MULTIPROC_METHOD", "spawn")
81+
os.environ.setdefault("TOKENIZERS_PARALLELISM", "false")
82+
_custom_hf = os.environ.get("CUSTOM_HF_DATASET", "")
83+
if _custom_hf:
84+
os.environ.setdefault("HF_HOME", _custom_hf)
85+
9086
from nemo_curator.stages.video.caption.caption_enhancement import CaptionEnhancementStage
9187

9288
model_dir = os.environ.get("CURATOR_TEST_MODEL_DIR", "")

0 commit comments

Comments
 (0)