Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,13 @@ impl Slot for VllmConnectorSlot {
.sequence()
.blocks()
.iter()
.skip(num_computed_blocks)
.map(|b| b.sequence_hash())
.collect::<Vec<_>>();

tracing::debug!("matching against {} block hashes", sequence_hashes.len());
// we start matching non-device blocks after the device blocks
let search_offset = num_computed_blocks;

tracing::debug!("matching against {} block hashes", sequence_hashes[search_offset..].len());

// we should do this opportunistically after this operation is done
// ideally it was triggered by the match_sequence_hashes_blocking calls directly
Expand All @@ -527,9 +529,6 @@ impl Slot for VllmConnectorSlot {
// disk.touch_blocks_blocking(&sequence_hashes)?;
// }

// we start matching non-device blocks after the device blocks
let search_offset = num_computed_blocks;

let mut host_blocks = self
.block_manager
.host()
Expand Down Expand Up @@ -568,6 +567,11 @@ impl Slot for VllmConnectorSlot {
return Ok(());
}

// early exit if we need to onboard 0 blocks
if (num_computed_blocks + num_matched_blocks) * block_size == self.sequence().total_tokens() {
return Ok(());
}

let mut num_new_matched_tokens = num_matched_blocks * block_size;

// we are on a block boundary, so we need to throw away the last block
Expand Down
Loading