[HICache]: Support 3FS-Store with page_first_direct layout (#11460)

This commit is contained in:
hzh0425
2025-10-13 15:47:22 +08:00
committed by GitHub
parent 6806c4e63e
commit 318424e2c8
4 changed files with 15 additions and 6 deletions

View File

@@ -170,7 +170,7 @@ class StorageBackendFactory:
return backend
elif backend_name == "hf3fs":
# Calculate bytes_per_page based on memory pool layout
if mem_pool_host.layout == "page_first":
if mem_pool_host.layout in ["page_first", "page_first_direct"]:
bytes_per_page = (
mem_pool_host.get_ksize_per_token() * mem_pool_host.page_size
)

View File

@@ -501,8 +501,12 @@ class HiCacheHF3FS(HiCacheStorage):
def register_mem_pool_host(self, mem_pool_host: HostKVCache):
super().register_mem_pool_host(mem_pool_host)
self.is_zero_copy = self.mem_pool_host.layout == "page_first"
logger.info(f"{self.is_zero_copy=}")
self.is_zero_copy = self.mem_pool_host.layout in [
"page_first",
"page_first_direct",
]
logger.info(f"{self.is_zero_copy=}, layout={self.mem_pool_host.layout}")
def _get_mha_zero_copy_keys(self, keys: List[str]) -> List[str]:
_keys = []