Skip to content

Commit

Permalink
Update habana_model_runner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kzawora-intel authored Aug 14, 2024
1 parent b03ef68 commit 9ade5a7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions vllm/worker/habana_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,26 @@ def warmup_range_with_limit(config: Tuple[int, int, int, int], fill=True):
# base = (bmax/bmin) ** (1/(num_buckets-1))
# exponent = i
# power = base ** exponent

# power_unpadded = [bmin*base^0(=bmin), bmin*base^1, bmin*base^2, ..., bmin*base^9(=bmax)]
# power_unpadded = [128.00, 174.18, 237.02, 322.54, 438.91, 597.26, 812.75, 1105.98, 1505.01, 2048.00]

# if fill is False:
# power_padded = [ 128, 256, 256, 384, 512, 640, 896, 1152, 1536, 2048]
# ^_______^
# duplicates
#

# if step is False:
# buckets = [ 128, 256, 384, 512, 640, 896, 1152, 1536, 2048]
# ^
# duplicate removed

# if step is True:
# if fill is True:
# is_duplicated = [ False, False, True, True, True, True, False, False, False, False]
# ^_______^_______^
# these become duplicates once previous duplicates are resolved

# buckets = [ 128, 256, 384, 512, 640, 768, 896, 1152, 1536, 2048]
# ^_______^_______^_______^
# closest unused buckets selected

bmin, bstep, bmax, num_buckets = bucket_config
linear_buckets = set(np.arange(bmin, bmax+1, step=bstep))
assert num_buckets > 0, "num_buckets must be a positive integer"
Expand Down

0 comments on commit 9ade5a7

Please sign in to comment.