mirror of
https://github.com/NVIDIA/TensorRT-LLM.git
synced 2026-02-04 02:02:01 +08:00
[None][fix] Fix tmp dir being deleted too early in unit test. (#10740)
Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
This commit is contained in:
parent
56073f501a
commit
3d16daf696
@ -738,6 +738,8 @@ def _distributed_worker_function(world_size, strategy):
|
||||
runner = DistributedGemmRunner(prefer_tactics=prefer_tactics)
|
||||
config = TuningConfig(distributed_tuning_strategy=strategy)
|
||||
|
||||
# Keep temp_dir in function scope to prevent premature garbage collection
|
||||
temp_dir = None
|
||||
if rank == 0:
|
||||
temp_dir = tempfile.TemporaryDirectory()
|
||||
# rank 0 should broadcast the cache path to all ranks
|
||||
@ -782,6 +784,7 @@ def _distributed_worker_function(world_size, strategy):
|
||||
else:
|
||||
assert False, f"Unknown strategy: {strategy}"
|
||||
|
||||
dist.barrier()
|
||||
return True
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user