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
f54639f9
Commit
f54639f9
authored
Aug 05, 2025
by
zhuwenwen
Browse files
when using VLLM_FLASH_ATTN_V1, set block_size to 64
parent
33d6c159
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
vllm/attention/layer.py
vllm/attention/layer.py
+2
-2
vllm/config.py
vllm/config.py
+1
-1
No files found.
vllm/attention/layer.py
View file @
f54639f9
...
@@ -103,7 +103,7 @@ class Attention(nn.Module):
...
@@ -103,7 +103,7 @@ class Attention(nn.Module):
calculate_kv_scales
=
cache_config
.
calculate_kv_scales
calculate_kv_scales
=
cache_config
.
calculate_kv_scales
else
:
else
:
kv_cache_dtype
=
"auto"
kv_cache_dtype
=
"auto"
block_size
=
16
if
not
envs
.
VLLM_USE_FLASH_ATTN_PA
else
64
block_size
=
16
if
not
envs
.
VLLM_USE_FLASH_ATTN_PA
or
not
envs
.
VLLM_FLASH_ATTN_V1
else
64
is_attention_free
=
False
is_attention_free
=
False
calculate_kv_scales
=
False
calculate_kv_scales
=
False
if
num_kv_heads
is
None
:
if
num_kv_heads
is
None
:
...
@@ -335,7 +335,7 @@ class MultiHeadAttention(nn.Module):
...
@@ -335,7 +335,7 @@ class MultiHeadAttention(nn.Module):
attn_backend
=
get_attn_backend
(
head_size
,
attn_backend
=
get_attn_backend
(
head_size
,
dtype
,
dtype
,
kv_cache_dtype
=
None
,
kv_cache_dtype
=
None
,
block_size
=
16
if
not
envs
.
VLLM_USE_FLASH_ATTN_PA
else
64
,
block_size
=
16
if
not
envs
.
VLLM_USE_FLASH_ATTN_PA
or
not
envs
.
VLLM_FLASH_ATTN_V1
else
64
,
is_attention_free
=
False
)
is_attention_free
=
False
)
backend
=
backend_name_to_enum
(
attn_backend
.
get_name
())
backend
=
backend_name_to_enum
(
attn_backend
.
get_name
())
if
current_platform
.
is_rocm
():
if
current_platform
.
is_rocm
():
...
...
vllm/config.py
View file @
f54639f9
...
@@ -1630,7 +1630,7 @@ PrefixCachingHashAlgo = Literal["builtin", "sha256", "sha256_cbor_64bit"]
...
@@ -1630,7 +1630,7 @@ PrefixCachingHashAlgo = Literal["builtin", "sha256", "sha256_cbor_64bit"]
class
CacheConfig
:
class
CacheConfig
:
"""Configuration for the KV cache."""
"""Configuration for the KV cache."""
block_size
:
BlockSize
=
16
if
not
envs
.
VLLM_USE_FLASH_ATTN_PA
else
64
# type: ignore
block_size
:
BlockSize
=
16
if
not
envs
.
VLLM_USE_FLASH_ATTN_PA
or
not
envs
.
VLLM_FLASH_ATTN_V1
else
64
# type: ignore
"""Size of a contiguous cache block in number of tokens. This is ignored on
"""Size of a contiguous cache block in number of tokens. This is ignored on
neuron devices and set to `--max-model-len`. On CUDA devices, only block
neuron devices and set to `--max-model-len`. On CUDA devices, only block
sizes up to 32 are supported. On HPU devices, block size defaults to 128.
sizes up to 32 are supported. On HPU devices, block size defaults to 128.
...
...
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