mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-26 12:32:10 +00:00
More logs in the allocator.
This commit is contained in:
parent
065aabb13d
commit
7ef8b89ee7
@ -57,13 +57,18 @@ impl RadixAllocator {
|
||||
// temporary, the trie needs to be able to report whether it can
|
||||
// allocate the requested amount. Just not implemented yet.
|
||||
tracing::debug!(
|
||||
"Free blocks {} need {n_blocks_needed}",
|
||||
"Free blocks {} need {n_blocks_needed}",
|
||||
self.free_blocks.len()
|
||||
);
|
||||
self.free_blocks.extend(
|
||||
self.cache_blocks
|
||||
.evict(n_blocks_needed - self.free_blocks.len()),
|
||||
let free_blocks = self
|
||||
.cache_blocks
|
||||
.evict(n_blocks_needed - self.free_blocks.len());
|
||||
tracing::debug!(
|
||||
"Freed {} blocks: Now having {} free blocks",
|
||||
free_blocks.len(),
|
||||
free_blocks.len() + self.free_blocks.len()
|
||||
);
|
||||
self.free_blocks.extend(free_blocks);
|
||||
}
|
||||
|
||||
if self.free_blocks.len() >= n_blocks_needed {
|
||||
@ -106,6 +111,9 @@ impl Allocator for RadixAllocator {
|
||||
let suffix_blocks = suffix_len.div_ceil(self.block_size);
|
||||
|
||||
tracing::info!("Prefix {prefix_len} - Suffix {suffix_len}");
|
||||
metrics::counter!("tgi_cache_hit", "allocator" => "radix")
|
||||
.increment(prefix_len.try_into().expect("Can convert usize to u64"));
|
||||
metrics::counter!("tgi_cache_total", "allocator" => "radix").increment(suffix_len.into());
|
||||
|
||||
match self.alloc_or_reclaim(suffix_blocks as usize) {
|
||||
Some(suffix_blocks) => blocks.extend(suffix_blocks),
|
||||
|
Loading…
Reference in New Issue
Block a user