[Bugfix] Set breakable graph env before Ray actor import (#53293)
Signed-off-by: Ace Eldeib <aeldeib@coreweave.com> Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
@@ -5,7 +5,10 @@
|
||||
import os
|
||||
from unittest.mock import patch
|
||||
|
||||
from vllm.v1.executor.ray_env_utils import get_driver_env_vars
|
||||
from vllm.v1.executor.ray_env_utils import (
|
||||
get_driver_env_vars,
|
||||
update_runtime_env_for_worker_import,
|
||||
)
|
||||
|
||||
WORKER_VARS: set[str] = {
|
||||
"CUDA_VISIBLE_DEVICES",
|
||||
@@ -49,3 +52,26 @@ class TestExclusion:
|
||||
)
|
||||
def test_non_carry_over_blacklist(self):
|
||||
assert "LMCACHE_LOCAL_CPU" not in get_driver_env_vars(WORKER_VARS)
|
||||
|
||||
|
||||
class TestImportTimePropagation:
|
||||
@patch.dict(os.environ, {"VLLM_USE_BREAKABLE_CUDAGRAPH": "1"}, clear=False)
|
||||
def test_breakable_cudagraph_is_available_during_actor_import(self):
|
||||
runtime_env = {"env_vars": {"EXISTING": "value"}}
|
||||
|
||||
result = update_runtime_env_for_worker_import(runtime_env)
|
||||
|
||||
assert result is runtime_env
|
||||
assert result["env_vars"] == {
|
||||
"EXISTING": "value",
|
||||
"VLLM_USE_BREAKABLE_CUDAGRAPH": "1",
|
||||
}
|
||||
|
||||
@patch.dict(os.environ, {"OTHER_ENV_VAR": "value"}, clear=True)
|
||||
def test_other_env_vars_are_unchanged(self):
|
||||
runtime_env = {"env_vars": {"EXISTING": "value"}}
|
||||
|
||||
result = update_runtime_env_for_worker_import(runtime_env)
|
||||
|
||||
assert result is runtime_env
|
||||
assert result["env_vars"] == {"EXISTING": "value"}
|
||||
|
||||
Reference in New Issue
Block a user