vllm.v1.executor.ray_utils
¶
Functions:
-
assert_ray_available–Raise an exception if Ray is not available.
-
build_actor_name–Build a descriptive Ray actor name for dashboard visibility.
-
get_bundles_for_indices–Return GPU bundle indices paired with node IDs and node IPs for
-
get_bundles_sorted_by_node–Return GPU bundle indices paired with node IDs and node IPs,
-
initialize_ray_cluster–Initialize the distributed cluster with Ray.
-
ray_is_available–Returns True if Ray is available.
_verify_bundles(placement_group, parallel_config, device_str)
¶
Warn if all tensor parallel workers cannot fit in a single node.
Source code in vllm/v1/executor/ray_utils.py
_wait_until_pg_ready(current_placement_group)
¶
Wait until a placement group is ready.
It prints the informative log messages if the placement group is not created within time.
Source code in vllm/v1/executor/ray_utils.py
assert_ray_available()
¶
Raise an exception if Ray is not available.
build_actor_name(instance_id, rank, tp_size, pp_size, pcp_size)
¶
Build a descriptive Ray actor name for dashboard visibility.
Source code in vllm/v1/executor/ray_utils.py
get_bundles_for_indices(placement_group, bundle_indices, world_size)
¶
Return GPU bundle indices paired with node IDs and node IPs for explicit bundle indices specified via VLLM_RAY_BUNDLE_INDICES.
Source code in vllm/v1/executor/ray_utils.py
get_bundles_sorted_by_node(placement_group)
¶
Return GPU bundle indices paired with node IDs and node IPs, sorted driver-first.
This utility has to be invoked from the driver node.
Example: 3-node cluster, driver on node-A, PG bundles spread across nodes:
Input: [ (0, node-C), (1, node-A), (2, node-B), (3, node-C), (4, node-A), (5, node-B), ] Output: [ (1, node-A), (4, node-A), (2, node-B), (5, node-B), (0, node-C), (3, node-C), ]
Source code in vllm/v1/executor/ray_utils.py
initialize_ray_cluster(parallel_config, ray_address=None)
¶
Initialize the distributed cluster with Ray.
it will connect to the Ray cluster and create a placement group for the workers, which includes the specification of the resources for each distributed worker.
Parameters:
-
(parallel_config¶ParallelConfig) –The configurations for parallel execution.
-
(ray_address¶str | None, default:None) –The address of the Ray cluster. If None, uses the default Ray cluster address.
Source code in vllm/v1/executor/ray_utils.py
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |