torchx-nightly 2024.12.17__py3-none-any.whl → 2024.12.19__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of torchx-nightly might be problematic. Click here for more details.
- torchx/runner/config.py +19 -2
- torchx/schedulers/__init__.py +6 -3
- torchx/schedulers/local_scheduler.py +18 -2
- torchx/util/entrypoints.py +4 -2
- {torchx_nightly-2024.12.17.dist-info → torchx_nightly-2024.12.19.dist-info}/METADATA +1 -1
- {torchx_nightly-2024.12.17.dist-info → torchx_nightly-2024.12.19.dist-info}/RECORD +10 -10
- {torchx_nightly-2024.12.17.dist-info → torchx_nightly-2024.12.19.dist-info}/LICENSE +0 -0
- {torchx_nightly-2024.12.17.dist-info → torchx_nightly-2024.12.19.dist-info}/WHEEL +0 -0
- {torchx_nightly-2024.12.17.dist-info → torchx_nightly-2024.12.19.dist-info}/entry_points.txt +0 -0
- {torchx_nightly-2024.12.17.dist-info → torchx_nightly-2024.12.19.dist-info}/top_level.txt +0 -0
torchx/runner/config.py
CHANGED
|
@@ -197,7 +197,15 @@ def _configparser() -> configparser.ConfigParser:
|
|
|
197
197
|
|
|
198
198
|
|
|
199
199
|
def _get_scheduler(name: str) -> Scheduler:
|
|
200
|
-
schedulers =
|
|
200
|
+
schedulers = {
|
|
201
|
+
**get_scheduler_factories(),
|
|
202
|
+
**(
|
|
203
|
+
get_scheduler_factories(
|
|
204
|
+
group="torchx.schedulers.orchestrator", skip_defaults=True
|
|
205
|
+
)
|
|
206
|
+
or {}
|
|
207
|
+
),
|
|
208
|
+
}
|
|
201
209
|
if name not in schedulers:
|
|
202
210
|
raise ValueError(
|
|
203
211
|
f"`{name}` is not a registered scheduler. Valid scheduler names: {schedulers.keys()}"
|
|
@@ -241,7 +249,16 @@ def dump(
|
|
|
241
249
|
if schedulers:
|
|
242
250
|
scheds = schedulers
|
|
243
251
|
else:
|
|
244
|
-
|
|
252
|
+
scheduler_factories = {
|
|
253
|
+
**get_scheduler_factories(),
|
|
254
|
+
**(
|
|
255
|
+
get_scheduler_factories(
|
|
256
|
+
group="torchx.schedulers.orchestrator", skip_defaults=True
|
|
257
|
+
)
|
|
258
|
+
or {}
|
|
259
|
+
),
|
|
260
|
+
}
|
|
261
|
+
scheds = scheduler_factories.keys()
|
|
245
262
|
|
|
246
263
|
config = _configparser()
|
|
247
264
|
for sched_name in scheds:
|
torchx/schedulers/__init__.py
CHANGED
|
@@ -42,9 +42,11 @@ def _defer_load_scheduler(path: str) -> SchedulerFactory:
|
|
|
42
42
|
return run
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
def get_scheduler_factories(
|
|
45
|
+
def get_scheduler_factories(
|
|
46
|
+
group: str = "torchx.schedulers", skip_defaults: bool = False
|
|
47
|
+
) -> Dict[str, SchedulerFactory]:
|
|
46
48
|
"""
|
|
47
|
-
get_scheduler_factories returns all the available schedulers names and the
|
|
49
|
+
get_scheduler_factories returns all the available schedulers names under `group` and the
|
|
48
50
|
method to instantiate them.
|
|
49
51
|
|
|
50
52
|
The first scheduler in the dictionary is used as the default scheduler.
|
|
@@ -55,8 +57,9 @@ def get_scheduler_factories() -> Dict[str, SchedulerFactory]:
|
|
|
55
57
|
default_schedulers[scheduler] = _defer_load_scheduler(path)
|
|
56
58
|
|
|
57
59
|
return load_group(
|
|
58
|
-
|
|
60
|
+
group,
|
|
59
61
|
default=default_schedulers,
|
|
62
|
+
skip_defaults=skip_defaults,
|
|
60
63
|
)
|
|
61
64
|
|
|
62
65
|
|
|
@@ -696,12 +696,11 @@ class LocalScheduler(Scheduler[LocalOpts]):
|
|
|
696
696
|
log.debug(f"Running {role_name} (replica {replica_id}):\n {args_pfmt}")
|
|
697
697
|
env = self._get_replica_env(replica_params)
|
|
698
698
|
|
|
699
|
-
proc =
|
|
699
|
+
proc = self.run_local_job(
|
|
700
700
|
args=replica_params.args,
|
|
701
701
|
env=env,
|
|
702
702
|
stdout=stdout_,
|
|
703
703
|
stderr=stderr_,
|
|
704
|
-
start_new_session=True,
|
|
705
704
|
cwd=replica_params.cwd,
|
|
706
705
|
)
|
|
707
706
|
return _LocalReplica(
|
|
@@ -714,6 +713,23 @@ class LocalScheduler(Scheduler[LocalOpts]):
|
|
|
714
713
|
error_file=env.get("TORCHELASTIC_ERROR_FILE", "<N/A>"),
|
|
715
714
|
)
|
|
716
715
|
|
|
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
|
+
|
|
717
733
|
def _get_replica_output_handles(
|
|
718
734
|
self,
|
|
719
735
|
replica_params: ReplicaParam,
|
torchx/util/entrypoints.py
CHANGED
|
@@ -51,8 +51,7 @@ def _defer_load_ep(ep: EntryPoint) -> object:
|
|
|
51
51
|
|
|
52
52
|
# pyre-ignore-all-errors[3, 2]
|
|
53
53
|
def load_group(
|
|
54
|
-
group: str,
|
|
55
|
-
default: Optional[Dict[str, Any]] = None,
|
|
54
|
+
group: str, default: Optional[Dict[str, Any]] = None, skip_defaults: bool = False
|
|
56
55
|
):
|
|
57
56
|
"""
|
|
58
57
|
Loads all the entry points specified by ``group`` and returns
|
|
@@ -72,6 +71,7 @@ def load_group(
|
|
|
72
71
|
1. ``load_group("foo")["bar"]("baz")`` -> equivalent to calling ``this.is.a_fn("baz")``
|
|
73
72
|
1. ``load_group("food")`` -> ``None``
|
|
74
73
|
1. ``load_group("food", default={"hello": this.is.c_fn})["hello"]("world")`` -> equivalent to calling ``this.is.c_fn("world")``
|
|
74
|
+
1. ``load_group("food", default={"hello": this.is.c_fn}, skip_defaults=True)`` -> ``None``
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
If the entrypoint is a module (versus a function as shown above), then calling the ``deferred_load_fn``
|
|
@@ -90,6 +90,8 @@ def load_group(
|
|
|
90
90
|
entrypoints = metadata.entry_points().select(group=group)
|
|
91
91
|
|
|
92
92
|
if len(entrypoints) == 0:
|
|
93
|
+
if skip_defaults:
|
|
94
|
+
return None
|
|
93
95
|
return default
|
|
94
96
|
|
|
95
97
|
eps = {}
|
|
@@ -57,14 +57,14 @@ torchx/pipelines/kfp/adapter.py,sha256=5GeHULjb1kxG6wJtYVLpNkgdzUi4iYEaR42VFOwT6
|
|
|
57
57
|
torchx/pipelines/kfp/version.py,sha256=mYBxd6bm4MeR34D--xo-JLQ9wHeAl_ZQLwbItCf9tr0,539
|
|
58
58
|
torchx/runner/__init__.py,sha256=x8Sz7s_tLxPgJgvWIhK4ju9BNZU61uBFywGwDY6CqJs,315
|
|
59
59
|
torchx/runner/api.py,sha256=uI365qobKvTP6-fEAiGrVlBzipYDhy1L8RoOJ1BQ3mA,29338
|
|
60
|
-
torchx/runner/config.py,sha256=
|
|
60
|
+
torchx/runner/config.py,sha256=qpq_RfUSUykquAsEKOhDT3xBsa-m3wc6F6O8oP2QJ7k,18303
|
|
61
61
|
torchx/runner/events/__init__.py,sha256=1_y0bojXl3FL0zlAj7BI4Dg5cXKXUmaa2jZbVH0EDUA,5268
|
|
62
62
|
torchx/runner/events/api.py,sha256=pPLfowWTXtN_XcrEDNI45pE6Ijvdc_Gdxq76RduqgGE,2664
|
|
63
63
|
torchx/runner/events/handlers.py,sha256=ThHCIJW21BfBgB7b6ftyjASJmD1KdizpjuTtsyqnvJs,522
|
|
64
64
|
torchx/runtime/__init__.py,sha256=Wxje2BryzeQneFu5r6P9JJiEKG-_C9W1CcZ_JNrKT6g,593
|
|
65
65
|
torchx/runtime/tracking/__init__.py,sha256=dYnAPnrXYREfPXkpHhdOFkcYIODWEbA13PdD-wLQYBo,3055
|
|
66
66
|
torchx/runtime/tracking/api.py,sha256=SmUQyUKZqG3KlAhT7CJOGqRz1O274E4m63wQeOVq3CU,5472
|
|
67
|
-
torchx/schedulers/__init__.py,sha256=
|
|
67
|
+
torchx/schedulers/__init__.py,sha256=gwy1opmKOPzQ_Lqh2GY0chYycLmdissLfd4846mPEMY,2334
|
|
68
68
|
torchx/schedulers/api.py,sha256=jAjfTKNgw26Rc5-FsZCSFt1xQIBNzXdUjUeOlllCuIU,14163
|
|
69
69
|
torchx/schedulers/aws_batch_scheduler.py,sha256=8jRTmi5gtqyKUQfhMRqCQqNVM0drXdu8RS0xUfZby48,28091
|
|
70
70
|
torchx/schedulers/aws_sagemaker_scheduler.py,sha256=x33J_tQFpRr_AUv5dWf1qxqG0dbmIjaqFHyrSnHWijw,20921
|
|
@@ -74,7 +74,7 @@ torchx/schedulers/gcp_batch_scheduler.py,sha256=o0t70s7fpGgn8MqhkIPWV3ZuF0kc5KdL
|
|
|
74
74
|
torchx/schedulers/ids.py,sha256=3E-_vwVYC-8Tv8kjuY9-W7TbOe_-Laqd8a65uIN3hQY,1798
|
|
75
75
|
torchx/schedulers/kubernetes_mcad_scheduler.py,sha256=riUfzSBega0JcCbV9NspU_a5A46AD-74Jgf7JPvA2Is,42925
|
|
76
76
|
torchx/schedulers/kubernetes_scheduler.py,sha256=W_vVvQVGjNUoasN-JIsOTU9f0qjpds2u3GteNblssGM,28193
|
|
77
|
-
torchx/schedulers/local_scheduler.py,sha256=
|
|
77
|
+
torchx/schedulers/local_scheduler.py,sha256=wOL-Js1fzEJY7RugNpFKu6BjmdHBgRf3llONFdwg-xQ,41845
|
|
78
78
|
torchx/schedulers/lsf_scheduler.py,sha256=BkXKyWoVrCZznjfRFQ8oW3vzM0sBGkGmGUcSX71D-nE,17667
|
|
79
79
|
torchx/schedulers/ray_scheduler.py,sha256=d10PtA-sEfHmDxF-GKog_Qro7FpIDCjSZbkKBdyj72E,17462
|
|
80
80
|
torchx/schedulers/slurm_scheduler.py,sha256=A11XvI0-Wa7n3qc1IdrYcDaQEZhj0GiGf-PjHj0Byn8,19386
|
|
@@ -103,7 +103,7 @@ torchx/tracker/backend/fsspec.py,sha256=528xKryBE27Rm_OHD7r2R6fmVAclknBtoy1s034N
|
|
|
103
103
|
torchx/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
104
104
|
torchx/util/cuda.py,sha256=-ZTa1WCLnY2WtSWAdWufLQqZSDCZfZsloBuiS84LIkU,1099
|
|
105
105
|
torchx/util/datetime.py,sha256=hV6Sg0u5KTBe68yrmy_RGCC5su0i4Tb_mAYphWamiXI,405
|
|
106
|
-
torchx/util/entrypoints.py,sha256=
|
|
106
|
+
torchx/util/entrypoints.py,sha256=J5WSFtCFVZ7ZjlAvzYcdWgVSUKC3aVo1eVmJAbWhpx8,2894
|
|
107
107
|
torchx/util/io.py,sha256=HNpWLcFUX0WTAP3CsdamHz--FR5A4kSdLCPfNqa2UkA,1807
|
|
108
108
|
torchx/util/log_tee_helpers.py,sha256=wPyozmh9BOt_2d3Gxa0iNogwnjzwFitIIMBJOJ1arIw,6330
|
|
109
109
|
torchx/util/modules.py,sha256=LRTuZRH5bbRr0ZaCtCtvKbgwhMoPsTx-GokWbCLGPdk,1131
|
|
@@ -115,9 +115,9 @@ torchx/workspace/__init__.py,sha256=FqN8AN4VhR1C_SBY10MggQvNZmyanbbuPuE-JCjkyUY,
|
|
|
115
115
|
torchx/workspace/api.py,sha256=PtDkGTC5lX03pRoYpuMz2KCmM1ZOycRP1UknqvNb97Y,6341
|
|
116
116
|
torchx/workspace/dir_workspace.py,sha256=npNW_IjUZm_yS5r-8hrRkH46ndDd9a_eApT64m1S1T4,2268
|
|
117
117
|
torchx/workspace/docker_workspace.py,sha256=PFu2KQNVC-0p2aKJ-W_BKA9ZOmXdCY2ABEkCExp3udQ,10269
|
|
118
|
-
torchx_nightly-2024.12.
|
|
119
|
-
torchx_nightly-2024.12.
|
|
120
|
-
torchx_nightly-2024.12.
|
|
121
|
-
torchx_nightly-2024.12.
|
|
122
|
-
torchx_nightly-2024.12.
|
|
123
|
-
torchx_nightly-2024.12.
|
|
118
|
+
torchx_nightly-2024.12.19.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
|
|
119
|
+
torchx_nightly-2024.12.19.dist-info/METADATA,sha256=TTMZujCKPVefmghH92lcE9KgEISFAz_4WNx7lXSmvGs,6170
|
|
120
|
+
torchx_nightly-2024.12.19.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
121
|
+
torchx_nightly-2024.12.19.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
|
|
122
|
+
torchx_nightly-2024.12.19.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
|
|
123
|
+
torchx_nightly-2024.12.19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{torchx_nightly-2024.12.17.dist-info → torchx_nightly-2024.12.19.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|