Skip to content

Commit

Permalink
run par as an entrypoint if there is no patch or jetter patch.
Browse files Browse the repository at this point in the history
Differential Revision: D66621649

Pull Request resolved: #994
  • Loading branch information
yikaiMeta authored Dec 18, 2024
1 parent ff22758 commit 5e44f20
Showing 1 changed file with 18 additions and 2 deletions.
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

0 comments on commit 5e44f20

Please sign in to comment.