Skip to content

Commit 77170da

Browse files
author
none
committed
fix
1 parent 59081be commit 77170da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightllm/common/triton_utils/autotuner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def _autotune(self, args, kwargs, static_key, run_key):
185185
f"Autotuning {self.kernel_name} [rank:{rank_id}] for {run_key}, best_time: {best_time:.5f}"
186186
)
187187

188-
world_size = dist.get_world_size() if dist.is_initialized() else 1
188+
world_size = get_global_world_size()
189189
if world_size > 1:
190190
local_best = torch.tensor([best_time], device="cuda")
191191
all_best_times = [torch.zeros_like(local_best) for _ in range(world_size)]
@@ -201,7 +201,7 @@ def _autotune(self, args, kwargs, static_key, run_key):
201201
self.cached_configs[static_key][run_key] = _best_config
202202

203203
# save configs to file
204-
if not dist.is_initialized() or get_global_rank() == 0:
204+
if get_global_rank() == 0:
205205
cache_file = os.path.join(self.cache_dir, KernelConfigs.get_config_file_name(static_key))
206206
with open(cache_file, "wb") as f:
207207
f.write(

0 commit comments

Comments
 (0)