[Misc][XPU] Avoid torch compile for XPU platform (#10747)
Signed-off-by: yan ma <yan.ma@intel.com> Co-authored-by: youkaichao <youkaichao@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import os
|
||||
import torch
|
||||
|
||||
import vllm.envs as envs
|
||||
from vllm.platforms import current_platform
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -25,6 +26,9 @@ def load_general_plugins():
|
||||
os.environ['TORCHINDUCTOR_COMPILE_THREADS'] = '1'
|
||||
# see https://github.com/vllm-project/vllm/issues/10619
|
||||
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
|
||||
if plugins_loaded:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user