File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
examples/offline_inference/basic Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 11# SPDX-License-Identifier: Apache-2.0
22# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
33
4+ import os
5+
46from argparse import Namespace
57
68from vllm import LLM , EngineArgs
9+ from vllm .platforms import current_platform
710from vllm .utils .argparse_utils import FlexibleArgumentParser
811
912
@@ -20,6 +23,8 @@ def parse_args():
2023
2124
2225def main (args : Namespace ):
26+ if current_platform .is_rocm ():
27+ os .environ ["VLLM_ATTENTION_BACKEND" ] = "FLEX_ATTENTION"
2328 # Sample prompts.
2429 prompts = [
2530 "Hello, my name is" ,
Original file line number Diff line number Diff line change 11# SPDX-License-Identifier: Apache-2.0
22# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
33
4+ import os
5+
46from argparse import Namespace
57
68from vllm import LLM , EngineArgs
9+ from vllm .platforms import current_platform
710from vllm .utils .argparse_utils import FlexibleArgumentParser
811
912
@@ -20,6 +23,8 @@ def parse_args():
2023
2124
2225def main (args : Namespace ):
26+ if current_platform .is_rocm ():
27+ os .environ ["VLLM_ATTENTION_BACKEND" ] = "FLEX_ATTENTION"
2328 # Sample prompts.
2429 text_1 = "What is the capital of France?"
2530 texts_2 = [
You can’t perform that action at this time.
0 commit comments