fix: handle empty HiCache match prefixes
This commit is contained in:
@@ -1521,6 +1521,14 @@ class HiRadixCache(RadixCache):
|
||||
page_aligned_len = len(key) // self.page_size * self.page_size
|
||||
key = key[:page_aligned_len]
|
||||
|
||||
if len(key) == 0:
|
||||
return MatchResult(
|
||||
device_indices=empty_value,
|
||||
last_device_node=self.root_node,
|
||||
last_host_node=self.root_node,
|
||||
host_hit_length=0,
|
||||
)
|
||||
|
||||
value, last_node = self._match_prefix_helper(self.root_node, key)
|
||||
if value:
|
||||
value = torch.cat(value)
|
||||
|
||||
Reference in New Issue
Block a user