-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix blocks number calculation for Flat PA #269
Fix blocks number calculation for Flat PA #269
Conversation
vllm/worker/habana_model_runner.py
Outdated
if len(block_table) == 0: | ||
block_number = 0 | ||
block_table = [] | ||
else: | ||
block_number = block_table[position // self.block_size] | ||
if block_number == _PAD_BLOCK_ID: | ||
slot = next(dummy_slots) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please combine those two if statements. Something like:
if len(block_table) == 0:
block_number = _PAD_BLOCK_ID
block_table = []
slot = next(dummy_slots)
else:
block_number = block_table[position // self.block_size]
block_offset = position % self.block_size
slot = block_number * self.block_size + block_offset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
seq_group_metadata_list.extend( this piece of code introduces metadata certation in loop, and observe 10% perf drop. is this code change intentional? |
Fix blocks number calculation for Flat PA via adding empty table_block (HabanaAI#158)
Fix blocks number calculation for Flat PA via adding empty table_block (HabanaAI#158)
`` @hlin99 Thanks. Please re-check perf with #301 Unfortunately, performance has not improved, and the data looks identical before and after applying the patch. It seems that dummy creation and list extension are not the root cause of the performance drop. Instead, the issue appears to stem from changes to the dummy metadata, which are affecting subsequent calling path changes. |
Fix blocks number calculation for Flat PA via adding empty table_block (#158)