From 0422d6d38ea199629cea073a2a0e32dce7da2130 Mon Sep 17 00:00:00 2001 From: ViperEkura <3081035982@qq.com> Date: Tue, 2 Jun 2026 11:38:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor=20:=20=E7=A7=BB=E9=99=A4=20LocalStrate?= =?UTF-8?q?gy.=5Fclear=5Fenv=20=E5=86=97=E4=BD=99=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - setup_parallel 已覆盖所有环境变量写入,无需前置清空 --- astrai/parallel/setup.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/astrai/parallel/setup.py b/astrai/parallel/setup.py index df792f2..2f25f24 100644 --- a/astrai/parallel/setup.py +++ b/astrai/parallel/setup.py @@ -164,20 +164,7 @@ class TorchrunStrategy(LaunchStrategy): class LocalStrategy(LaunchStrategy): """Local launcher — single-process or mp.start_processes.""" - def _clear_env(self): - for key in ( - "MASTER_ADDR", - "MASTER_PORT", - "RANK", - "WORLD_SIZE", - "LOCAL_RANK", - "LOCAL_DEVICE", - ): - os.environ.pop(key, None) - def launch(self, func: Callable, **kwargs): - self._clear_env() - args = ( self.world_size, self.backend,