[TPU][Bugfix] Use XLA rank for persistent cache path (#8137)

This commit is contained in:
Woosuk Kwon
2024-09-03 18:35:33 -07:00
committed by GitHub
parent d4db9f53c8
commit 61f4a93d14
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -102,8 +102,9 @@ class TPUWorker(LoraNotSupportedWorkerBase, LocalOrDistributedWorkerBase):
# NOTE(woosuk): Set per-rank cache path since different ranks
# can have slightly different XLA graphs.
world_size = self.parallel_config.world_size
rank = xr.global_ordinal()
per_rank_path = os.path.join(envs.VLLM_XLA_CACHE_PATH,
f"tp{world_size}_rank{self.rank}")
f"tp{world_size}_rank{rank}")
xr.initialize_cache(per_rank_path, readonly=False)
def load_model(self):