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
ee93cb70
Commit
ee93cb70
authored
Dec 18, 2025
by
zhuwenwen
Browse files
update self._q_scale
parent
06106338
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
vllm/attention/layer.py
vllm/attention/layer.py
+2
-1
No files found.
vllm/attention/layer.py
View file @
ee93cb70
...
...
@@ -101,12 +101,13 @@ class Attention(nn.Module):
if
torch
.
cuda
.
get_device_properties
(
"cuda"
).
gcnArchName
.
split
(
':'
)[
0
]
==
"gfx938"
and
kv_cache_dtype
==
"fp8_e4m3"
and
envs
.
VLLM_USE_FLASH_MLA_FP8
:
self
.
_k_scale
=
torch
.
ones
((
1
),
dtype
=
torch
.
float32
)
self
.
_v_scale
=
torch
.
ones
((
1
),
dtype
=
torch
.
float32
)
self
.
_q_scale
=
torch
.
ones
((
1
),
dtype
=
torch
.
float32
)
else
:
self
.
_k_scale
=
torch
.
tensor
(
1.0
,
dtype
=
torch
.
float32
)
self
.
_v_scale
=
torch
.
tensor
(
1.0
,
dtype
=
torch
.
float32
)
self
.
_q_scale
=
torch
.
tensor
(
1.0
,
dtype
=
torch
.
float32
)
# FlashAttn doesn't support quantizing the kv-cache only
# but requires q to be quantized as well.
self
.
_q_scale
=
torch
.
tensor
(
1.0
,
dtype
=
torch
.
float32
)
self
.
_prob_scale
=
torch
.
tensor
(
1.0
,
dtype
=
torch
.
float32
)
# We also keep the float32 versions of k/v_scale for attention
...
...
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