Skip to content

Commit 956b543

Browse files
committed
refine code
1 parent 507e464 commit 956b543

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

fastdeploy/worker/gpu_model_runner.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,9 @@ def _compute_position_ids_and_slot_mapping(self) -> None:
13371337
)
13381338
block_size = self.cache_config.block_size
13391339
block_idx = position_ids // block_size # [num_tokens]
1340-
assert self.forward_meta.batch_id_per_token.shape == block_idx.shape
1340+
assert (
1341+
self.forward_meta.batch_id_per_token.shape == block_idx.shape
1342+
), f"batch_id_per_token.shape:{self.forward_meta.batch_id_per_token.shape} != block_idx.shape:{block_idx.shape}"
13411343
block_ids = self.forward_meta.block_tables[self.forward_meta.batch_id_per_token, block_idx] # [num_tokens]
13421344
block_offset = position_ids % block_size # [num_tokens]
13431345
slot_mapping = self.share_inputs["slot_mapping_buffer"][:current_total_tokens]

0 commit comments

Comments
 (0)