torchx-nightly 2024.9.10__py3-none-any.whl → 2024.9.11__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.

@@ -27,6 +27,7 @@ from types import TracebackType
27
27
  from typing import Dict, Optional, Type
28
28
 
29
29
  from torchx.runner.events.handlers import get_logging_handler
30
+ from torchx.util.session import get_session_id_or_create_new
30
31
 
31
32
  from .api import SourceType, TorchxEvent # noqa F401
32
33
 
@@ -136,7 +137,7 @@ class log_event:
136
137
  workspace: Optional[str] = None,
137
138
  ) -> TorchxEvent:
138
139
  return TorchxEvent(
139
- session=app_id or "",
140
+ session=get_session_id_or_create_new(),
140
141
  scheduler=scheduler,
141
142
  api=api,
142
143
  app_id=app_id,
@@ -25,7 +25,7 @@ class TorchxEvent:
25
25
  The class represents the event produced by ``torchx.runner`` api calls.
26
26
 
27
27
  Arguments:
28
- session: Session id that was used to execute request.
28
+ session: Session id of the current run
29
29
  scheduler: Scheduler that is used to execute request
30
30
  api: Api name
31
31
  app_id: Unique id that is set by the underlying scheduler
torchx/util/session.py ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env python3
2
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ # All rights reserved.
4
+ #
5
+ # This source code is licensed under the BSD-style license found in the
6
+ # LICENSE file in the root directory of this source tree.
7
+
8
+ # pyre-strict
9
+
10
+ import uuid
11
+ from typing import Optional
12
+
13
+ CURRENT_SESSION_ID: Optional[str] = None
14
+
15
+
16
+ def get_session_id_or_create_new() -> str:
17
+ """
18
+ Returns the current session ID, or creates a new one if none exists.
19
+ The session ID remains the same as long as it is in the same process.
20
+ """
21
+ global CURRENT_SESSION_ID
22
+ if CURRENT_SESSION_ID:
23
+ return CURRENT_SESSION_ID
24
+ session_id = str(uuid.uuid4())
25
+ CURRENT_SESSION_ID = session_id
26
+ return session_id
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: torchx-nightly
3
- Version: 2024.9.10
3
+ Version: 2024.9.11
4
4
  Summary: TorchX SDK and Components
5
5
  Home-page: https://github.com/pytorch/torchx
6
6
  Author: TorchX Devs
@@ -62,6 +62,7 @@ Requires-Dist: torchtext==0.17.1; extra == "dev"
62
62
  Requires-Dist: torchvision==0.17.1; extra == "dev"
63
63
  Requires-Dist: ts==0.5.1; extra == "dev"
64
64
  Requires-Dist: ray[default]; extra == "dev"
65
+ Requires-Dist: wheel; extra == "dev"
65
66
  Requires-Dist: lintrunner; extra == "dev"
66
67
  Requires-Dist: lintrunner-adapters; extra == "dev"
67
68
  Requires-Dist: grpcio==1.62.1; extra == "dev"
@@ -58,8 +58,8 @@ torchx/pipelines/kfp/version.py,sha256=mYBxd6bm4MeR34D--xo-JLQ9wHeAl_ZQLwbItCf9t
58
58
  torchx/runner/__init__.py,sha256=x8Sz7s_tLxPgJgvWIhK4ju9BNZU61uBFywGwDY6CqJs,315
59
59
  torchx/runner/api.py,sha256=17ZFEYeuIK0kUrTUysdgsFaEVc6_-ggvBuSoabQnrcA,28625
60
60
  torchx/runner/config.py,sha256=fTdCcf-MKlBg6MzXopF4W0hYyDDoPAuvZs2v2bKzwG0,17849
61
- torchx/runner/events/__init__.py,sha256=KxvodAlq9ZDUIKzdlzHuyQWa0aoIGKTtBfE7vjM6GRk,4570
62
- torchx/runner/events/api.py,sha256=UTdExV7cMR5kC0nQIViwTlyblhBF3D5bbuqd4-kWrkE,2542
61
+ torchx/runner/events/__init__.py,sha256=TtzBLZ9oaHKfr689R4NnjCii3G8kxiRafe7Q0jRE5_k,4649
62
+ torchx/runner/events/api.py,sha256=_6mjS5B5FcSMEea1U0M-fD4jErmbpZ1gQOyUHV-4dqY,2527
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
@@ -106,6 +106,7 @@ torchx/util/datetime.py,sha256=hV6Sg0u5KTBe68yrmy_RGCC5su0i4Tb_mAYphWamiXI,405
106
106
  torchx/util/entrypoints.py,sha256=4rqmA81XYLj4Kk7GboJi0z78h4NIQxSrcOzDuuTwCkw,2725
107
107
  torchx/util/io.py,sha256=HNpWLcFUX0WTAP3CsdamHz--FR5A4kSdLCPfNqa2UkA,1807
108
108
  torchx/util/modules.py,sha256=LRTuZRH5bbRr0ZaCtCtvKbgwhMoPsTx-GokWbCLGPdk,1131
109
+ torchx/util/session.py,sha256=__4DFoJqpTzqc99FPlKyLPDQFn2g3rtu0dFb5b-Z-7E,721
109
110
  torchx/util/shlex.py,sha256=eXEKu8KC3zIcd8tEy9_s8Ds5oma8BORr-0VGWNpG2dk,463
110
111
  torchx/util/strings.py,sha256=GkLWCmYS89Uv6bWc5hH0XwvHy7oQmprv2U7axC4A2e8,678
111
112
  torchx/util/types.py,sha256=een55pV-N8aBc3qUBjHRc1llJcX10JVa19pB8dBE8No,7564
@@ -113,9 +114,9 @@ torchx/workspace/__init__.py,sha256=FqN8AN4VhR1C_SBY10MggQvNZmyanbbuPuE-JCjkyUY,
113
114
  torchx/workspace/api.py,sha256=1heBmPgB-W5Zf9gwViM7NrqvHpZlVYeMN7jpY8Qkytc,5479
114
115
  torchx/workspace/dir_workspace.py,sha256=npNW_IjUZm_yS5r-8hrRkH46ndDd9a_eApT64m1S1T4,2268
115
116
  torchx/workspace/docker_workspace.py,sha256=PFu2KQNVC-0p2aKJ-W_BKA9ZOmXdCY2ABEkCExp3udQ,10269
116
- torchx_nightly-2024.9.10.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
117
- torchx_nightly-2024.9.10.dist-info/METADATA,sha256=SgZfqyXnQHLvP4JgFk83rMNwULWBynlvcziT7bsRcIg,6132
118
- torchx_nightly-2024.9.10.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
119
- torchx_nightly-2024.9.10.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
120
- torchx_nightly-2024.9.10.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
121
- torchx_nightly-2024.9.10.dist-info/RECORD,,
117
+ torchx_nightly-2024.9.11.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
118
+ torchx_nightly-2024.9.11.dist-info/METADATA,sha256=xs1T4jpg2YzT2663FBpFA4A2sLov0vQrzZXxIUewX9s,6169
119
+ torchx_nightly-2024.9.11.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
120
+ torchx_nightly-2024.9.11.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
121
+ torchx_nightly-2024.9.11.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
122
+ torchx_nightly-2024.9.11.dist-info/RECORD,,