[CI][Omni-DuplexEval] Add nightly scoring CI guard (#7773)
Signed-off-by: RyanYun09 <318555231+RyanYun09@users.noreply.github.com>
This commit is contained in:
1 parent
d521b3f917
commit
732d6085be
11 files changed
+1283
-5
No files matched your search
@@ -18,9 +18,14 @@ def default_env():
|
||||
keys = ("VLLM_WORKER_MULTIPROC_METHOD", "VLLM_TARGET_DEVICE")
|
||||
previous = {key: os.environ.get(key) for key in keys}
|
||||
os.environ["VLLM_WORKER_MULTIPROC_METHOD"] = previous["VLLM_WORKER_MULTIPROC_METHOD"] or "spawn"
|
||||
os.environ["VLLM_TARGET_DEVICE"] = previous["VLLM_TARGET_DEVICE"] or (
|
||||
"cuda" if torch.cuda.is_available() and torch.accelerator.device_count() > 0 else "cpu"
|
||||
)
|
||||
if previous["VLLM_TARGET_DEVICE"]:
|
||||
pass # already set, keep it
|
||||
elif torch.cuda.is_available() and torch.accelerator.device_count() > 0:
|
||||
os.environ["VLLM_TARGET_DEVICE"] = "cuda"
|
||||
elif hasattr(torch, "npu") and torch.npu.is_available():
|
||||
os.environ["VLLM_TARGET_DEVICE"] = "npu"
|
||||
else:
|
||||
os.environ["VLLM_TARGET_DEVICE"] = "cpu"
|
||||
yield
|
||||
for key, value in previous.items():
|
||||
if value is None:
|
||||
@@ -39,8 +44,12 @@ def default_vllm_config():
|
||||
desynchronize vLLM init vs request preprocessing (e.g. renderer state).
|
||||
"""
|
||||
# Use CPU device if no GPU is available (e.g., in CI environments)
|
||||
has_gpu = torch.cuda.is_available() and torch.accelerator.device_count() > 0
|
||||
device = "cuda" if has_gpu else "cpu"
|
||||
if torch.cuda.is_available() and torch.accelerator.device_count() > 0:
|
||||
device = "cuda"
|
||||
elif hasattr(torch, "npu") and torch.npu.is_available():
|
||||
device = "npu"
|
||||
else:
|
||||
device = "cpu"
|
||||
device_config = DeviceConfig(device=device)
|
||||
|
||||
with set_current_vllm_config(VllmConfig(device_config=device_config)):
|
||||
|
||||
Reference in new issue
Block a user