Unverified Commit 519cc6ca authored by Yan Ma's avatar Yan Ma Committed by GitHub
Browse files

[Misc][XPU] Avoid torch compile for XPU platform (#10747)


Signed-off-by: default avataryan ma <yan.ma@intel.com>
Co-authored-by: default avataryoukaichao <youkaichao@gmail.com>
parent b45f0d79
...@@ -12,5 +12,7 @@ remove_docker_container() { docker rm -f xpu-test || true; } ...@@ -12,5 +12,7 @@ remove_docker_container() { docker rm -f xpu-test || true; }
trap remove_docker_container EXIT trap remove_docker_container EXIT
remove_docker_container remove_docker_container
# Run the image and launch offline inference # Run the image and test offline inference/tensor parallel
docker run --network host --name xpu-test --device /dev/dri -v /dev/dri/by-path:/dev/dri/by-path --entrypoint="" xpu-test python3 examples/offline_inference.py docker run -it -d --name xpu-test --device /dev/dri -v /dev/dri/by-path:/dev/dri/by-path xpu-test /bin/bash
docker exec xpu-test bash -c "python3 examples/offline_inference.py"
docker exec xpu-test bash -c "python3 examples/offline_inference_cli.py -tp 2"
...@@ -4,6 +4,7 @@ import os ...@@ -4,6 +4,7 @@ import os
import torch import torch
import vllm.envs as envs import vllm.envs as envs
from vllm.platforms import current_platform
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -25,6 +26,9 @@ def load_general_plugins(): ...@@ -25,6 +26,9 @@ def load_general_plugins():
os.environ['TORCHINDUCTOR_COMPILE_THREADS'] = '1' os.environ['TORCHINDUCTOR_COMPILE_THREADS'] = '1'
# see https://github.com/vllm-project/vllm/issues/10619 # see https://github.com/vllm-project/vllm/issues/10619
torch._inductor.config.compile_threads = 1 torch._inductor.config.compile_threads = 1
if current_platform.is_xpu():
# see https://github.com/pytorch/pytorch/blob/8cada5cbe5450e17c26fb8b358116785324537b2/torch/_dynamo/config.py#L158 # noqa
os.environ['TORCH_COMPILE_DISABLE'] = 'True'
global plugins_loaded global plugins_loaded
if plugins_loaded: if plugins_loaded:
return return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment