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
3912d41c
Commit
3912d41c
authored
Nov 13, 2025
by
zhuwenwen
Browse files
replace triton_ of rms and act_and_mul
parent
613edd7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
vllm/model_executor/layers/activation.py
vllm/model_executor/layers/activation.py
+2
-0
vllm/model_executor/layers/layernorm.py
vllm/model_executor/layers/layernorm.py
+2
-0
No files found.
vllm/model_executor/layers/activation.py
View file @
3912d41c
...
@@ -77,6 +77,8 @@ class SiluAndMul(CustomOp):
...
@@ -77,6 +77,8 @@ class SiluAndMul(CustomOp):
"""PyTorch-native implementation equivalent to forward()."""
"""PyTorch-native implementation equivalent to forward()."""
if
not
torch
.
compiler
.
is_compiling
()
and
envs
.
VLLM_ENABLE_TBO
:
if
not
torch
.
compiler
.
is_compiling
()
and
envs
.
VLLM_ENABLE_TBO
:
return
self
.
forward_cuda
(
x
)
return
self
.
forward_cuda
(
x
)
elif
not
torch
.
compiler
.
is_compiling
()
and
envs
.
VLLM_USE_OPT_OP
:
return
self
.
forward_cuda
(
x
)
else
:
else
:
d
=
x
.
shape
[
-
1
]
//
2
d
=
x
.
shape
[
-
1
]
//
2
return
F
.
silu
(
x
[...,
:
d
])
*
x
[...,
d
:]
return
F
.
silu
(
x
[...,
:
d
])
*
x
[...,
d
:]
...
...
vllm/model_executor/layers/layernorm.py
View file @
3912d41c
...
@@ -168,6 +168,8 @@ class RMSNorm(CustomOp):
...
@@ -168,6 +168,8 @@ class RMSNorm(CustomOp):
if
not
torch
.
compiler
.
is_compiling
()
and
envs
.
VLLM_ENABLE_TBO
:
if
not
torch
.
compiler
.
is_compiling
()
and
envs
.
VLLM_ENABLE_TBO
:
return
self
.
forward_cuda
(
x
,
residual
)
return
self
.
forward_cuda
(
x
,
residual
)
elif
not
torch
.
compiler
.
is_compiling
()
and
envs
.
VLLM_USE_OPT_OP
:
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
)
...
...
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