refactor : 移除 LocalStrategy._clear_env 冗余清理
- setup_parallel 已覆盖所有环境变量写入,无需前置清空
This commit is contained in:
parent
9b416c1bbb
commit
0422d6d38e
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue