torchx-nightly 2024.2.12__py3-none-any.whl → 2025.1.14__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/__init__.py +2 -0
- torchx/apps/serve/serve.py +2 -0
- torchx/apps/utils/booth_main.py +2 -0
- torchx/apps/utils/copy_main.py +2 -0
- torchx/apps/utils/process_monitor.py +2 -0
- torchx/cli/__init__.py +2 -0
- torchx/cli/argparse_util.py +38 -3
- torchx/cli/cmd_base.py +2 -0
- torchx/cli/cmd_cancel.py +2 -0
- torchx/cli/cmd_configure.py +2 -0
- torchx/cli/cmd_describe.py +2 -0
- torchx/cli/cmd_list.py +2 -0
- torchx/cli/cmd_log.py +6 -24
- torchx/cli/cmd_run.py +30 -12
- torchx/cli/cmd_runopts.py +2 -0
- torchx/cli/cmd_status.py +2 -0
- torchx/cli/cmd_tracker.py +2 -0
- torchx/cli/colors.py +2 -0
- torchx/cli/main.py +2 -0
- torchx/components/__init__.py +2 -0
- torchx/components/component_test_base.py +2 -0
- torchx/components/dist.py +2 -0
- torchx/components/integration_tests/component_provider.py +2 -0
- torchx/components/integration_tests/integ_tests.py +2 -0
- torchx/components/serve.py +2 -0
- torchx/components/structured_arg.py +2 -0
- torchx/components/utils.py +2 -0
- torchx/examples/apps/datapreproc/datapreproc.py +2 -0
- torchx/examples/apps/lightning/data.py +5 -3
- torchx/examples/apps/lightning/model.py +2 -0
- torchx/examples/apps/lightning/profiler.py +7 -4
- torchx/examples/apps/lightning/train.py +2 -0
- torchx/examples/pipelines/kfp/advanced_pipeline.py +2 -0
- torchx/examples/pipelines/kfp/dist_pipeline.py +3 -1
- torchx/examples/pipelines/kfp/intro_pipeline.py +3 -1
- torchx/examples/torchx_out_of_sync_training.py +11 -0
- torchx/notebook.py +2 -0
- torchx/pipelines/kfp/__init__.py +2 -0
- torchx/pipelines/kfp/adapter.py +7 -4
- torchx/pipelines/kfp/version.py +2 -0
- torchx/runner/__init__.py +2 -0
- torchx/runner/api.py +78 -20
- torchx/runner/config.py +34 -3
- torchx/runner/events/__init__.py +37 -3
- torchx/runner/events/api.py +13 -2
- torchx/runner/events/handlers.py +2 -0
- torchx/runtime/tracking/__init__.py +2 -0
- torchx/runtime/tracking/api.py +2 -0
- torchx/schedulers/__init__.py +10 -5
- torchx/schedulers/api.py +3 -1
- torchx/schedulers/aws_batch_scheduler.py +4 -0
- torchx/schedulers/aws_sagemaker_scheduler.py +596 -0
- torchx/schedulers/devices.py +17 -4
- torchx/schedulers/docker_scheduler.py +38 -8
- torchx/schedulers/gcp_batch_scheduler.py +8 -9
- torchx/schedulers/ids.py +2 -0
- torchx/schedulers/kubernetes_mcad_scheduler.py +3 -1
- torchx/schedulers/kubernetes_scheduler.py +31 -5
- torchx/schedulers/local_scheduler.py +45 -6
- torchx/schedulers/lsf_scheduler.py +3 -1
- torchx/schedulers/ray/ray_driver.py +7 -7
- torchx/schedulers/ray_scheduler.py +1 -1
- torchx/schedulers/slurm_scheduler.py +3 -1
- torchx/schedulers/streams.py +2 -0
- torchx/specs/__init__.py +49 -8
- torchx/specs/api.py +87 -5
- torchx/specs/builders.py +61 -19
- torchx/specs/file_linter.py +8 -2
- torchx/specs/finder.py +2 -0
- torchx/specs/named_resources_aws.py +109 -2
- torchx/specs/named_resources_generic.py +2 -0
- torchx/specs/test/components/__init__.py +2 -0
- torchx/specs/test/components/a/__init__.py +2 -0
- torchx/specs/test/components/a/b/__init__.py +2 -0
- torchx/specs/test/components/a/b/c.py +2 -0
- torchx/specs/test/components/c/__init__.py +2 -0
- torchx/specs/test/components/c/d.py +2 -0
- torchx/tracker/__init__.py +2 -0
- torchx/tracker/api.py +4 -4
- torchx/tracker/backend/fsspec.py +2 -0
- torchx/util/cuda.py +2 -0
- torchx/util/datetime.py +2 -0
- torchx/util/entrypoints.py +6 -2
- torchx/util/io.py +2 -0
- torchx/util/log_tee_helpers.py +210 -0
- torchx/util/modules.py +2 -0
- torchx/util/session.py +42 -0
- torchx/util/shlex.py +2 -0
- torchx/util/strings.py +2 -0
- torchx/util/types.py +20 -2
- torchx/version.py +3 -1
- torchx/workspace/__init__.py +2 -0
- torchx/workspace/api.py +34 -1
- torchx/workspace/dir_workspace.py +2 -0
- torchx/workspace/docker_workspace.py +25 -2
- {torchx_nightly-2024.2.12.dist-info → torchx_nightly-2025.1.14.dist-info}/METADATA +55 -48
- torchx_nightly-2025.1.14.dist-info/RECORD +123 -0
- {torchx_nightly-2024.2.12.dist-info → torchx_nightly-2025.1.14.dist-info}/WHEEL +1 -1
- {torchx_nightly-2024.2.12.dist-info → torchx_nightly-2025.1.14.dist-info}/entry_points.txt +0 -1
- torchx_nightly-2024.2.12.dist-info/RECORD +0 -119
- {torchx_nightly-2024.2.12.dist-info → torchx_nightly-2025.1.14.dist-info}/LICENSE +0 -0
- {torchx_nightly-2024.2.12.dist-info → torchx_nightly-2025.1.14.dist-info}/top_level.txt +0 -0
torchx/__init__.py
CHANGED
torchx/apps/serve/serve.py
CHANGED
torchx/apps/utils/booth_main.py
CHANGED
torchx/apps/utils/copy_main.py
CHANGED
torchx/cli/__init__.py
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
# This source code is licensed under the BSD-style license found in the
|
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
|
6
6
|
|
|
7
|
+
# pyre-strict
|
|
8
|
+
|
|
7
9
|
"""
|
|
8
10
|
The ``torchx`` CLI is a commandline tool around :py:class:`torchx.runner.Runner`.
|
|
9
11
|
It allows users to launch :py:class:`torchx.specs.AppDef` directly onto
|
torchx/cli/argparse_util.py
CHANGED
|
@@ -4,19 +4,27 @@
|
|
|
4
4
|
# This source code is licensed under the BSD-style license found in the
|
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
|
6
6
|
|
|
7
|
+
# pyre-strict
|
|
8
|
+
|
|
9
|
+
import logging
|
|
10
|
+
import sys
|
|
7
11
|
from argparse import Action, ArgumentParser, Namespace
|
|
8
|
-
from typing import Any, Dict, Optional, Sequence, Text
|
|
12
|
+
from typing import Any, Dict, List, Optional, Sequence, Set, Text
|
|
9
13
|
|
|
10
14
|
from torchx.runner import config
|
|
11
15
|
|
|
16
|
+
logger: logging.Logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
12
18
|
|
|
13
|
-
class
|
|
19
|
+
class torchxconfig(Action):
|
|
14
20
|
"""
|
|
15
21
|
Custom argparse action that loads default torchx CLI options
|
|
16
22
|
from .torchxconfig file.
|
|
17
23
|
|
|
18
24
|
"""
|
|
19
25
|
|
|
26
|
+
called_args: Set[str] = set()
|
|
27
|
+
|
|
20
28
|
# since this action is used for each argparse argument
|
|
21
29
|
# load the config section for the subcmd once
|
|
22
30
|
_subcmd_configs: Dict[str, Dict[str, str]] = {}
|
|
@@ -64,13 +72,18 @@ class _torchxconfig(Action):
|
|
|
64
72
|
values: Any, # pyre-ignore[2] declared as Any in superclass Action
|
|
65
73
|
option_string: Optional[str] = None,
|
|
66
74
|
) -> None:
|
|
75
|
+
if option_string is not None:
|
|
76
|
+
if option_string in self.called_args:
|
|
77
|
+
logger.error(f"{option_string} is specified more than once")
|
|
78
|
+
sys.exit(1)
|
|
79
|
+
self.called_args.add(option_string)
|
|
67
80
|
setattr(namespace, self.dest, values)
|
|
68
81
|
|
|
69
82
|
|
|
70
83
|
# argparse takes the action as a Type[Action] so we can't have custom constructors
|
|
71
84
|
# hence for each subcommand we need to subclass the base _torchxconfig Action
|
|
72
85
|
# this is also how store_true and store_false builtin actions are implemented in argparse
|
|
73
|
-
class torchxconfig_run(
|
|
86
|
+
class torchxconfig_run(torchxconfig):
|
|
74
87
|
"""
|
|
75
88
|
Custom action that gets the default argument from .torchxconfig.
|
|
76
89
|
"""
|
|
@@ -92,3 +105,25 @@ class torchxconfig_run(_torchxconfig):
|
|
|
92
105
|
option_strings=option_strings,
|
|
93
106
|
**kwargs,
|
|
94
107
|
)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class ArgOnceAction(Action):
|
|
111
|
+
"""
|
|
112
|
+
Custom argparse action only allows argument to be specified once
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
called_args: Set[str] = set()
|
|
116
|
+
|
|
117
|
+
def __call__(
|
|
118
|
+
self,
|
|
119
|
+
parser: ArgumentParser,
|
|
120
|
+
namespace: Namespace,
|
|
121
|
+
values: List[str],
|
|
122
|
+
option_string: Optional[str] = None,
|
|
123
|
+
) -> None:
|
|
124
|
+
if option_string is not None:
|
|
125
|
+
if option_string in self.called_args:
|
|
126
|
+
logger.error(f"{option_string} is specified more than once")
|
|
127
|
+
sys.exit(1)
|
|
128
|
+
self.called_args.add(option_string)
|
|
129
|
+
setattr(namespace, self.dest, values)
|
torchx/cli/cmd_base.py
CHANGED
torchx/cli/cmd_cancel.py
CHANGED
torchx/cli/cmd_configure.py
CHANGED
torchx/cli/cmd_describe.py
CHANGED
torchx/cli/cmd_list.py
CHANGED
torchx/cli/cmd_log.py
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
# This source code is licensed under the BSD-style license found in the
|
|
6
6
|
# LICENSE file in the root directory of this source tree.
|
|
7
7
|
|
|
8
|
+
# pyre-strict
|
|
9
|
+
|
|
8
10
|
import argparse
|
|
9
11
|
import logging
|
|
10
12
|
import re
|
|
@@ -21,6 +23,10 @@ from torchx.runner import get_runner, Runner
|
|
|
21
23
|
from torchx.schedulers.api import Stream
|
|
22
24
|
from torchx.specs.api import is_started
|
|
23
25
|
from torchx.specs.builders import make_app_handle
|
|
26
|
+
from torchx.util.log_tee_helpers import (
|
|
27
|
+
_find_role_replicas as find_role_replicas,
|
|
28
|
+
_prefix_line,
|
|
29
|
+
)
|
|
24
30
|
|
|
25
31
|
from torchx.util.types import none_throws
|
|
26
32
|
|
|
@@ -37,19 +43,6 @@ def validate(job_identifier: str) -> None:
|
|
|
37
43
|
sys.exit(1)
|
|
38
44
|
|
|
39
45
|
|
|
40
|
-
def _prefix_line(prefix: str, line: str) -> str:
|
|
41
|
-
"""
|
|
42
|
-
_prefix_line ensure the prefix is still present even when dealing with return characters
|
|
43
|
-
"""
|
|
44
|
-
if "\r" in line:
|
|
45
|
-
line = line.replace("\r", f"\r{prefix}")
|
|
46
|
-
if "\n" in line[:-1]:
|
|
47
|
-
line = line[:-1].replace("\n", f"\n{prefix}") + line[-1:]
|
|
48
|
-
if not line.startswith("\r"):
|
|
49
|
-
line = f"{prefix}{line}"
|
|
50
|
-
return line
|
|
51
|
-
|
|
52
|
-
|
|
53
46
|
def print_log_lines(
|
|
54
47
|
file: TextIO,
|
|
55
48
|
runner: Runner,
|
|
@@ -165,17 +158,6 @@ def get_logs(
|
|
|
165
158
|
raise threads_exceptions[0]
|
|
166
159
|
|
|
167
160
|
|
|
168
|
-
def find_role_replicas(
|
|
169
|
-
app: specs.AppDef, role_name: Optional[str]
|
|
170
|
-
) -> List[Tuple[str, int]]:
|
|
171
|
-
role_replicas = []
|
|
172
|
-
for role in app.roles:
|
|
173
|
-
if role_name is None or role_name == role.name:
|
|
174
|
-
for i in range(role.num_replicas):
|
|
175
|
-
role_replicas.append((role.name, i))
|
|
176
|
-
return role_replicas
|
|
177
|
-
|
|
178
|
-
|
|
179
161
|
class CmdLog(SubCommand):
|
|
180
162
|
def add_arguments(self, subparser: argparse.ArgumentParser) -> None:
|
|
181
163
|
subparser.add_argument(
|
torchx/cli/cmd_run.py
CHANGED
|
@@ -4,20 +4,23 @@
|
|
|
4
4
|
# This source code is licensed under the BSD-style license found in the
|
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
|
6
6
|
|
|
7
|
+
# pyre-strict
|
|
8
|
+
|
|
7
9
|
import argparse
|
|
8
10
|
import logging
|
|
9
11
|
import os
|
|
10
12
|
import sys
|
|
11
13
|
import threading
|
|
14
|
+
from collections import Counter
|
|
12
15
|
from dataclasses import asdict
|
|
16
|
+
from itertools import groupby
|
|
13
17
|
from pathlib import Path
|
|
14
18
|
from pprint import pformat
|
|
15
19
|
from typing import Dict, List, Optional, Tuple
|
|
16
20
|
|
|
17
21
|
import torchx.specs as specs
|
|
18
|
-
from torchx.cli.argparse_util import torchxconfig_run
|
|
22
|
+
from torchx.cli.argparse_util import ArgOnceAction, torchxconfig_run
|
|
19
23
|
from torchx.cli.cmd_base import SubCommand
|
|
20
|
-
from torchx.cli.cmd_log import get_logs
|
|
21
24
|
from torchx.runner import config, get_runner, Runner
|
|
22
25
|
from torchx.runner.config import load_sections
|
|
23
26
|
from torchx.schedulers import get_default_scheduler_name, get_scheduler_factories
|
|
@@ -28,6 +31,7 @@ from torchx.specs.finder import (
|
|
|
28
31
|
get_builtin_source,
|
|
29
32
|
get_components,
|
|
30
33
|
)
|
|
34
|
+
from torchx.util.log_tee_helpers import tee_logs
|
|
31
35
|
from torchx.util.types import none_throws
|
|
32
36
|
|
|
33
37
|
|
|
@@ -82,6 +86,20 @@ def _parse_component_name_and_args(
|
|
|
82
86
|
component = args[0]
|
|
83
87
|
component_args = args[1:]
|
|
84
88
|
|
|
89
|
+
# Error if there are repeated command line arguments each group of arguments,
|
|
90
|
+
# where the groups are separated by "--"
|
|
91
|
+
arg_groups = [list(g) for _, g in groupby(component_args, key=lambda x: x == "--")]
|
|
92
|
+
for arg_group in arg_groups:
|
|
93
|
+
all_options = [
|
|
94
|
+
x
|
|
95
|
+
for x in arg_group
|
|
96
|
+
if x.startswith("-") and x.strip() != "-" and x.strip() != "--"
|
|
97
|
+
]
|
|
98
|
+
arg_count = Counter(all_options)
|
|
99
|
+
duplicates = [arg for arg, count in arg_count.items() if count > 1]
|
|
100
|
+
if len(duplicates) > 0:
|
|
101
|
+
subparser.error(f"Repeated Command Line Arguments: {duplicates}")
|
|
102
|
+
|
|
85
103
|
if not component:
|
|
86
104
|
subparser.error(MISSING_COMPONENT_ERROR_MSG)
|
|
87
105
|
|
|
@@ -131,6 +149,7 @@ class CmdRun(SubCommand):
|
|
|
131
149
|
"-cfg",
|
|
132
150
|
"--scheduler_args",
|
|
133
151
|
type=str,
|
|
152
|
+
action=ArgOnceAction,
|
|
134
153
|
help="Arguments to pass to the scheduler (Ex:`cluster=foo,user=bar`)."
|
|
135
154
|
" For a list of scheduler run options run: `torchx runopts`",
|
|
136
155
|
)
|
|
@@ -163,6 +182,7 @@ class CmdRun(SubCommand):
|
|
|
163
182
|
subparser.add_argument(
|
|
164
183
|
"--parent_run_id",
|
|
165
184
|
type=str,
|
|
185
|
+
action=ArgOnceAction,
|
|
166
186
|
help="optional parent run ID that this run belongs to."
|
|
167
187
|
" It can be used to group runs for experiment tracking purposes",
|
|
168
188
|
)
|
|
@@ -268,16 +288,14 @@ class CmdRun(SubCommand):
|
|
|
268
288
|
logger.debug(status)
|
|
269
289
|
|
|
270
290
|
def _start_log_thread(self, runner: Runner, app_handle: str) -> threading.Thread:
|
|
271
|
-
thread =
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
},
|
|
291
|
+
thread = tee_logs(
|
|
292
|
+
dst=sys.stderr,
|
|
293
|
+
app_handle=app_handle,
|
|
294
|
+
regex=None,
|
|
295
|
+
runner=runner,
|
|
296
|
+
should_tail=True,
|
|
297
|
+
streams=None,
|
|
298
|
+
colorize=not sys.stderr.closed and sys.stderr.isatty(),
|
|
280
299
|
)
|
|
281
|
-
thread.daemon = True
|
|
282
300
|
thread.start()
|
|
283
301
|
return thread
|
torchx/cli/cmd_runopts.py
CHANGED
torchx/cli/cmd_status.py
CHANGED
torchx/cli/cmd_tracker.py
CHANGED
torchx/cli/colors.py
CHANGED
torchx/cli/main.py
CHANGED
torchx/components/__init__.py
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
# This source code is licensed under the BSD-style license found in the
|
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
|
6
6
|
|
|
7
|
+
# pyre-strict
|
|
8
|
+
|
|
7
9
|
"""
|
|
8
10
|
This module contains a collection of builtin TorchX components. The directory
|
|
9
11
|
structure is organized by component category. Components are simply
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
# This source code is licensed under the BSD-style license found in the
|
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
|
6
6
|
|
|
7
|
+
# pyre-strict
|
|
8
|
+
|
|
7
9
|
"""
|
|
8
10
|
You can unit test the component definitions as you would normal Python code
|
|
9
11
|
since they are valid Python definitions.
|
torchx/components/dist.py
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
# This source code is licensed under the BSD-style license found in the
|
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
|
6
6
|
|
|
7
|
+
# pyre-strict
|
|
8
|
+
|
|
7
9
|
"""
|
|
8
10
|
For distributed training, TorchX relies on the scheduler's gang scheduling
|
|
9
11
|
capabilities to schedule ``n`` copies of nodes. Once launched, the application
|
torchx/components/serve.py
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
# This source code is licensed under the BSD-style license found in the
|
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
|
6
6
|
|
|
7
|
+
# pyre-strict
|
|
8
|
+
|
|
7
9
|
"""
|
|
8
10
|
These components aim to make it easier to interact with inference and serving
|
|
9
11
|
tools such as `torchserve <https://pytorch.org/serve/>`_.
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
# This source code is licensed under the BSD-style license found in the
|
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
|
6
6
|
|
|
7
|
+
# pyre-strict
|
|
8
|
+
|
|
7
9
|
"""
|
|
8
10
|
Defines methods for structured (higher order) component argument parsing.
|
|
9
11
|
Use the functionalities defined in this module to author components
|
torchx/components/utils.py
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
# This source code is licensed under the BSD-style license found in the
|
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
|
6
6
|
|
|
7
|
+
# pyre-strict
|
|
8
|
+
|
|
7
9
|
"""
|
|
8
10
|
This contains TorchX utility components that are `ready-to-use` out of the box. These are
|
|
9
11
|
components that simply execute well known binaries (e.g. ``cp``)
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
# This source code is licensed under the BSD-style license found in the
|
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
|
6
6
|
|
|
7
|
+
# pyre-strict
|
|
8
|
+
|
|
7
9
|
"""
|
|
8
10
|
Trainer Datasets Example
|
|
9
11
|
========================
|
|
@@ -62,17 +64,17 @@ class ImageFolderSamplesDataset(datasets.ImageFolder):
|
|
|
62
64
|
# our trainer and other components that need to load data.
|
|
63
65
|
|
|
64
66
|
|
|
65
|
-
# pyre-fixme[13]: Attribute `test_ds` is never initialized.
|
|
66
|
-
# pyre-fixme[13]: Attribute `train_ds` is never initialized.
|
|
67
|
-
# pyre-fixme[13]: Attribute `val_ds` is never initialized.
|
|
68
67
|
class TinyImageNetDataModule(pl.LightningDataModule):
|
|
69
68
|
"""
|
|
70
69
|
TinyImageNetDataModule is a pytorch LightningDataModule for the tiny
|
|
71
70
|
imagenet dataset.
|
|
72
71
|
"""
|
|
73
72
|
|
|
73
|
+
# pyre-fixme[13]: Attribute `test_ds` is never initialized.
|
|
74
74
|
train_ds: ImageFolderSamplesDataset
|
|
75
|
+
# pyre-fixme[13]: Attribute `train_ds` is never initialized.
|
|
75
76
|
val_ds: ImageFolderSamplesDataset
|
|
77
|
+
# pyre-fixme[13]: Attribute `val_ds` is never initialized.
|
|
76
78
|
test_ds: ImageFolderSamplesDataset
|
|
77
79
|
|
|
78
80
|
def __init__(
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
# This source code is licensed under the BSD-style license found in the
|
|
6
6
|
# LICENSE file in the root directory of this source tree.
|
|
7
7
|
|
|
8
|
+
# pyre-strict
|
|
9
|
+
|
|
8
10
|
"""
|
|
9
11
|
Simple Logging Profiler
|
|
10
12
|
===========================
|
|
@@ -17,18 +19,19 @@ output is used for HPO optimization with Ax.
|
|
|
17
19
|
import time
|
|
18
20
|
from typing import Dict
|
|
19
21
|
|
|
20
|
-
from pytorch_lightning.loggers.
|
|
21
|
-
|
|
22
|
+
from pytorch_lightning.loggers.logger import Logger
|
|
23
|
+
|
|
24
|
+
from pytorch_lightning.profilers.profiler import Profiler
|
|
22
25
|
|
|
23
26
|
|
|
24
|
-
class SimpleLoggingProfiler(
|
|
27
|
+
class SimpleLoggingProfiler(Profiler):
|
|
25
28
|
"""
|
|
26
29
|
This profiler records the duration of actions (in seconds) and reports the
|
|
27
30
|
mean duration of each action to the specified logger. Reported metrics are
|
|
28
31
|
in the format `duration_<event>`.
|
|
29
32
|
"""
|
|
30
33
|
|
|
31
|
-
def __init__(self, logger:
|
|
34
|
+
def __init__(self, logger: Logger) -> None:
|
|
32
35
|
super().__init__()
|
|
33
36
|
|
|
34
37
|
self.current_actions: Dict[str, float] = {}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
# This source code is licensed under the BSD-style license found in the
|
|
6
6
|
# LICENSE file in the root directory of this source tree.
|
|
7
7
|
|
|
8
|
+
# pyre-strict
|
|
9
|
+
|
|
8
10
|
"""
|
|
9
11
|
Distributed KubeFlow Pipelines Example
|
|
10
12
|
======================================
|
|
@@ -58,7 +60,7 @@ with open("pipeline.yaml", "rt") as f:
|
|
|
58
60
|
# a kfp.Client.
|
|
59
61
|
#
|
|
60
62
|
# See the
|
|
61
|
-
# `KFP SDK Examples <https://www.kubeflow.org/docs/components/pipelines/tutorials/sdk-examples/#examples>`_
|
|
63
|
+
# `KFP SDK Examples <https://www.kubeflow.org/docs/components/pipelines/legacy-v1/tutorials/sdk-examples/#examples>`_
|
|
62
64
|
# for more info on launching KFP pipelines.
|
|
63
65
|
|
|
64
66
|
# %%
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
# This source code is licensed under the BSD-style license found in the
|
|
6
6
|
# LICENSE file in the root directory of this source tree.
|
|
7
7
|
|
|
8
|
+
# pyre-strict
|
|
9
|
+
|
|
8
10
|
"""
|
|
9
11
|
Intro KubeFlow Pipelines Example
|
|
10
12
|
================================
|
|
@@ -71,7 +73,7 @@ with open("pipeline.yaml", "rt") as f:
|
|
|
71
73
|
# a kfp.Client.
|
|
72
74
|
#
|
|
73
75
|
# See the
|
|
74
|
-
# `KFP SDK Examples <https://www.kubeflow.org/docs/components/pipelines/tutorials/sdk-examples/#examples>`_
|
|
76
|
+
# `KFP SDK Examples <https://www.kubeflow.org/docs/components/pipelines/legacy-v1/tutorials/sdk-examples/#examples>`_
|
|
75
77
|
# for more info on launching KFP pipelines.
|
|
76
78
|
|
|
77
79
|
# %%
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
# This file is for lex team to ramp up on torchX OSS. It's for training purpose.
|
|
11
|
+
# Please DO NOT modify this file unless you know what you are doing.
|
torchx/notebook.py
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
# This source code is licensed under the BSD-style license found in the
|
|
6
6
|
# LICENSE file in the root directory of this source tree.
|
|
7
7
|
|
|
8
|
+
# pyre-strict
|
|
9
|
+
|
|
8
10
|
"""
|
|
9
11
|
This contains TorchX utilities for creating and running components and apps from
|
|
10
12
|
an Jupyter/IPython Notebook.
|
torchx/pipelines/kfp/__init__.py
CHANGED