Skip to content

Commit 5e44f20

Browse files
authored
run par as an entrypoint if there is no patch or jetter patch.
Differential Revision: D66621649 Pull Request resolved: #994
1 parent ff22758 commit 5e44f20

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

torchx/schedulers/local_scheduler.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,12 +696,11 @@ def _popen(
696696
log.debug(f"Running {role_name} (replica {replica_id}):\n {args_pfmt}")
697697
env = self._get_replica_env(replica_params)
698698

699-
proc = subprocess.Popen(
699+
proc = self.run_local_job(
700700
args=replica_params.args,
701701
env=env,
702702
stdout=stdout_,
703703
stderr=stderr_,
704-
start_new_session=True,
705704
cwd=replica_params.cwd,
706705
)
707706
return _LocalReplica(
@@ -714,6 +713,23 @@ def _popen(
714713
error_file=env.get("TORCHELASTIC_ERROR_FILE", "<N/A>"),
715714
)
716715

716+
def run_local_job(
717+
self,
718+
args: List[str],
719+
env: Dict[str, str],
720+
stdout: Optional[io.FileIO],
721+
stderr: Optional[io.FileIO],
722+
cwd: Optional[str] = None,
723+
) -> "subprocess.Popen[bytes]":
724+
return subprocess.Popen(
725+
args=args,
726+
env=env,
727+
stdout=stdout,
728+
stderr=stderr,
729+
start_new_session=True,
730+
cwd=cwd,
731+
)
732+
717733
def _get_replica_output_handles(
718734
self,
719735
replica_params: ReplicaParam,

0 commit comments

Comments
 (0)