mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-11 14:56:16 +08:00
[BugFix] Fix ray import error mem cleanup bug (#21381)
Signed-off-by: Travis Johnson <tsjohnso@us.ibm.com> Signed-off-by: Joe Runde <Joseph.Runde@ibm.com> Co-authored-by: Travis Johnson <tsjohnso@us.ibm.com>
This commit is contained in:
parent
35bc8bd5fb
commit
b77c7d327f
@ -2137,10 +2137,11 @@ class ParallelConfig:
|
|||||||
elif (current_platform.is_cuda()
|
elif (current_platform.is_cuda()
|
||||||
and cuda_device_count_stateless() < self.world_size):
|
and cuda_device_count_stateless() < self.world_size):
|
||||||
if not ray_found:
|
if not ray_found:
|
||||||
raise ValueError("Unable to load Ray which is "
|
raise ValueError("Unable to load Ray: "
|
||||||
|
f"{ray_utils.ray_import_err}. Ray is "
|
||||||
"required for multi-node inference, "
|
"required for multi-node inference, "
|
||||||
"please install Ray with `pip install "
|
"please install Ray with `pip install "
|
||||||
"ray`.") from ray_utils.ray_import_err
|
"ray`.")
|
||||||
backend = "ray"
|
backend = "ray"
|
||||||
elif self.data_parallel_backend == "ray":
|
elif self.data_parallel_backend == "ray":
|
||||||
logger.info("Using ray distributed inference because "
|
logger.info("Using ray distributed inference because "
|
||||||
|
|||||||
@ -145,7 +145,9 @@ try:
|
|||||||
|
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
ray = None # type: ignore
|
ray = None # type: ignore
|
||||||
ray_import_err = e
|
# only capture string to avoid variable references in the traceback that can
|
||||||
|
# prevent garbage collection in some cases
|
||||||
|
ray_import_err = str(e)
|
||||||
RayWorkerWrapper = None # type: ignore
|
RayWorkerWrapper = None # type: ignore
|
||||||
|
|
||||||
|
|
||||||
@ -157,8 +159,8 @@ def ray_is_available() -> bool:
|
|||||||
def assert_ray_available():
|
def assert_ray_available():
|
||||||
"""Raise an exception if Ray is not available."""
|
"""Raise an exception if Ray is not available."""
|
||||||
if ray is None:
|
if ray is None:
|
||||||
raise ValueError("Failed to import Ray, please install Ray with "
|
raise ValueError(f"Failed to import Ray: {ray_import_err}."
|
||||||
"`pip install ray`.") from ray_import_err
|
"Please install Ray with `pip install ray`.")
|
||||||
|
|
||||||
|
|
||||||
def _verify_bundles(placement_group: "PlacementGroup",
|
def _verify_bundles(placement_group: "PlacementGroup",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user