A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 22:15 UTC
[misc] Rename Ray ADAG to Compiled Graph (#13928)
Rui Qiao committed
Feb 26, 2025 at 20:03 UTC
c9944acbf9bfe97ba9e820b34695063c1a2b556a
6 files changed
+22
-20
tests/basic_correctness/test_basic_correctness.py
+1
-1
@@ -117,7 +117,7 @@ def test_models_distributed(
117
pytest.skip(f"Skip test for {test_suite}")
118
119
if model == "meta-llama/Llama-3.2-1B-Instruct" and distributed_executor_backend == "ray" and attention_backend == "" and test_suite == "L4": # noqa
120
- # test ray adag
120
+ # test Ray Compiled Graph
121
os.environ['VLLM_USE_RAY_SPMD_WORKER'] = "1"
122
os.environ['VLLM_USE_RAY_COMPILED_DAG'] = "1"
123
tests/basic_correctness/test_chunked_prefill.py
+1
-1
@@ -93,7 +93,7 @@ def test_models_distributed(
93
94
if (model == "meta-llama/Llama-3.2-1B-Instruct"
95
and distributed_executor_backend == "ray"):
96
- # test ray adag
96
+ # test Ray Compiled Graph
97
os.environ['VLLM_USE_RAY_SPMD_WORKER'] = "1"
98
os.environ['VLLM_USE_RAY_COMPILED_DAG'] = "1"
99
tests/distributed/test_pipeline_parallel.py
+6
-5
@@ -324,8 +324,8 @@ def _compare_tp(
324
specific_case = tp_size == 2 and pp_size == 2 and chunked_prefill
325
if distributed_backend == "ray" and (vllm_major_version == "1"
326
or specific_case):
327
- # For V1, test Ray ADAG for all the tests
328
- # For V0, test Ray ADAG for a subset of the tests
327
+ # For V1, test Ray Compiled Graph for all the tests
328
+ # For V0, test Ray Compiled Graph for a subset of the tests
329
pp_env = {
330
"VLLM_USE_V1": vllm_major_version,
331
"VLLM_USE_RAY_COMPILED_DAG": "1",
@@ -333,7 +333,7 @@ def _compare_tp(
333
"VLLM_USE_RAY_COMPILED_DAG_NCCL_CHANNEL": "1",
334
}
335
# Temporary. Currently when zeromq + SPMD is used, it does not properly
336
- # terminate because of aDAG issue.
336
+ # terminate because of a Ray Compiled Graph issue.
337
common_args.append("--disable-frontend-multiprocessing")
338
else:
339
pp_env = None
@@ -367,8 +367,9 @@ def _compare_tp(
367
if pp_env is None:
368
raise
369
else:
370
- # Ray ADAG tests are flaky, so we don't want to fail the test
371
- logger.exception("Ray ADAG tests failed")
370
+ # Ray Compiled Graph tests are flaky,
371
+ # so we don't want to fail the test
372
+ logger.exception("Ray Compiled Graph tests failed")
373
374
375
@pytest.mark.parametrize(
vllm/envs.py
+5
-4
@@ -371,21 +371,22 @@ environment_variables: Dict[str, Callable[[], Any]] = {
371
"VLLM_USE_RAY_SPMD_WORKER":
372
lambda: bool(int(os.getenv("VLLM_USE_RAY_SPMD_WORKER", "0"))),
373
374
- # If the env var is set, it uses the Ray's compiled DAG API
375
- # which optimizes the control plane overhead.
374
+ # If the env var is set, it uses the Ray's Compiled Graph
375
+ # (previously known as ADAG) API which optimizes the
376
+ # control plane overhead.
377
# Run vLLM with VLLM_USE_RAY_COMPILED_DAG=1 to enable it.
378
"VLLM_USE_RAY_COMPILED_DAG":
379
lambda: bool(int(os.getenv("VLLM_USE_RAY_COMPILED_DAG", "0"))),
380
381
# If the env var is set, it uses NCCL for communication in
381
- # Ray's compiled DAG. This flag is ignored if
382
+ # Ray's Compiled Graph. This flag is ignored if
383
# VLLM_USE_RAY_COMPILED_DAG is not set.
384
"VLLM_USE_RAY_COMPILED_DAG_NCCL_CHANNEL":
385
lambda: bool(int(os.getenv("VLLM_USE_RAY_COMPILED_DAG_NCCL_CHANNEL", "1"))
386
),
387
388
# If the env var is set, it enables GPU communication overlap
388
- # (experimental feature) in Ray's compiled DAG. This flag is ignored if
389
+ # (experimental feature) in Ray's Compiled Graph. This flag is ignored if
390
# VLLM_USE_RAY_COMPILED_DAG is not set.
391
"VLLM_USE_RAY_COMPILED_DAG_OVERLAP_COMM":
392
lambda: bool(int(os.getenv("VLLM_USE_RAY_COMPILED_DAG_OVERLAP_COMM", "0"))
vllm/executor/ray_distributed_executor.py
+5
-5
@@ -491,7 +491,7 @@ class RayDistributedExecutor(DistributedExecutorBase):
491
async_run_remote_workers_only to complete."""
492
ray.get(parallel_worker_tasks)
493
494
- def _check_ray_adag_installation(self):
494
+ def _check_ray_cgraph_installation(self):
495
import pkg_resources
496
from packaging import version
497
@@ -503,10 +503,10 @@ class RayDistributedExecutor(DistributedExecutorBase):
503
f"required, but found {current_version}")
504
505
import importlib.util
506
- adag_spec = importlib.util.find_spec(
506
+ cgraph_spec = importlib.util.find_spec(
507
"ray.experimental.compiled_dag_ref")
508
- if adag_spec is None:
509
- raise ValueError("Ray accelerated DAG is not installed. "
508
+ if cgraph_spec is None:
509
+ raise ValueError("Ray Compiled Graph is not installed. "
510
"Run `pip install ray[adag]` to install it.")
511
512
cupy_spec = importlib.util.find_spec("cupy")
@@ -518,7 +518,7 @@ class RayDistributedExecutor(DistributedExecutorBase):
518
519
def _compiled_ray_dag(self, enable_asyncio: bool):
520
assert self.parallel_config.use_ray
521
- self._check_ray_adag_installation()
521
+ self._check_ray_cgraph_installation()
522
from ray.dag import InputNode, MultiOutputNode
523
from ray.experimental.channel.torch_tensor_type import TorchTensorType
524
vllm/executor/ray_utils.py
+4
-4
@@ -83,9 +83,9 @@ try:
83
84
execute_model_req = self.input_decoder.decode(serialized_req)
85
86
- # TODO(swang): This is needed right now because Ray aDAG executes
87
- # on a background thread, so we need to reset torch's current
88
- # device.
86
+ # TODO(swang): This is needed right now because Ray Compiled Graph
87
+ # executes on a background thread, so we need to reset torch's
88
+ # current device.
89
import torch
90
if not self.compiled_dag_cuda_device_set:
91
torch.cuda.set_device(self.worker.device)
@@ -119,7 +119,7 @@ try:
119
"IntermediateTensors"]],
120
) -> Union["ModelRunnerOutput", Tuple["SchedulerOutput",
121
"IntermediateTensors"]]:
122
- # this method is used to compile ray CG,
122
+ # This method is used by Ray Compiled Graph to execute the model,
123
# and it needs a special logic of self.setup_device_if_necessary()
124
self.setup_device_if_necessary()
125
assert self.worker is not None, "Worker is not initialized"