Skip to content

Commit 18e60d7

Browse files
authored
[misc][distributed] add VLLM_SKIP_P2P_CHECK flag (#8911)
1 parent c2ec430 commit 18e60d7

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

vllm/distributed/device_communicators/custom_all_reduce.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ def _can_p2p(rank: int, world_size: int) -> bool:
2828
for i in range(world_size):
2929
if i == rank:
3030
continue
31+
if envs.VLLM_SKIP_P2P_CHECK:
32+
logger.info(
33+
"Skipping P2P check and trusting the driver's P2P report.")
34+
return torch.cuda.can_device_access_peer(rank, i)
3135
if not gpu_p2p_access_check(rank, i):
3236
return False
3337
return True

vllm/envs.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
VLLM_USE_TRITON_AWQ: bool = False
6464
VLLM_ALLOW_RUNTIME_LORA_UPDATING: bool = False
6565
VLLM_ALLOW_DEPRECATED_BEAM_SEARCH: bool = False
66+
VLLM_SKIP_P2P_CHECK: bool = False
6667

6768

6869
def get_default_cache_root():
@@ -423,6 +424,13 @@ def get_default_config_root():
423424
lambda:
424425
(os.environ.get("VLLM_ALLOW_RUNTIME_LORA_UPDATING", "0").strip().lower() in
425426
("1", "true")),
427+
428+
# By default, vLLM will check the peer-to-peer capability itself,
429+
# in case of broken drivers. See https://github.com/vllm-project/vllm/blob/a9b15c606fea67a072416ea0ea115261a2756058/vllm/distributed/device_communicators/custom_all_reduce_utils.py#L101-L108 for details. # noqa
430+
# If this env var is set to 1, vLLM will skip the peer-to-peer check,
431+
# and trust the driver's peer-to-peer capability report.
432+
"VLLM_SKIP_P2P_CHECK":
433+
lambda: os.getenv("VLLM_SKIP_P2P_CHECK", "0") == "1",
426434
}
427435

428436
# end-env-vars-definition

0 commit comments

Comments
 (0)