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