[torch.compile] add a flag to disable custom op (#8488)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import torch.nn as nn
|
||||
|
||||
import vllm.envs as envs
|
||||
from vllm.platforms import current_platform
|
||||
from vllm.utils import is_cpu, is_hip, is_xpu
|
||||
|
||||
@@ -53,6 +54,10 @@ class CustomOp(nn.Module):
|
||||
def dispatch_forward(self):
|
||||
# NOTE(woosuk): Here we assume that vLLM was built for only one
|
||||
# specific backend. Currently, we do not support dynamic dispatching.
|
||||
|
||||
if envs.VLLM_TEST_COMPILE_NO_CUSTOM_OPS:
|
||||
return self.forward_native
|
||||
|
||||
if is_hip():
|
||||
return self.forward_hip
|
||||
elif is_cpu():
|
||||
|
||||
Reference in New Issue
Block a user