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
2350c778
Commit
2350c778
authored
Mar 12, 2026
by
wujl5
Committed by
wangmin6
Mar 12, 2026
Browse files
perf: DS V2模型MLA中增加rmsQuant
parent
3824b261
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
vllm/model_executor/layers/layernorm.py
vllm/model_executor/layers/layernorm.py
+0
-3
vllm/model_executor/layers/mla.py
vllm/model_executor/layers/mla.py
+10
-2
vllm/model_executor/models/deepseek_v2.py
vllm/model_executor/models/deepseek_v2.py
+4
-1
No files found.
vllm/model_executor/layers/layernorm.py
View file @
2350c778
...
...
@@ -379,9 +379,6 @@ def fused_rmsquant_fake(
dtype
=
torch
.
float32
)
return
output
,
scales
# from torch.library import Library
# customer_lib = Library("customer_", "FRAGMENT")
direct_register_custom_op
(
op_name
=
"fused_rmsquant_customer_impl"
,
op_func
=
fused_rmsquant_impl
,
...
...
vllm/model_executor/layers/mla.py
View file @
2350c778
...
...
@@ -139,6 +139,14 @@ class MultiHeadLatentAttentionWrapper(PluggableLayer):
[
self
.
q_lora_rank
,
self
.
kv_lora_rank
+
self
.
qk_rope_head_dim
],
dim
=-
1
,
)
if
envs
.
USE_FUSED_RMS_QUANT
:
qa_iq
,
qa_is
,
_
=
self
.
q_a_layernorm
(
x
=
q_c
,
residual
=
None
,
quant_dtype
=
torch
.
int8
,
update_input
=
False
)
q
=
self
.
q_b_proj
(
q_c
,
iqis
=
(
qa_iq
,
qa_is
))[
0
]
else
:
q_c
=
self
.
q_a_layernorm
(
q_c
)
q
=
self
.
q_b_proj
(
q_c
)[
0
]
else
:
...
...
vllm/model_executor/models/deepseek_v2.py
View file @
2350c778
...
...
@@ -811,6 +811,9 @@ class DeepseekV2MLAAttention(nn.Module):
)
if
self
.
q_lora_rank
is
not
None
:
if
envs
.
USE_FUSED_RMS_QUANT
:
self
.
q_a_layernorm
=
FusedRMSNormQuant
(
self
.
q_lora_rank
,
eps
=
config
.
rms_norm_eps
)
else
:
self
.
q_a_layernorm
=
RMSNorm
(
self
.
q_lora_rank
,
eps
=
config
.
rms_norm_eps
)
self
.
q_b_proj
=
ColumnParallelLinear
(
self
.
q_lora_rank
,
...
...
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