Skip to content

Commit

Permalink
Use absolute paths for executables
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed May 23, 2024
1 parent f1e51ea commit f6c9036
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions milabench/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", [])
Expand All @@ -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:
Expand Down

0 comments on commit f6c9036

Please sign in to comment.