Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions torchx/schedulers/local_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,12 +696,11 @@ def _popen(
log.debug(f"Running {role_name} (replica {replica_id}):\n {args_pfmt}")
env = self._get_replica_env(replica_params)

proc = subprocess.Popen(
proc = self.run_local_job(
args=replica_params.args,
env=env,
stdout=stdout_,
stderr=stderr_,
start_new_session=True,
cwd=replica_params.cwd,
)
return _LocalReplica(
Expand All @@ -714,6 +713,23 @@ def _popen(
error_file=env.get("TORCHELASTIC_ERROR_FILE", "<N/A>"),
)

def run_local_job(
self,
args: List[str],
env: Dict[str, str],
stdout: Optional[io.FileIO],
stderr: Optional[io.FileIO],
cwd: Optional[str] = None,
) -> "subprocess.Popen[bytes]":
return subprocess.Popen(
args=args,
env=env,
stdout=stdout,
stderr=stderr,
start_new_session=True,
cwd=cwd,
)

def _get_replica_output_handles(
self,
replica_params: ReplicaParam,
Expand Down
Loading