torchx-nightly 2025.9.1__py3-none-any.whl → 2025.9.3__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/cli/cmd_run.py CHANGED
@@ -12,11 +12,11 @@ import os
12
12
  import sys
13
13
  import threading
14
14
  from collections import Counter
15
- from dataclasses import asdict
15
+ from dataclasses import asdict, dataclass, field, fields, MISSING as DATACLASS_MISSING
16
16
  from itertools import groupby
17
17
  from pathlib import Path
18
18
  from pprint import pformat
19
- from typing import Dict, List, Optional, Tuple
19
+ from typing import Any, Dict, List, Optional, Tuple
20
20
 
21
21
  import torchx.specs as specs
22
22
  from torchx.cli.argparse_util import ArgOnceAction, torchxconfig_run
@@ -25,6 +25,7 @@ from torchx.cli.cmd_log import get_logs
25
25
  from torchx.runner import config, get_runner, Runner
26
26
  from torchx.runner.config import load_sections
27
27
  from torchx.schedulers import get_default_scheduler_name, get_scheduler_factories
28
+ from torchx.specs import CfgVal
28
29
  from torchx.specs.finder import (
29
30
  _Component,
30
31
  ComponentNotFoundException,
@@ -44,6 +45,68 @@ MISSING_COMPONENT_ERROR_MSG = (
44
45
  logger: logging.Logger = logging.getLogger(__name__)
45
46
 
46
47
 
48
+ @dataclass
49
+ class TorchXRunArgs:
50
+ component_name: str
51
+ scheduler: str
52
+ scheduler_args: Dict[str, Any]
53
+ scheduler_cfg: Dict[str, CfgVal] = field(default_factory=dict)
54
+ dryrun: bool = False
55
+ wait: bool = False
56
+ log: bool = False
57
+ workspace: str = f"file://{Path.cwd()}"
58
+ parent_run_id: Optional[str] = None
59
+ tee_logs: bool = False
60
+ component_args: Dict[str, Any] = field(default_factory=dict)
61
+ component_args_str: List[str] = field(default_factory=list)
62
+
63
+
64
+ def torchx_run_args_from_json(json_data: Dict[str, Any]) -> TorchXRunArgs:
65
+ all_fields = [f.name for f in fields(TorchXRunArgs)]
66
+ required_fields = {
67
+ f.name
68
+ for f in fields(TorchXRunArgs)
69
+ if f.default is DATACLASS_MISSING and f.default_factory is DATACLASS_MISSING
70
+ }
71
+ missing_fields = required_fields - json_data.keys()
72
+ if missing_fields:
73
+ raise ValueError(
74
+ f"The following required fields are missing: {', '.join(missing_fields)}"
75
+ )
76
+
77
+ # Fail if there are fields that aren't part of the run command
78
+ filtered_json_data = {k: v for k, v in json_data.items() if k in all_fields}
79
+ extra_fields = set(json_data.keys()) - set(all_fields)
80
+ if extra_fields:
81
+ raise ValueError(
82
+ f"The following fields are not part of the run command: {', '.join(extra_fields)}.",
83
+ "Please check your JSON and try launching again.",
84
+ )
85
+
86
+ return TorchXRunArgs(**filtered_json_data)
87
+
88
+
89
+ def torchx_run_args_from_argparse(
90
+ args: argparse.Namespace,
91
+ component_name: str,
92
+ component_args: List[str],
93
+ scheduler_cfg: Dict[str, CfgVal],
94
+ ) -> TorchXRunArgs:
95
+ return TorchXRunArgs(
96
+ component_name=component_name,
97
+ scheduler=args.scheduler,
98
+ scheduler_args={},
99
+ scheduler_cfg=scheduler_cfg,
100
+ dryrun=args.dryrun,
101
+ wait=args.wait,
102
+ log=args.log,
103
+ workspace=args.workspace,
104
+ parent_run_id=args.parent_run_id,
105
+ tee_logs=args.tee_logs,
106
+ component_args_str=component_args,
107
+ )
108
+
109
+
47
110
  def _parse_component_name_and_args(
48
111
  component_name_and_args: List[str],
49
112
  subparser: argparse.ArgumentParser,
torchx/runner/api.py CHANGED
@@ -164,18 +164,6 @@ class Runner:
164
164
  for scheduler in self._scheduler_instances.values():
165
165
  scheduler.close()
166
166
 
167
- def build_standalone_workspace(
168
- self,
169
- workspace_builder: WorkspaceBuilder[S, T],
170
- sync: bool = True,
171
- ) -> PkgInfo[S]:
172
- """
173
- Build a standalone workspace for the given role.
174
- This method is used to build a workspace for a role independent of the scheduler and
175
- also enables asynchronous workspace building using the Role overrides.
176
- """
177
- return workspace_builder.build_workspace(sync)
178
-
179
167
  def run_component(
180
168
  self,
181
169
  component: str,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: torchx-nightly
3
- Version: 2025.9.1
3
+ Version: 2025.9.3
4
4
  Summary: TorchX SDK and Components
5
5
  Home-page: https://github.com/pytorch/torchx
6
6
  Author: TorchX Devs
@@ -16,7 +16,7 @@ torchx/cli/cmd_configure.py,sha256=1kTv0qbsbV44So74plAySwWu56pQrqjhfW_kbfdC3Rw,1
16
16
  torchx/cli/cmd_describe.py,sha256=E5disbHoKTsqYKp2s3DaFW9GDLCCOgdOc3pQoHKoyCs,1283
17
17
  torchx/cli/cmd_list.py,sha256=4Y1ZOq-kqJbztoBt56hAW_InJEaJuDAjpKWgMhBw4II,1507
18
18
  torchx/cli/cmd_log.py,sha256=v-EZYUDOcG95rEgTnrsmPJMUyxM9Mk8YFAJtUxtgViE,5475
19
- torchx/cli/cmd_run.py,sha256=dFVzlVBSxqBfTRz80VL8R_r2GVayKZ4xDVBQLu275M0,12285
19
+ torchx/cli/cmd_run.py,sha256=xSWo1IZB5Nife3AGExalW8DthPlT91xQCf3bdOYOeQQ,14419
20
20
  torchx/cli/cmd_runopts.py,sha256=NWZiP8XpQjfTDJgays2c6MgL_8wxFoeDge6NstaZdKk,1302
21
21
  torchx/cli/cmd_status.py,sha256=22IAEmKs0qkG6kJi83u9dRX2Q-ntT7yehVx7FxtY-vQ,2114
22
22
  torchx/cli/cmd_tracker.py,sha256=RfLxE4Cq1wfk7k051RtZ8RPJp0pEKSCa3KmTeRs3LF8,5218
@@ -56,7 +56,7 @@ torchx/pipelines/kfp/__init__.py,sha256=8iJ8lql_fxwuk9VCYSxXnX6tPL228fB5mDZpOs-k
56
56
  torchx/pipelines/kfp/adapter.py,sha256=5GeHULjb1kxG6wJtYVLpNkgdzUi4iYEaR42VFOwT6fY,9045
57
57
  torchx/pipelines/kfp/version.py,sha256=mYBxd6bm4MeR34D--xo-JLQ9wHeAl_ZQLwbItCf9tr0,539
58
58
  torchx/runner/__init__.py,sha256=x8Sz7s_tLxPgJgvWIhK4ju9BNZU61uBFywGwDY6CqJs,315
59
- torchx/runner/api.py,sha256=UzQP25TVKcQoK5RUjf0AaH4dfXKFWSbE1YOSXH2Uo_w,30766
59
+ torchx/runner/api.py,sha256=I72ecOkUVqq7iMI_6H2_e0TJjU_URh-wLdLVLd5AYX8,30308
60
60
  torchx/runner/config.py,sha256=CBuYQCBj52fs4NclxJbdx5xtDdgNnfDd7XSdHPE1IGo,18267
61
61
  torchx/runner/events/__init__.py,sha256=1_y0bojXl3FL0zlAj7BI4Dg5cXKXUmaa2jZbVH0EDUA,5268
62
62
  torchx/runner/events/api.py,sha256=pPLfowWTXtN_XcrEDNI45pE6Ijvdc_Gdxq76RduqgGE,2664
@@ -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-2025.9.1.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
119
- torchx_nightly-2025.9.1.dist-info/METADATA,sha256=d7pQ-SlXNktRwJtM1nPGaqJ-pk_qpDyWk539rj1Nbg0,6103
120
- torchx_nightly-2025.9.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
121
- torchx_nightly-2025.9.1.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
122
- torchx_nightly-2025.9.1.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
123
- torchx_nightly-2025.9.1.dist-info/RECORD,,
118
+ torchx_nightly-2025.9.3.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
119
+ torchx_nightly-2025.9.3.dist-info/METADATA,sha256=xcGwmuaw3N3-9s2p4kLPrRRugzoq7xOcyrzIZugKAws,6103
120
+ torchx_nightly-2025.9.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
121
+ torchx_nightly-2025.9.3.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
122
+ torchx_nightly-2025.9.3.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
123
+ torchx_nightly-2025.9.3.dist-info/RECORD,,