Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
78f4590b
Unverified
Commit
78f4590b
authored
Jan 09, 2025
by
Yan Ma
Committed by
GitHub
Jan 09, 2025
Browse files
[Bugfix][XPU] fix silu_and_mul (#11823)
Signed-off-by:
yan ma
<
yan.ma@intel.com
>
parent
2f702498
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
vllm/model_executor/layers/activation.py
vllm/model_executor/layers/activation.py
+2
-2
vllm/plugins/__init__.py
vllm/plugins/__init__.py
+2
-3
No files found.
vllm/model_executor/layers/activation.py
View file @
78f4590b
...
@@ -64,8 +64,8 @@ class SiluAndMul(CustomOp):
...
@@ -64,8 +64,8 @@ class SiluAndMul(CustomOp):
if
current_platform
.
is_cuda_alike
()
or
current_platform
.
is_cpu
():
if
current_platform
.
is_cuda_alike
()
or
current_platform
.
is_cpu
():
self
.
op
=
torch
.
ops
.
_C
.
silu_and_mul
self
.
op
=
torch
.
ops
.
_C
.
silu_and_mul
elif
current_platform
.
is_xpu
():
elif
current_platform
.
is_xpu
():
import
intel_extension_for_pytorch
as
ipex
from
vllm._ipex_ops
import
ipex
_ops
self
.
op
=
ipex
.
llm
.
functional
.
silu_and_mul
self
.
op
=
ipex
_ops
.
silu_and_mul
def
forward_native
(
self
,
x
:
torch
.
Tensor
)
->
torch
.
Tensor
:
def
forward_native
(
self
,
x
:
torch
.
Tensor
)
->
torch
.
Tensor
:
"""PyTorch-native implementation equivalent to forward()."""
"""PyTorch-native implementation equivalent to forward()."""
...
...
vllm/plugins/__init__.py
View file @
78f4590b
...
@@ -63,8 +63,8 @@ def load_general_plugins():
...
@@ -63,8 +63,8 @@ def load_general_plugins():
from
vllm.platforms
import
current_platform
from
vllm.platforms
import
current_platform
if
current_platform
.
is_xpu
():
if
current_platform
.
is_xpu
():
# see https://github.com/pytorch/pytorch/blob/
8cada5cbe5450e17c26fb8b358116785324537b2
/torch/_dynamo/config.py#L158
# noqa
# see https://github.com/pytorch/pytorch/blob/
43c5f59
/torch/_dynamo/config.py#L158
os
.
environ
[
'TORCH_COMPILE_DISABLE'
]
=
'
True
'
torch
.
_dynamo
.
config
.
disable
=
True
if
current_platform
.
is_hpu
():
if
current_platform
.
is_hpu
():
# NOTE(kzawora): PT HPU lazy backend (PT_HPU_LAZY_MODE = 1)
# NOTE(kzawora): PT HPU lazy backend (PT_HPU_LAZY_MODE = 1)
# does not support torch.compile
# does not support torch.compile
...
@@ -72,7 +72,6 @@ def load_general_plugins():
...
@@ -72,7 +72,6 @@ def load_general_plugins():
# torch.compile support
# torch.compile support
is_lazy
=
os
.
environ
.
get
(
'PT_HPU_LAZY_MODE'
,
'1'
)
==
'1'
is_lazy
=
os
.
environ
.
get
(
'PT_HPU_LAZY_MODE'
,
'1'
)
==
'1'
if
is_lazy
:
if
is_lazy
:
# see https://github.com/pytorch/pytorch/blob/43c5f59/torch/_dynamo/config.py#L158
torch
.
_dynamo
.
config
.
disable
=
True
torch
.
_dynamo
.
config
.
disable
=
True
# NOTE(kzawora) multi-HPU inference with HPUGraphs (lazy-only)
# NOTE(kzawora) multi-HPU inference with HPUGraphs (lazy-only)
# requires enabling lazy collectives
# requires enabling lazy collectives
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment