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
424fa81f
Commit
424fa81f
authored
Jan 05, 2026
by
zhuwenwen
Browse files
back to forward_static
parent
57e945fd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
vllm/model_executor/layers/layernorm.py
vllm/model_executor/layers/layernorm.py
+33
-33
No files found.
vllm/model_executor/layers/layernorm.py
View file @
424fa81f
...
@@ -148,7 +148,7 @@ class RMSNorm(CustomOp):
...
@@ -148,7 +148,7 @@ class RMSNorm(CustomOp):
@
staticmethod
@
staticmethod
def
forward_static
(
def
forward_static
(
self
,
#
self,
x
:
torch
.
Tensor
,
x
:
torch
.
Tensor
,
variance_epsilon
:
float
,
variance_epsilon
:
float
,
hidden_size
:
int
,
hidden_size
:
int
,
...
@@ -158,9 +158,9 @@ class RMSNorm(CustomOp):
...
@@ -158,9 +158,9 @@ class RMSNorm(CustomOp):
variance_size_override
:
int
|
None
=
None
,
variance_size_override
:
int
|
None
=
None
,
)
->
torch
.
Tensor
|
tuple
[
torch
.
Tensor
,
torch
.
Tensor
]:
)
->
torch
.
Tensor
|
tuple
[
torch
.
Tensor
,
torch
.
Tensor
]:
"""PyTorch-native implementation equivalent to forward()."""
"""PyTorch-native implementation equivalent to forward()."""
if
not
torch
.
compiler
.
is_compiling
()
and
envs
.
VLLM_USE_OPT_OP
:
#
if not torch.compiler.is_compiling() and envs.VLLM_USE_OPT_OP:
return
self
.
forward_cuda
(
x
,
residual
)
#
return self.forward_cuda(x, residual)
else
:
#
else:
orig_dtype
=
x
.
dtype
orig_dtype
=
x
.
dtype
x
=
x
.
to
(
torch
.
float32
)
x
=
x
.
to
(
torch
.
float32
)
if
residual
is
not
None
:
if
residual
is
not
None
:
...
...
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