torchx-nightly 2024.12.10__py3-none-any.whl → 2024.12.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.
@@ -64,17 +64,17 @@ class ImageFolderSamplesDataset(datasets.ImageFolder):
64
64
  # our trainer and other components that need to load data.
65
65
 
66
66
 
67
- # pyre-fixme[13]: Attribute `test_ds` is never initialized.
68
- # pyre-fixme[13]: Attribute `train_ds` is never initialized.
69
- # pyre-fixme[13]: Attribute `val_ds` is never initialized.
70
67
  class TinyImageNetDataModule(pl.LightningDataModule):
71
68
  """
72
69
  TinyImageNetDataModule is a pytorch LightningDataModule for the tiny
73
70
  imagenet dataset.
74
71
  """
75
72
 
73
+ # pyre-fixme[13]: Attribute `test_ds` is never initialized.
76
74
  train_ds: ImageFolderSamplesDataset
75
+ # pyre-fixme[13]: Attribute `train_ds` is never initialized.
77
76
  val_ds: ImageFolderSamplesDataset
77
+ # pyre-fixme[13]: Attribute `val_ds` is never initialized.
78
78
  test_ds: ImageFolderSamplesDataset
79
79
 
80
80
  def __init__(
@@ -50,7 +50,9 @@ def component_spec_from_app(app: api.AppDef) -> Tuple[str, api.Role]:
50
50
 
51
51
  role = app.roles[0]
52
52
  assert (
53
- role.num_replicas == 1
53
+ role.num_replicas
54
+ == 1
55
+ # pyre-fixme[16]: `AppDef` has no attribute `num_replicas`.
54
56
  ), f"KFP adapter only supports one replica, got {app.num_replicas}"
55
57
 
56
58
  command = [role.entrypoint, *role.args]
torchx/runner/api.py CHANGED
@@ -433,7 +433,7 @@ class Runner:
433
433
  " Either a patch was built or no changes to workspace was detected."
434
434
  )
435
435
 
436
- sched._validate(app, scheduler)
436
+ sched._validate(app, scheduler, resolved_cfg)
437
437
  dryrun_info = sched.submit_dryrun(app, resolved_cfg)
438
438
  dryrun_info._scheduler = scheduler
439
439
  return dryrun_info
torchx/schedulers/api.py CHANGED
@@ -337,7 +337,7 @@ class Scheduler(abc.ABC, Generic[T]):
337
337
  f"{self.__class__.__qualname__} does not support application log iteration"
338
338
  )
339
339
 
