[Bug Fix][HiCache] TreeNode.get_prefix_hash_values @lru_cache can return mutated list (#26177)
Co-authored-by: Zhangheng <hzh0425@apache.org>
This commit is contained in:
@@ -22,7 +22,6 @@ The radix tree data structure for managing the hybrid (full and Mamba) KV cache.
|
||||
import heapq
|
||||
from array import array
|
||||
from collections import defaultdict
|
||||
from functools import lru_cache
|
||||
from typing import TYPE_CHECKING, List, Optional, Tuple
|
||||
|
||||
import torch
|
||||
@@ -148,7 +147,6 @@ class TreeNode:
|
||||
return None
|
||||
return self.hash_value[-1]
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def get_prefix_hash_values(self, node: "TreeNode") -> List[str]:
|
||||
if node is None or node.hash_value is None:
|
||||
return []
|
||||
|
||||
@@ -28,7 +28,6 @@ import sys
|
||||
import time
|
||||
from array import array
|
||||
from collections import defaultdict
|
||||
from functools import lru_cache
|
||||
from typing import TYPE_CHECKING, Any, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
import torch
|
||||
@@ -258,7 +257,6 @@ class TreeNode:
|
||||
return None
|
||||
return self.hash_value[-1]
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def get_prefix_hash_values(self, node: TreeNode) -> List[str]:
|
||||
if node is None or node.hash_value is None:
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user