[Bugfix][V1] Free out-of-window blocks on the processed-token basis under async scheduling (#47728)
Signed-off-by: Saddss <28726669061@qq.com> Signed-off-by: Nick Hill <nickhill123@gmail.com> Signed-off-by: Yifan Qiao <yifanqiao@inferact.ai> Co-authored-by: Yifan Qiao <yifanqiao@inferact.ai> Co-authored-by: Saddss <28726669061@qq.com> Co-authored-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
co-authored by
Yifan Qiao
Saddss
Nick Hill
parent
934eeaecfb
commit
cd0de48d08
@@ -501,6 +501,17 @@ class VllmConfig:
|
||||
return 2
|
||||
return pp_size
|
||||
|
||||
@property
|
||||
def max_in_flight_tokens(self) -> int:
|
||||
# Upper bound on tokens that are scheduled but not yet settled (freed):
|
||||
# every concurrent batch may hold up to a full `max_num_batched_tokens`.
|
||||
# Recycling-aware KV cache specs (sliding-window, chunked-local) reserve
|
||||
# for this because out-of-window blocks are freed on the processed-token
|
||||
# basis, so in-flight steps transiently keep their blocks.
|
||||
return (
|
||||
self.max_concurrent_batches * self.scheduler_config.max_num_batched_tokens
|
||||
)
|
||||
|
||||
@property
|
||||
def num_speculative_tokens(self) -> int:
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user