From f6c9036b5efc59f2ca64e889ddacd89cc5c41cdc Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 23 May 2024 13:23:33 +0000 Subject: [PATCH] Use absolute paths for executables --- milabench/commands/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/milabench/commands/__init__.py b/milabench/commands/__init__.py index 9fe9ae7b2..45b481a66 100644 --- a/milabench/commands/__init__.py +++ b/milabench/commands/__init__.py @@ -448,7 +448,11 @@ def _argv(self, **kwargs) -> List: class TorchRunCommand(WrapperCommand): def __init__(self, executor: SingleCmdCommand, *torchrun_argv, **kwargs) -> None: - super().__init__(executor, "torchrun", *torchrun_argv, **kwargs) + # Some vendors force us to have weird venv that can resolve weirdly + # use absolute paths to avoid issues + + binfolder = executor.pack.config['dirs']['venv'] + super().__init__(executor, f"{binfolder}/bin/torchrun", *torchrun_argv, **kwargs) def _argv(self, **kwargs): devices = self.pack.config.get("devices", []) @@ -474,7 +478,10 @@ class VoirCommand(WrapperCommand): """ def __init__(self, executor: SingleCmdCommand, *voir_argv, **kwargs) -> None: - super().__init__(executor, "voir", **{"setsid": True, **kwargs}) + # Some vendors force us to have weird venv that can resolve weirdly + # use absolute paths to avoid issues + binfolder = executor.pack.config['dirs']['venv'] + super().__init__(executor, f"{binfolder}/bin/voir", **{"setsid": True, **kwargs}) self.voir_argv = voir_argv def _argv(self, **kwargs) -> List: