Skip to content

Commit 19764d0

Browse files
Cnange last bucket for decode buckets (#334)
Change last decode bucket
2 parents 80e117e + a821092 commit 19764d0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

vllm/worker/habana_model_runner.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,15 @@ def generate_prompt_buckets(bs_bucket_config,
172172
def generate_decode_buckets(bs_bucket_config, blocks_bucket_config,
173173
max_blocks):
174174
buckets = []
175-
for bs in warmup_range(bs_bucket_config):
176-
for blocks in warmup_range(blocks_bucket_config):
175+
bs_buckets = warmup_range(bs_bucket_config)
176+
block_buckets = warmup_range(blocks_bucket_config)
177+
bmin, bstep, bmax = blocks_bucket_config
178+
last_bucket = round_up(max_blocks, bstep)
179+
for bs in bs_buckets:
180+
for blocks in block_buckets:
177181
if blocks < bs:
178182
continue
179-
if blocks > max_blocks:
183+
if blocks > last_bucket:
180184
break
181185
buckets.append((bs, blocks))
182186
return list(sorted(buckets, key=lambda b: (b[0] * b[1], b[1], b[0])))

0 commit comments

Comments
 (0)