Fix CPP Radix Cache and add test to CI (#11645)
This commit is contained in:
@@ -167,7 +167,7 @@ class RadixCacheCpp(BasePrefixCache):
|
||||
token_ids = (req.origin_input_ids + req.output_ids)[:kv_committed_len]
|
||||
kv_indices = self.req_to_token_pool.req_to_token[
|
||||
req.req_pool_idx, :kv_committed_len
|
||||
]
|
||||
].to(dtype=torch.int64, copy=True)
|
||||
|
||||
# NOTE: our C++ implementation don't need `token_ids` and `kv_indices` to be page-aligned
|
||||
# it will automatically align them, but length of them should be equal
|
||||
@@ -204,7 +204,9 @@ class RadixCacheCpp(BasePrefixCache):
|
||||
assert req.req_pool_idx is not None
|
||||
token_ids = req.fill_ids
|
||||
prefill_len = len(token_ids) # prefill only (maybe chunked)
|
||||
kv_indices = self.req_to_token_pool.req_to_token[req.req_pool_idx, :prefill_len]
|
||||
kv_indices = self.req_to_token_pool.req_to_token[
|
||||
req.req_pool_idx, :prefill_len
|
||||
].to(dtype=torch.int64, copy=True)
|
||||
|
||||
# NOTE: our C++ implementation don't need `token_ids` and `kv_indices` to be page-aligned
|
||||
# it will automatically align them, but length of them should be equal
|
||||
|
||||
Reference in New Issue
Block a user