Skip to content

Commit

Permalink
[hardware][rocm] allow rocm to override default env var (vllm-project…
Browse files Browse the repository at this point in the history
  • Loading branch information
youkaichao authored Aug 28, 2024
1 parent fab5f53 commit bc6e42a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vllm/core/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,8 +1088,9 @@ def _can_append_slots(self, seq_group: SequenceGroup) -> bool:
)

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

return no_beam_search

Expand Down
11 changes: 11 additions & 0 deletions vllm/platforms/rocm.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import os
from functools import lru_cache
from typing import Tuple

import torch

from vllm.logger import init_logger

from .interface import Platform, PlatformEnum

logger = init_logger(__name__)

if os.environ.get("VLLM_WORKER_MULTIPROC_METHOD", None) in ["fork", None]:
logger.warning("`fork` method is not supported by ROCm. "
"VLLM_WORKER_MULTIPROC_METHOD is overridden to"
" `spawn` instead.")
os.environ["VLLM_WORKER_MULTIPROC_METHOD"] = "spawn"


class RocmPlatform(Platform):
_enum = PlatformEnum.ROCM
Expand Down

0 comments on commit bc6e42a

Please sign in to comment.