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
606b00e8
Unverified
Commit
606b00e8
authored
Oct 10, 2025
by
Chen Zhang
Committed by
GitHub
Oct 10, 2025
Browse files
[bugfix][DCP] fix block_size of hash in DCP prefix caching (#26296)
Signed-off-by:
Chen Zhang
<
zhangch99@outlook.com
>
parent
720d3cd0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
10 deletions
+12
-10
tests/v1/core/test_scheduler.py
tests/v1/core/test_scheduler.py
+1
-0
tests/v1/core/utils.py
tests/v1/core/utils.py
+1
-0
tests/v1/kv_connector/unit/utils.py
tests/v1/kv_connector/unit/utils.py
+1
-0
vllm/v1/core/sched/scheduler.py
vllm/v1/core/sched/scheduler.py
+2
-8
vllm/v1/engine/core.py
vllm/v1/engine/core.py
+7
-2
No files found.
tests/v1/core/test_scheduler.py
View file @
606b00e8
...
...
@@ -1411,6 +1411,7 @@ def create_scheduler_with_priority(
kv_cache_config
=
kv_cache_config
,
log_stats
=
True
,
structured_output_manager
=
StructuredOutputManager
(
vllm_config
),
block_size
=
block_size
,
)
...
...
tests/v1/core/utils.py
View file @
606b00e8
...
...
@@ -129,6 +129,7 @@ def create_scheduler(
return
scheduler_cls
(
vllm_config
=
vllm_config
,
kv_cache_config
=
kv_cache_config
,
block_size
=
block_size
,
log_stats
=
True
,
structured_output_manager
=
StructuredOutputManager
(
vllm_config
),
)
...
...
tests/v1/kv_connector/unit/utils.py
View file @
606b00e8
...
...
@@ -138,6 +138,7 @@ def create_scheduler(
kv_cache_config
=
kv_cache_config
,
log_stats
=
True
,
structured_output_manager
=
StructuredOutputManager
(
vllm_config
),
block_size
=
block_size
,
)
...
...
vllm/v1/core/sched/scheduler.py
View file @
606b00e8
...
...
@@ -45,6 +45,7 @@ class Scheduler(SchedulerInterface):
vllm_config
:
VllmConfig
,
kv_cache_config
:
KVCacheConfig
,
structured_output_manager
:
StructuredOutputManager
,
block_size
:
int
,
mm_registry
:
MultiModalRegistry
=
MULTIMODAL_REGISTRY
,
include_finished_set
:
bool
=
False
,
log_stats
:
bool
=
False
,
...
...
@@ -101,15 +102,8 @@ class Scheduler(SchedulerInterface):
num_gpu_blocks
=
self
.
cache_config
.
num_gpu_blocks
assert
num_gpu_blocks
is
not
None
and
num_gpu_blocks
>
0
self
.
block_size
=
self
.
cache_config
.
block_size
self
.
block_size
=
block_size
self
.
dcp_world_size
=
vllm_config
.
parallel_config
.
decode_context_parallel_size
# Note(hc): The scheduler’s block_size must be multiplied
# by dcp_world_size, since block hashes are computed on the
# original full token sequence at a granularity of
# original_block_size × dcp_world_size.
if
self
.
dcp_world_size
>
1
:
self
.
block_size
*=
self
.
dcp_world_size
# req_id -> Request
self
.
requests
:
dict
[
str
,
Request
]
=
{}
...
...
vllm/v1/engine/core.py
View file @
606b00e8
...
...
@@ -142,12 +142,18 @@ class EngineCore:
logger
.
info
(
"Disabling chunked prefill for model without KVCache"
)
vllm_config
.
scheduler_config
.
chunked_prefill_enabled
=
False
scheduler_block_size
=
(
vllm_config
.
cache_config
.
block_size
*
vllm_config
.
parallel_config
.
decode_context_parallel_size
)
self
.
scheduler
:
SchedulerInterface
=
Scheduler
(
vllm_config
=
vllm_config
,
kv_cache_config
=
kv_cache_config
,
structured_output_manager
=
self
.
structured_output_manager
,
include_finished_set
=
vllm_config
.
parallel_config
.
data_parallel_size
>
1
,
log_stats
=
self
.
log_stats
,
block_size
=
scheduler_block_size
,
)
self
.
use_spec_decode
=
vllm_config
.
speculative_config
is
not
None
if
self
.
scheduler
.
connector
is
not
None
:
# type: ignore
...
...
@@ -177,14 +183,13 @@ class EngineCore:
self
.
vllm_config
.
cache_config
.
enable_prefix_caching
or
self
.
scheduler
.
get_kv_connector
()
is
not
None
):
block_size
=
vllm_config
.
cache_config
.
block_size
caching_hash_fn
=
get_hash_fn_by_name
(
vllm_config
.
cache_config
.
prefix_caching_hash_algo
)
init_none_hash
(
caching_hash_fn
)
self
.
request_block_hasher
=
get_request_block_hasher
(
block_size
,
caching_hash_fn
scheduler_
block_size
,
caching_hash_fn
)
self
.
step_fn
=
(
...
...
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