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
4440e8c0
Commit
4440e8c0
authored
Aug 22, 2024
by
zhuwenwen
Browse files
use opt layernorm_kernels
parent
d8ae62c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
vllm/model_executor/layers/layernorm.py
vllm/model_executor/layers/layernorm.py
+26
-26
No files found.
vllm/model_executor/layers/layernorm.py
View file @
4440e8c0
...
...
@@ -52,14 +52,14 @@ class RMSNorm(CustomOp):
from
vllm
import
_custom_ops
as
ops
if
residual
is
not
None
:
#
if envs.VLLM_USE_OPT_OP:
#
ops.fused_add_rms_norm_opt(
#
x,
#
residual,
#
self.weight.data,
#
self.variance_epsilon,
#
)
#
else:
if
envs
.
VLLM_USE_OPT_OP
:
ops
.
fused_add_rms_norm_opt
(
x
,
residual
,
self
.
weight
.
data
,
self
.
variance_epsilon
,
)
else
:
ops
.
fused_add_rms_norm
(
x
,
residual
,
...
...
@@ -68,14 +68,14 @@ class RMSNorm(CustomOp):
)
return
x
,
residual
out
=
torch
.
empty_like
(
x
)
#
if envs.VLLM_USE_OPT_OP:
#
ops.rms_norm_opt(
#
out,
#
x,
#
self.weight.data,
#
self.variance_epsilon,
#
)
#
else:
if
envs
.
VLLM_USE_OPT_OP
:
ops
.
rms_norm_opt
(
out
,
x
,
self
.
weight
.
data
,
self
.
variance_epsilon
,
)
else
:
ops
.
rms_norm
(
out
,
x
,
...
...
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