[KV Offload] Make compact secondary identity TP-independent (#49858)

Signed-off-by: Change72 <changg@nvidia.com>
Co-authored-by: GPT-5.6 Sol <noreply@openai.com>
Co-authored-by: Or Ozeri <oro@il.ibm.com>
This commit is contained in:
Chang Guo
2026-07-28 07:10:20 +03:00
committed by GitHub
co-authored by GPT-5.6 Sol Or Ozeri
parent fbb1ef6803
commit a8f296083f
4 changed files with 226 additions and 11 deletions
+10 -1
View File
@@ -35,6 +35,7 @@ class FileMapper:
kv_cache_groups: list[dict] | None = None,
inference_engine: str = "vllm",
parallel_agnostic: bool = False,
replicated_layout: bool = False,
):
"""
Initialize the file mapper. Each worker constructs its own, but
@@ -60,6 +61,10 @@ class FileMapper:
}
if not parallel_agnostic:
self.fields["parallel_agnostic"] = False
# Only written when True so existing deployments' hashed fields are
# unchanged (False is the historical default and must not appear).
if replicated_layout:
self.fields["replicated_layout"] = True
self.base_path: str = self._compute_base_path(root_dir, self.fields)
@classmethod
@@ -92,7 +97,11 @@ class FileMapper:
rank=parallel.rank,
dtype=config.model.dtype,
kv_cache_groups=kv_cache_groups,
parallel_agnostic=(parallel_agnostic and parallel.is_parallelism_agnostic),
parallel_agnostic=(
parallel_agnostic
and (parallel.is_parallelism_agnostic or config.replicated_layout)
),
replicated_layout=(parallel_agnostic and config.replicated_layout),
)
def get_file_name(self, key: OffloadKey) -> str: