torchx-nightly 2024.2.11__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.

Files changed (102) hide show
  1. torchx/__init__.py +2 -0
  2. torchx/apps/serve/serve.py +2 -0
  3. torchx/apps/utils/booth_main.py +2 -0
  4. torchx/apps/utils/copy_main.py +2 -0
  5. torchx/apps/utils/process_monitor.py +2 -0
  6. torchx/cli/__init__.py +2 -0
  7. torchx/cli/argparse_util.py +38 -3
  8. torchx/cli/cmd_base.py +2 -0
  9. torchx/cli/cmd_cancel.py +2 -0
  10. torchx/cli/cmd_configure.py +2 -0
  11. torchx/cli/cmd_describe.py +2 -0
  12. torchx/cli/cmd_list.py +2 -0
  13. torchx/cli/cmd_log.py +6 -24
  14. torchx/cli/cmd_run.py +30 -12
  15. torchx/cli/cmd_runopts.py +2 -0
  16. torchx/cli/cmd_status.py +2 -0
  17. torchx/cli/cmd_tracker.py +2 -0
  18. torchx/cli/colors.py +2 -0
  19. torchx/cli/main.py +2 -0
  20. torchx/components/__init__.py +2 -0
  21. torchx/components/component_test_base.py +2 -0
  22. torchx/components/dist.py +2 -0
  23. torchx/components/integration_tests/component_provider.py +2 -0
  24. torchx/components/integration_tests/integ_tests.py +2 -0
  25. torchx/components/serve.py +2 -0
  26. torchx/components/structured_arg.py +2 -0
  27. torchx/components/utils.py +2 -0
  28. torchx/examples/apps/datapreproc/datapreproc.py +2 -0
  29. torchx/examples/apps/lightning/data.py +5 -3
  30. torchx/examples/apps/lightning/model.py +2 -0
  31. torchx/examples/apps/lightning/profiler.py +7 -4
  32. torchx/examples/apps/lightning/train.py +2 -0
  33. torchx/examples/pipelines/kfp/advanced_pipeline.py +2 -0
  34. torchx/examples/pipelines/kfp/dist_pipeline.py +3 -1
  35. torchx/examples/pipelines/kfp/intro_pipeline.py +3 -1
  36. torchx/examples/torchx_out_of_sync_training.py +11 -0
  37. torchx/notebook.py +2 -0
  38. torchx/pipelines/kfp/__init__.py +2 -0
  39. torchx/pipelines/kfp/adapter.py +7 -4
  40. torchx/pipelines/kfp/version.py +2 -0
  41. torchx/runner/__init__.py +2 -0
  42. torchx/runner/api.py +78 -20
  43. torchx/runner/config.py +34 -3
  44. torchx/runner/events/__init__.py +37 -3
  45. torchx/runner/events/api.py +13 -2
  46. torchx/runner/events/handlers.py +2 -0
  47. torchx/runtime/tracking/__init__.py +2 -0
  48. torchx/runtime/tracking/api.py +2 -0
  49. torchx/schedulers/__init__.py +10 -5
  50. torchx/schedulers/api.py +3 -1
  51. torchx/schedulers/aws_batch_scheduler.py +4 -0
  52. torchx/schedulers/aws_sagemaker_scheduler.py +596 -0
  53. torchx/schedulers/devices.py +17 -4
  54. torchx/schedulers/docker_scheduler.py +38 -8
  55. torchx/schedulers/gcp_batch_scheduler.py +8 -9
  56. torchx/schedulers/ids.py +2 -0
  57. torchx/schedulers/kubernetes_mcad_scheduler.py +3 -1
  58. torchx/schedulers/kubernetes_scheduler.py +31 -5
  59. torchx/schedulers/local_scheduler.py +45 -6
  60. torchx/schedulers/lsf_scheduler.py +3 -1
  61. torchx/schedulers/ray/ray_driver.py +7 -7
  62. torchx/schedulers/ray_scheduler.py +1 -1
  63. torchx/schedulers/slurm_scheduler.py +3 -1
  64. torchx/schedulers/streams.py +2 -0
  65. torchx/specs/__init__.py +49 -8
  66. torchx/specs/api.py +87 -5
  67. torchx/specs/builders.py +61 -19
  68. torchx/specs/file_linter.py +8 -2
  69. torchx/specs/finder.py +2 -0
  70. torchx/specs/named_resources_aws.py +109 -2
  71. torchx/specs/named_resources_generic.py +2 -0
  72. torchx/specs/test/components/__init__.py +2 -0
  73. torchx/specs/test/components/a/__init__.py +2 -0
  74. torchx/specs/test/components/a/b/__init__.py +2 -0
  75. torchx/specs/test/components/a/b/c.py +2 -0
  76. torchx/specs/test/components/c/__init__.py +2 -0
  77. torchx/specs/test/components/c/d.py +2 -0
  78. torchx/tracker/__init__.py +2 -0
  79. torchx/tracker/api.py +4 -4
  80. torchx/tracker/backend/fsspec.py +2 -0
  81. torchx/util/cuda.py +2 -0
  82. torchx/util/datetime.py +2 -0
  83. torchx/util/entrypoints.py +6 -2
  84. torchx/util/io.py +2 -0
  85. torchx/util/log_tee_helpers.py +210 -0
  86. torchx/util/modules.py +2 -0
  87. torchx/util/session.py +42 -0
  88. torchx/util/shlex.py +2 -0
  89. torchx/util/strings.py +2 -0
  90. torchx/util/types.py +20 -2
  91. torchx/version.py +3 -1
  92. torchx/workspace/__init__.py +2 -0
  93. torchx/workspace/api.py +34 -1
  94. torchx/workspace/dir_workspace.py +2 -0
  95. torchx/workspace/docker_workspace.py +25 -2
  96. {torchx_nightly-2024.2.11.dist-info → torchx_nightly-2025.1.14.dist-info}/METADATA +55 -48
  97. torchx_nightly-2025.1.14.dist-info/RECORD +123 -0
  98. {torchx_nightly-2024.2.11.dist-info → torchx_nightly-2025.1.14.dist-info}/WHEEL +1 -1
  99. {torchx_nightly-2024.2.11.dist-info → torchx_nightly-2025.1.14.dist-info}/entry_points.txt +0 -1
  100. torchx_nightly-2024.2.11.dist-info/RECORD +0 -119
  101. {torchx_nightly-2024.2.11.dist-info → torchx_nightly-2025.1.14.dist-info}/LICENSE +0 -0
  102. {torchx_nightly-2024.2.11.dist-info → torchx_nightly-2025.1.14.dist-info}/top_level.txt +0 -0
torchx/__init__.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
  from .version import ( # noqa F401; noqa F401
9
11
  __version__ as __version__,
10
12
  TORCHX_IMAGE as IMAGE,
@@ -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 binascii
10
12
  import os
@@ -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 sys
10
12
  from typing import List
@@ -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 os
10
12
  import shutil
@@ -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 subprocess
10
12
  import sys
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
@@ -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 _torchxconfig(Action):
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(_torchxconfig):
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
@@ -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
  import abc
8
10
  import argparse
9
11
 
torchx/cli/cmd_cancel.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
 
@@ -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 sys
@@ -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 dataclasses
10
12
  import logging
torchx/cli/cmd_list.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
 
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 = threading.Thread(
272
- target=get_logs,
273
- kwargs={
274
- "file": sys.stderr,
275
- "runner": runner,
276
- "identifier": app_handle,
277
- "regex": None,
278
- "should_tail": True,
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
@@ -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
 
torchx/cli/cmd_status.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 sys
torchx/cli/cmd_tracker.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
  import argparse
8
10
  import logging
9
11
 
torchx/cli/colors.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 sys
9
11
 
10
12
  # only print colors if outputting directly to a terminal
torchx/cli/main.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
  import logging
8
10
  import os
9
11
  import sys
@@ -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
@@ -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
  import os
8
10
  import tempfile
9
11
  from abc import ABC, abstractmethod
@@ -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
  import inspect
8
10
  import logging
9
11
  import sys
@@ -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
@@ -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``)
@@ -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
  Data Preprocessing App Example
10
12
  ====================================
@@ -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__(
@@ -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
  Tiny ImageNet Model
9
11
  ====================
@@ -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.base import LightningLoggerBase
21
- from pytorch_lightning.profiler.base import BaseProfiler
22
+ from pytorch_lightning.loggers.logger import Logger
23
+
24
+ from pytorch_lightning.profilers.profiler import Profiler
22
25
 
23
26
 
24
- class SimpleLoggingProfiler(BaseProfiler):
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: LightningLoggerBase) -> None:
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
  Trainer Example
10
12
  =============================================
@@ -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
  Advanced KubeFlow Pipelines Example
10
12
  ===================================
@@ -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.
@@ -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 module contains adapters for converting TorchX components into KubeFlow
10
12
  Pipeline components.