340
- def _validate(self, app: AppDef, scheduler: str) -> None:
340
+ def _validate(self, app: AppDef, scheduler: str, cfg: T) -> None:
341
341
  """
342
342
  Validates whether application is consistent with the scheduler.
343
343
 
@@ -809,6 +809,8 @@ class AWSBatchScheduler(DockerWorkspaceMixin, Scheduler[AWSBatchOpts]):
809
809
  startFromHead=True,
810
810
  **args,
811
811
  )
812
+ # pyre-fixme[66]: Exception handler type annotation `unknown` must
813
+ # extend BaseException.
812
814
  except self._log_client.exceptions.ResourceNotFoundException:
813
815
  return [] # noqa: B901
814
816
  if response["nextForwardToken"] == next_token:
@@ -1,4 +1,10 @@
1
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
+
2
8
 
3
9
  import getpass
4
10
  import os
@@ -261,9 +267,9 @@ class AWSSageMakerScheduler(DockerWorkspaceMixin, Scheduler[AWSSageMakerOpts]):
261
267
  raise ValueError(
262
268
  f"{key} is controlled by aws_sagemaker_scheduler and is set to {job_def[key]}"
263
269
  )
264
- value = cfg.get(key) # pyre-ignore[26]
270
+ value = cfg.get(key) # type: ignore
265
271
  if value is not None:
266
- job_def[key] = value
272
+ job_def[key] = value # type: ignore
267
273
 
268
274
  req = AWSSageMakerJob(
269
275
  job_name=job_name,
@@ -327,7 +327,7 @@ class DockerScheduler(DockerWorkspaceMixin, Scheduler[DockerOpts]):
327
327
 
328
328
  return AppDryRunInfo(req, repr)
329
329
 
330
- def _validate(self, app: AppDef, scheduler: str) -> None:
330
+ def _validate(self, app: AppDef, scheduler: str, cfg: DockerOpts) -> None:
331
331
  # Skip validation step
332
332
  pass
333
333
 
@@ -464,7 +464,7 @@ class GCPBatchScheduler(Scheduler[GCPBatchOpts]):
464
464
  for job in all_jobs
465
465
  ]
466
466
 
467
- def _validate(self, app: AppDef, scheduler: str) -> None:
467
+ def _validate(self, app: AppDef, scheduler: str, cfg: GCPBatchOpts) -> None:
468
468
  # Skip validation step
469
469
  pass
470
470
 
@@ -1033,7 +1033,7 @@ class KubernetesMCADScheduler(DockerWorkspaceMixin, Scheduler[KubernetesMCADOpts
1033
1033
  info._cfg = cfg
1034
1034
  return info
1035
1035
 
1036
- def _validate(self, app: AppDef, scheduler: str) -> None:
1036
+ def _validate(self, app: AppDef, scheduler: str, cfg: KubernetesMCADOpts) -> None:
1037
1037
  # Skip validation step
1038
1038
  pass
1039
1039
 
@@ -661,7 +661,7 @@ class KubernetesScheduler(DockerWorkspaceMixin, Scheduler[KubernetesOpts]):
661
661
  )
662
662
  return AppDryRunInfo(req, repr)
663
663
 
664
- def _validate(self, app: AppDef, scheduler: str) -> None:
664
+ def _validate(self, app: AppDef, scheduler: str, cfg: KubernetesOpts) -> None:
665
665
  # Skip validation step
666
666
  pass
667
667
 
@@ -630,7 +630,7 @@ class LocalScheduler(Scheduler[LocalOpts]):
630
630
  )
631
631
  return opts
632
632
 
633
- def _validate(self, app: AppDef, scheduler: str) -> None:
633
+ def _validate(self, app: AppDef, scheduler: str, cfg: LocalOpts) -> None:
634
634
  # Skip validation step for local application
635
635
  pass
636
636
 
@@ -488,7 +488,7 @@ class LsfScheduler(Scheduler[LsfOpts]):
488
488
  subprocess.run(req.cmd, stdout=subprocess.PIPE, check=True)
489
489
  return req.app_id
490
490
 
491
- def _validate(self, app: AppDef, scheduler: str) -> None:
491
+ def _validate(self, app: AppDef, scheduler: str, cfg: LsfOpts) -> None:
492
492
  # Skip validation step for lsf
493
493
  pass
494
494
 
@@ -116,7 +116,7 @@ def load_actor_json(filename: str) -> List[RayActor]:
116
116
  return actors
117
117
 
118
118
 
119
- def create_placement_group_async(replicas: List[RayActor]) -> PlacementGroup:
119
+ def create_placement_group_async(replicas: List[RayActor]) -> PlacementGroup: # type: ignore
120
120
  """return a placement group reference, the corresponding placement group could be scheduled or pending"""
121
121
  bundles = []
122
122
  for replica in replicas:
@@ -318,7 +318,7 @@ if _has_ray:
318
318
 
319
319
  return AppDryRunInfo(job, repr)
320
320
 
321
- def _validate(self, app: AppDef, scheduler: str) -> None:
321
+ def _validate(self, app: AppDef, scheduler: str, cfg: RayOpts) -> None:
322
322
  if scheduler != "ray":
323
323
  raise ValueError(
324
324
  f"An unknown scheduler backend '{scheduler}' has been passed to the Ray scheduler."
@@ -472,7 +472,7 @@ class SlurmScheduler(DirWorkspaceMixin, Scheduler[SlurmOpts]):
472
472
 
473
473
  return AppDryRunInfo(req, repr)
474
474
 
475
- def _validate(self, app: AppDef, scheduler: str) -> None:
475
+ def _validate(self, app: AppDef, scheduler: str, cfg: SlurmOpts) -> None:
476
476
  # Skip validation step for slurm
477
477
  pass
478
478
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: torchx-nightly
3
- Version: 2024.12.10
3
+ Version: 2024.12.14
4
4
  Summary: TorchX SDK and Components
5
5
  Home-page: https://github.com/pytorch/torchx
6
6
  Author: TorchX Devs
@@ -53,7 +53,7 @@ Requires-Dist: pytest; extra == "dev"
53
53
  Requires-Dist: pytest-cov; extra == "dev"
54
54
  Requires-Dist: pytorch-lightning==2.3.1; extra == "dev"
55
55
  Requires-Dist: tensorboard==2.14.0; extra == "dev"
56
- Requires-Dist: sagemaker>=2.149.0; extra == "dev"
56
+ Requires-Dist: sagemaker==2.224.4; extra == "dev"
57
57
  Requires-Dist: torch-model-archiver>=0.4.2; extra == "dev"
58
58
  Requires-Dist: torch==2.2.1; extra == "dev"
59
59
  Requires-Dist: torchmetrics==0.10.3; extra == "dev"
@@ -41,7 +41,7 @@ torchx/examples/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
41
41
  torchx/examples/apps/datapreproc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  torchx/examples/apps/datapreproc/datapreproc.py,sha256=cu88O_WZgqZ6g7jVIG2kagAVbJ4oPMzTH03_H65w8RU,4317
43
43
  torchx/examples/apps/lightning/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
- torchx/examples/apps/lightning/data.py,sha256=Sp9mv29FlCtMdMeSKOrHan_QHK-h_crCIkCXopb20kQ,6598
44
+ torchx/examples/apps/lightning/data.py,sha256=kSv_DFqtFVkNjZ46HT7GApImc9lMD7liy929dUrFWwM,6610
45
45
  torchx/examples/apps/lightning/interpret.py,sha256=Hd3kE5a6FyhxCmJBfTzb4Tlj518zhX8V0XvZfzu4nqE,5256
46
46
  torchx/examples/apps/lightning/model.py,sha256=ppj8pYkJ1Zj4kZX6JXULGgx3sYVfNIQ24OuDYXc5lYo,3947
47
47
  torchx/examples/apps/lightning/profiler.py,sha256=SSSihnwjeUTkBoz0E3qn1b-wbkfUIowscx2ND_37zyw,1915
@@ -53,10 +53,10 @@ torchx/examples/pipelines/kfp/dist_pipeline.py,sha256=xFn59P1S22o2zOJ2LhlIkhjYH3
53
53
  torchx/examples/pipelines/kfp/intro_pipeline.py,sha256=oWdMHPLWf5nKRm0hS7psF0yUp8Tf7tfR-Sm3YuUCmWk,2776
54
54
  torchx/pipelines/__init__.py,sha256=2MbRVk5xwRjg-d2qPemeXpEhDsocMQumPQ53lsesZAI,606
55
55
  torchx/pipelines/kfp/__init__.py,sha256=8iJ8lql_fxwuk9VCYSxXnX6tPL228fB5mDZpOs-kpn4,736
56
- torchx/pipelines/kfp/adapter.py,sha256=V96Rg2ypas0ZpNNn4ojplJMmC5vcBfcuxAITaY8PV_M,8969
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=vssTNIDB0O28QchZOowIvEcBE9GK1EDcmFu0pBu5vTU,29324
59
+ torchx/runner/api.py,sha256=uI365qobKvTP6-fEAiGrVlBzipYDhy1L8RoOJ1BQ3mA,29338
60
60
  torchx/runner/config.py,sha256=fTdCcf-MKlBg6MzXopF4W0hYyDDoPAuvZs2v2bKzwG0,17849
61
61
  torchx/runner/events/__init__.py,sha256=1_y0bojXl3FL0zlAj7BI4Dg5cXKXUmaa2jZbVH0EDUA,5268
62
62
  torchx/runner/events/api.py,sha256=pPLfowWTXtN_XcrEDNI45pE6Ijvdc_Gdxq76RduqgGE,2664
@@ -65,23 +65,23 @@ torchx/runtime/__init__.py,sha256=Wxje2BryzeQneFu5r6P9JJiEKG-_C9W1CcZ_JNrKT6g,59
65
65
  torchx/runtime/tracking/__init__.py,sha256=dYnAPnrXYREfPXkpHhdOFkcYIODWEbA13PdD-wLQYBo,3055
66
66
  torchx/runtime/tracking/api.py,sha256=SmUQyUKZqG3KlAhT7CJOGqRz1O274E4m63wQeOVq3CU,5472
67
67
  torchx/schedulers/__init__.py,sha256=M9SBZiNdE3KI_yc1-BiRtAetfTgtX07uKkuvGUeZQLU,2230
68
- torchx/schedulers/api.py,sha256=s2hI87uAWtU2SHMNBKjAqelzQU_GKp_BjcxdtjVVDDk,14155
69
- torchx/schedulers/aws_batch_scheduler.py,sha256=7qxy3UFRq0F731-kTjEi6VABWKD60o0req6CBMsTohU,27975
70
- torchx/schedulers/aws_sagemaker_scheduler.py,sha256=dPah3yaKFUVm-ZZrzFbyM_abP-LCTd-AcAjZ6t2iycU,20699
68
+ torchx/schedulers/api.py,sha256=jAjfTKNgw26Rc5-FsZCSFt1xQIBNzXdUjUeOlllCuIU,14163
69
+ torchx/schedulers/aws_batch_scheduler.py,sha256=8jRTmi5gtqyKUQfhMRqCQqNVM0drXdu8RS0xUfZby48,28091
70
+ torchx/schedulers/aws_sagemaker_scheduler.py,sha256=x33J_tQFpRr_AUv5dWf1qxqG0dbmIjaqFHyrSnHWijw,20921
71
71
  torchx/schedulers/devices.py,sha256=RjVcu22ZRl_9OKtOtmA1A3vNXgu2qD6A9ST0L0Hsg4I,1734
72
- torchx/schedulers/docker_scheduler.py,sha256=K6dVjhl7yGoHu-OolcdTU6bZ_NDat5bK9WbU-EwPcKY,16753
73
- torchx/schedulers/gcp_batch_scheduler.py,sha256=dlUfvjfMuQiRcSXQAdwxqdadwPhOf82L5u-ejRWtFgE,16226
72
+ torchx/schedulers/docker_scheduler.py,sha256=goeFEgEi0H3sagIDSsGPMOU9f-mcMbEFPo2gwHOco1k,16770
73
+ torchx/schedulers/gcp_batch_scheduler.py,sha256=o0t70s7fpGgn8MqhkIPWV3ZuF0kc5KdLGYz5-YKVb9Y,16245
74
74
  torchx/schedulers/ids.py,sha256=3E-_vwVYC-8Tv8kjuY9-W7TbOe_-Laqd8a65uIN3hQY,1798
75
- torchx/schedulers/kubernetes_mcad_scheduler.py,sha256=OydTS_ObvVFSuo3utidmSQjK6Yzzqus19bMH-5LLY_M,42900
76
- torchx/schedulers/kubernetes_scheduler.py,sha256=wruPyQGpXgWZ5WzM8qIGzgLx97qxU6nBeQ5trJNWWXU,28172
77
- torchx/schedulers/local_scheduler.py,sha256=1xAEAymKqhxYYll4JmKNPWkIGSSro_2JxyLVOisiWTs,41428
78
- torchx/schedulers/lsf_scheduler.py,sha256=FhpI8KgYKySz6xMTLmy0IcesJk2SpJ_no-iRzpqV0Wk,17653
79
- torchx/schedulers/ray_scheduler.py,sha256=unnDtDu1rPpCLJLDcm4NYRo9ZCCtQgG5BtlHwVfly-U,17448
80
- torchx/schedulers/slurm_scheduler.py,sha256=_57XhN9ggFaD6ZG9cPXkAlcHoF-R5mPmAvqPwhNJ4qw,19370
75
+ torchx/schedulers/kubernetes_mcad_scheduler.py,sha256=riUfzSBega0JcCbV9NspU_a5A46AD-74Jgf7JPvA2Is,42925
76
+ torchx/schedulers/kubernetes_scheduler.py,sha256=W_vVvQVGjNUoasN-JIsOTU9f0qjpds2u3GteNblssGM,28193
77
+ torchx/schedulers/local_scheduler.py,sha256=q_EkCjsf66X0QQXSynP-G5wT4rGS5HLk4F68KdsaE4g,41444
78
+ torchx/schedulers/lsf_scheduler.py,sha256=BkXKyWoVrCZznjfRFQ8oW3vzM0sBGkGmGUcSX71D-nE,17667
79
+ torchx/schedulers/ray_scheduler.py,sha256=d10PtA-sEfHmDxF-GKog_Qro7FpIDCjSZbkKBdyj72E,17462
80
+ torchx/schedulers/slurm_scheduler.py,sha256=A11XvI0-Wa7n3qc1IdrYcDaQEZhj0GiGf-PjHj0Byn8,19386
81
81
  torchx/schedulers/streams.py,sha256=8_SLezgnWgfv_zXUsJCUM34-h2dtv25NmZuxEwkzmxw,2007
82
82
  torchx/schedulers/ray/__init__.py,sha256=fE0IHi1JJpxsNVBNzWNee2thrNXFFRhY94c80RxNSIE,231
83
83
  torchx/schedulers/ray/ray_common.py,sha256=pyNYFvTKVwdjDAeCBNbPwAWwVNmlLOJWExfn90XY8u8,610
84
- torchx/schedulers/ray/ray_driver.py,sha256=Wl-1jldL8veVKzmYDEeR2va3JSlAjZpFE1h8HWE9YVE,12286
84
+ torchx/schedulers/ray/ray_driver.py,sha256=RdaCLfth16ky-5PDVOWRe_RuheWJu9xufWux2F9T7iw,12302
85
85
  torchx/specs/__init__.py,sha256=T8xUCz7iVE6OsUL5P4Pzy2B8ZY_YinCVDwUer5Q-XPc,6179
86
86
  torchx/specs/api.py,sha256=EI1tXPfDrz8dAyjJsuNK9mL4femS44lUuJFJUCW_oSc,37540
87
87
  torchx/specs/builders.py,sha256=QDcQrnCO4bdSaiP0216XbCgTsnLutO_1_FW5jDiEIWI,9939
@@ -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-2024.12.10.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
119
- torchx_nightly-2024.12.10.dist-info/METADATA,sha256=FTG5LRWZG3gJMG9XPrIrnZdTciZCdC8NJLJ8bHVT-Ak,6170
120
- torchx_nightly-2024.12.10.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
121
- torchx_nightly-2024.12.10.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
122
- torchx_nightly-2024.12.10.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
123
- torchx_nightly-2024.12.10.dist-info/RECORD,,
118
+ torchx_nightly-2024.12.14.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
119
+ torchx_nightly-2024.12.14.dist-info/METADATA,sha256=hK3et9bnzRVNh2M4lggLSSHkVT-r08Ef1PWRK_5y2oQ,6170
120
+ torchx_nightly-2024.12.14.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
121
+ torchx_nightly-2024.12.14.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
122
+ torchx_nightly-2024.12.14.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
123
+ torchx_nightly-2024.12.14.dist-info/RECORD,,