Skip to content

Commit bc6e42a

Browse files
authored
[hardware][rocm] allow rocm to override default env var (#7926)
1 parent fab5f53 commit bc6e42a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

vllm/core/scheduler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,8 +1088,9 @@ def _can_append_slots(self, seq_group: SequenceGroup) -> bool:
10881088
)
10891089

10901090
def _allow_async_output_proc(self, seq_group: SequenceGroup) -> bool:
1091-
no_beam_search = (seq_group.sampling_params.best_of == 1
1092-
and not seq_group.sampling_params.use_beam_search)
1091+
no_beam_search = seq_group.sampling_params is None or (
1092+
seq_group.sampling_params.best_of == 1
1093+
and not seq_group.sampling_params.use_beam_search)
10931094

10941095
return no_beam_search
10951096

vllm/platforms/rocm.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1+
import os
12
from functools import lru_cache
23
from typing import Tuple
34

45
import torch
56

7+
from vllm.logger import init_logger
8+
69
from .interface import Platform, PlatformEnum
710

11+
logger = init_logger(__name__)
12+
13+
if os.environ.get("VLLM_WORKER_MULTIPROC_METHOD", None) in ["fork", None]:
14+
logger.warning("`fork` method is not supported by ROCm. "
15+
"VLLM_WORKER_MULTIPROC_METHOD is overridden to"
16+
" `spawn` instead.")
17+
os.environ["VLLM_WORKER_MULTIPROC_METHOD"] = "spawn"
18+
819

920
class RocmPlatform(Platform):
1021
_enum = PlatformEnum.ROCM

0 commit comments

Comments
 (0)