torchx-nightly 2024.4.16__py3-none-any.whl → 2024.4.18__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
@@ -11,6 +11,7 @@ import logging
11
11
  import os
12
12
  import sys
13
13
  import threading
14
+ from collections import Counter
14
15
  from dataclasses import asdict
15
16
  from pathlib import Path
16
17
  from pprint import pformat
@@ -84,6 +85,13 @@ def _parse_component_name_and_args(
84
85
  component = args[0]
85
86
  component_args = args[1:]
86
87
 
88
+ # Error if there are repeated command line arguments
89
+ all_options = [x for x in component_args if x.startswith("-")]
90
+ arg_count = Counter(all_options)
91
+ duplicates = [arg for arg, count in arg_count.items() if count > 1]
92
+ if len(duplicates) > 0:
93
+ subparser.error(f"Repeated Command Line Arguments: {duplicates}")
94
+
87
95
  if not component:
88
96
  subparser.error(MISSING_COMPONENT_ERROR_MSG)
89
97
 
torchx/runner/api.py CHANGED
@@ -177,15 +177,20 @@ class Runner:
177
177
  ComponentNotFoundException: if the ``component_path`` is failed to resolve.
178
178
  """
179
179
 
180
- dryrun_info = self.dryrun_component(
181
- component,
182
- component_args,
183
- scheduler,
184
- cfg=cfg,
185
- workspace=workspace,
186
- parent_run_id=parent_run_id,
187
- )
188
- return self.schedule(dryrun_info)
180
+ with log_event("run_component") as ctx:
181
+ dryrun_info = self.dryrun_component(
182
+ component,
183
+ component_args,
184
+ scheduler,
185
+ cfg=cfg,
186
+ workspace=workspace,
187
+ parent_run_id=parent_run_id,
188
+ )
189
+ handle = self.schedule(dryrun_info)
190
+ ctx._torchx_event.scheduler = none_throws(dryrun_info._scheduler)
191
+ ctx._torchx_event.app_image = none_throws(dryrun_info._app).roles[0].image
192
+ ctx._torchx_event.app_id = parse_app_handle(handle)[2]
193
+ return handle
189
194
 
190
195
  def dryrun_component(
191
196
  self,
@@ -232,10 +237,19 @@ class Runner:
232
237
  An application handle that is used to call other action APIs on the app.
233
238
  """
234
239
 
235
- dryrun_info = self.dryrun(
236
- app, scheduler, cfg=cfg, workspace=workspace, parent_run_id=parent_run_id
237
- )
238
- return self.schedule(dryrun_info)
240
+ with log_event(api="run", runcfg=json.dumps(cfg) if cfg else None) as ctx:
241
+ dryrun_info = self.dryrun(
242
+ app,
243
+ scheduler,
244
+ cfg=cfg,
245
+ workspace=workspace,
246
+ parent_run_id=parent_run_id,
247
+ )
248
+ handle = self.schedule(dryrun_info)
249
+ ctx._torchx_event.scheduler = none_throws(dryrun_info._scheduler)
250
+ ctx._torchx_event.app_image = none_throws(dryrun_info._app).roles[0].image
251
+ ctx._torchx_event.app_id = parse_app_handle(handle)[2]
252
+ return handle
239
253
 
240
254
  def schedule(self, dryrun_info: AppDryRunInfo) -> AppHandle:
241
255
  """
@@ -96,7 +96,8 @@ class log_event:
96
96
  def __enter__(self) -> "log_event":
97
97
  self._start_cpu_time_ns = time.process_time_ns()
98
98
  self._start_wall_time_ns = time.perf_counter_ns()
99
- self._start_epoch_time_usec = int(time.time() * 1000)
99
+ self._torchx_event.start_epoch_time_usec = int(time.time() * 1_000_000)
100
+
100
101
  return self
101
102
 
102
103
  def __exit__(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: torchx-nightly
3
- Version: 2024.4.16
3
+ Version: 2024.4.18
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=BVqHEW2oTEJ3GqcFK7c1K-i2R-DUjaXQ-WBr0meeIGM,1429
18
18
  torchx/cli/cmd_log.py,sha256=Xh5vrsbwyV_ppwurrENGBNKxc1XLVbFC6YH1b8jlHAM,6104
19
- torchx/cli/cmd_run.py,sha256=zw-rqKI7QxYUs99vQdhvZm0L11-QXTIlvDAc_7TS2Dg,10527
19
+ torchx/cli/cmd_run.py,sha256=zd0sysnYUNWQqXT30HvPvzH8Z0YDNlgwqlwxO4PqZRA,10895
20
20
  torchx/cli/cmd_runopts.py,sha256=NWZiP8XpQjfTDJgays2c6MgL_8wxFoeDge6NstaZdKk,1302
21
21
  torchx/cli/cmd_status.py,sha256=ubtmCp4PylrIh_kC3ZJ5QJm7lzXRt_aRPmY7j-sZu_0,1836
22
22
  torchx/cli/cmd_tracker.py,sha256=RfLxE4Cq1wfk7k051RtZ8RPJp0pEKSCa3KmTeRs3LF8,5218
@@ -55,9 +55,9 @@ torchx/pipelines/kfp/__init__.py,sha256=8iJ8lql_fxwuk9VCYSxXnX6tPL228fB5mDZpOs-k
55
55
  torchx/pipelines/kfp/adapter.py,sha256=q9fGRS3-xOYVl-tAjTNlUFLbw22r5IiCz9IP34t1rWU,8959
56
56
  torchx/pipelines/kfp/version.py,sha256=mYBxd6bm4MeR34D--xo-JLQ9wHeAl_ZQLwbItCf9tr0,539
57
57
  torchx/runner/__init__.py,sha256=x8Sz7s_tLxPgJgvWIhK4ju9BNZU61uBFywGwDY6CqJs,315
58
- torchx/runner/api.py,sha256=YpANr5AyFiufB5BcexGIIeExoN5_1ANAzyVWIwz30xo,27101
58
+ torchx/runner/api.py,sha256=AuP2qGGPotawzBOrsZHw5pQq8uzDTIelp6PiGNe1DAA,27869
59
59
  torchx/runner/config.py,sha256=pBNbe51EvsfyZvOdhAKvobq0V9lKtpnDkWUzEgnxiP4,17838
60
- torchx/runner/events/__init__.py,sha256=0MhK39pdvj6bvG7B91wk115xEvSE1_8EBTeyHUEDrMI,4160
60
+ torchx/runner/events/__init__.py,sha256=3FBI4y9oaLFUs6TtTjJAWmGV24WLP_GkOo9AfhDrfxg,4179
61
61
  torchx/runner/events/api.py,sha256=EgXK2wF_qc_zZHFgVHNcSAaPibyjM91DfQVtkXXcC-E,2195
62
62
  torchx/runner/events/handlers.py,sha256=ThHCIJW21BfBgB7b6ftyjASJmD1KdizpjuTtsyqnvJs,522
63
63
  torchx/runtime/__init__.py,sha256=Wxje2BryzeQneFu5r6P9JJiEKG-_C9W1CcZ_JNrKT6g,593
@@ -112,9 +112,9 @@ torchx/workspace/__init__.py,sha256=FqN8AN4VhR1C_SBY10MggQvNZmyanbbuPuE-JCjkyUY,
112
112
  torchx/workspace/api.py,sha256=1heBmPgB-W5Zf9gwViM7NrqvHpZlVYeMN7jpY8Qkytc,5479
113
113
  torchx/workspace/dir_workspace.py,sha256=npNW_IjUZm_yS5r-8hrRkH46ndDd9a_eApT64m1S1T4,2268
114
114
  torchx/workspace/docker_workspace.py,sha256=PFu2KQNVC-0p2aKJ-W_BKA9ZOmXdCY2ABEkCExp3udQ,10269
115
- torchx_nightly-2024.4.16.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
116
- torchx_nightly-2024.4.16.dist-info/METADATA,sha256=4B0c66_9_GuidLAU7q2InZJpKMJjjOAd2622dL4e7yU,6053
117
- torchx_nightly-2024.4.16.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
118
- torchx_nightly-2024.4.16.dist-info/entry_points.txt,sha256=3JYZFlX9aWzR-Gs_qsx1zq7mlqbFz6Mi9rQUULW8caI,170
119
- torchx_nightly-2024.4.16.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
120
- torchx_nightly-2024.4.16.dist-info/RECORD,,
115
+ torchx_nightly-2024.4.18.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
116
+ torchx_nightly-2024.4.18.dist-info/METADATA,sha256=tYVg4HJPS3J2kquyQIRtGY4SlRkI9fhRofMlbznLOy4,6053
117
+ torchx_nightly-2024.4.18.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
118
+ torchx_nightly-2024.4.18.dist-info/entry_points.txt,sha256=3JYZFlX9aWzR-Gs_qsx1zq7mlqbFz6Mi9rQUULW8caI,170
119
+ torchx_nightly-2024.4.18.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
120
+ torchx_nightly-2024.4.18.dist-info/RECORD,,