vllm_omni.distributed.ray_utils.utils ¶
calculate_total_bytes ¶
Calculate total bytes for a tensor allocation, handling nested tuples in size args.
create_placement_group ¶
create_placement_group(
number_of_stages: int,
address: str | None = None,
strategy: str = "PACK",
) -> PlacementGroup
Create a placement group for the given number of stages. Args: number_of_stages: The number of stages to create the placement group for. strategy: The strategy to use for the placement group. Returns: The placement group.
get_ray_task_error ¶
Gets ray task. Returns RayTaskError if ray instance exited with any error, else None.
is_ray_initialized ¶
Check if Ray is initialized without hard dependency on Ray.
is_ray_task_alive ¶
is_ray_task_alive(task_ref: Any, **kwargs)
Checks ray task status. Returns FALSE if ray task has exited for any reason.
maybe_disable_pin_memory_for_ray ¶
Context manager to temporarily disable pin_memory if running in Ray and the allocation size exceeds the threshold.
This is a workaround for Ray workers often having low ulimit -l (locked memory), causing OS call failed errors when allocating large pinned buffers.
start_ray_actor ¶
start_ray_actor(
worker_entry_fn,
placement_group,
placement_group_bundle_index: int,
*args,
**kwargs,
)
try_close_ray ¶
Try to clean up Ray resources including placement group and shutdown.