experimaestro 1.8.5__py3-none-any.whl → 1.8.7__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 experimaestro might be problematic. Click here for more details.

@@ -73,7 +73,7 @@ class SerializationContext:
73
73
 
74
74
 
75
75
  class SerializedPathLoader(Protocol):
76
- def __call__(path: Union[Path, str, SerializedPath]) -> Path:
76
+ def __call__(self, path: Union[Path, str, SerializedPath]) -> Path:
77
77
  """Get a filesystem path from a relative path
78
78
 
79
79
  :param path: The relative path
@@ -66,7 +66,8 @@ def save(obj: Any, save_directory: Optional[Path]):
66
66
  def get_data_loader(path: Union[str, Path, SerializedPathLoader]):
67
67
  if path is None:
68
68
 
69
- def data_loader():
69
+ def data_loader(_: Union[str, Path, SerializedPathLoader]):
70
+ # Just raise an exception
70
71
  raise RuntimeError("No serialization path was given")
71
72
 
72
73
  return data_loader
@@ -170,7 +171,7 @@ def deserialize(
170
171
  with data_loader("definition.json").open("rt") as fh:
171
172
  content = json.load(fh)
172
173
 
173
- object, init_tasks = from_state_dict(content, as_instance=as_instance)
174
+ object, init_tasks = from_state_dict(content, data_loader, as_instance=as_instance)
174
175
 
175
176
  if as_instance:
176
177
  for init_task in init_tasks:
@@ -83,6 +83,7 @@ class LauncherRegistry:
83
83
 
84
84
  # Register the find launcher function if it exists
85
85
  launchers_py = basepath / "launchers.py"
86
+ print(f"basepath {launchers_py}")
86
87
  if launchers_py.is_file():
87
88
  logger.info("Loading %s", launchers_py)
88
89
 
@@ -20,9 +20,6 @@ class CudaSpecification:
20
20
  min_memory: int = 0
21
21
  """Minimum request memory (in bytes)"""
22
22
 
23
- def __lt__(self, other: "CudaSpecification"):
24
- return self.memory < other.memory
25
-
26
23
  def match(self, spec: "CudaSpecification"):
27
24
  """Returns True if the specification matches this host"""
28
25
  return (self.memory >= spec.memory) and (self.min_memory <= spec.memory)
@@ -30,7 +27,7 @@ class CudaSpecification:
30
27
  def __repr__(self):
31
28
  return (
32
29
  f"CUDA({self.model} "
33
- f"{format_size(self.memory)}/{format_size(self.min_memory)})"
30
+ f"max={format_size(self.memory)}/min={format_size(self.min_memory)})"
34
31
  )
35
32
 
36
33
 
@@ -48,8 +45,8 @@ class CPUSpecification:
48
45
  cpu_per_gpu: int = 0
49
46
  """Number of CPU per GPU (0 if not defined)"""
50
47
 
51
- def __lt__(self, other: "CPUSpecification"):
52
- return self.memory < other.memory and self.cores < other.cores
48
+ def match(self, other: "CPUSpecification"):
49
+ return (self.memory >= other.memory) and (self.cores >= other.cores)
53
50
 
54
51
  def total_memory(self, gpus: int = 0):
55
52
  return max(
@@ -95,6 +92,7 @@ class HostRequirement:
95
92
  """A requirement must be a disjunction of host requirements"""
96
93
 
97
94
  requirements: List["HostSimpleRequirement"]
95
+ """List of requirements (by order of priority)"""
98
96
 
99
97
  def __init__(self) -> None:
100
98
  self.requirements = []
@@ -133,7 +131,10 @@ class HostSimpleRequirement(HostRequirement):
133
131
  """Simple host requirement"""
134
132
 
135
133
  cuda_gpus: List["CudaSpecification"]
134
+ """Specification for CUDA gpus"""
135
+
136
136
  cpu: "CPUSpecification"
137
+ """Specification for CPU"""
137
138
 
138
139
  duration: int
139
140
  """Requested duration (in seconds)"""
@@ -158,7 +159,7 @@ class HostSimpleRequirement(HostRequirement):
158
159
  self.cpu.cores = max(req.cpu.cores, self.cpu.cores)
159
160
  self.duration = max(req.duration, self.duration)
160
161
  self.cuda_gpus.extend(req.cuda_gpus)
161
- self.cuda_gpus.sort()
162
+ self.cuda_gpus.sort(key=lambda cuda: -cuda.memory)
162
163
 
163
164
  def match(self, host: HostSpecification) -> Optional[MatchRequirement]:
164
165
  if self.cuda_gpus:
@@ -182,7 +183,7 @@ class HostSimpleRequirement(HostRequirement):
182
183
  )
183
184
  return None
184
185
 
185
- if host.cpu < self.cpu:
186
+ if not host.cpu.match(self.cpu):
186
187
  return None
187
188
 
188
189
  if host.max_duration > 0 and self.duration > host.max_duration:
@@ -197,7 +198,7 @@ class HostSimpleRequirement(HostRequirement):
197
198
  _self = deepcopy(self)
198
199
  for _ in range(count - 1):
199
200
  _self.cuda_gpus.extend(self.cuda_gpus)
200
- _self.cuda_gpus.sort()
201
+ _self.cuda_gpus.sort(key=lambda cuda: -cuda.memory)
201
202
 
202
203
  return _self
203
204
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: experimaestro
3
- Version: 1.8.5
3
+ Version: 1.8.7
4
4
  Summary: "Experimaestro is a computer science experiment manager"
5
5
  License: GPL-3
6
6
  Keywords: experiment manager
@@ -14,14 +14,14 @@ experimaestro/connectors/ssh.py,sha256=5giqvv1y0QQKF-GI0IFUzI_Z5H8Bj9EuL_Szpvk89
14
14
  experimaestro/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  experimaestro/core/arguments.py,sha256=7hpkU1f8LJ7JL8kQaD514h9CFSfMotYLsVfMsMmdpWk,6487
16
16
  experimaestro/core/callbacks.py,sha256=59JfeUgWcCCdIQ3pvh-xNnoRp9BX8f4iOAkgm16wBzE,1660
17
- experimaestro/core/context.py,sha256=41jvgudz4sgMDWrqOhPbgFRJHa3klWKvS3l_L661er0,2600
17
+ experimaestro/core/context.py,sha256=1tLmX7WcgEKSbGw77vfziTzS8KNsoZJ02JBWMBCqqOk,2606
18
18
  experimaestro/core/identifier.py,sha256=JadBAdW2fOIgoTyMRtKI_RY9SXQP2B1vq1rUcV465Hs,10214
19
19
  experimaestro/core/objects/__init__.py,sha256=ucJY5e17QQ1Kc-GYXeL7g8GFj8rP0XB4g2vrl32uhxY,721
20
20
  experimaestro/core/objects/config.py,sha256=qOUgCmX1NwhRhpTVxgr2sSAqBCMYloUXb5f-NiXgV8Q,56989
21
21
  experimaestro/core/objects/config_utils.py,sha256=ZLECGkeIWdzunm8vwWsQhvcSgV1e064BgXbLiZnxSEM,1288
22
22
  experimaestro/core/objects/config_walk.py,sha256=gyDMrVPbBMChn7r4em_gQXuqnxASO_JVauEbnJNO8II,4245
23
23
  experimaestro/core/objects.pyi,sha256=xvlsRj4u1xsJxbevJl5Ner_HwmxR8x1JlAeIVDJzuy0,6498
24
- experimaestro/core/serialization.py,sha256=TLMTfU627bs9_1gyY2O5tX_xy1GhePIzleXwi27ffz0,5683
24
+ experimaestro/core/serialization.py,sha256=CSPEwOzlDsgAz6V2og-TgyU0RXDtzt_nXaoXFZleDZE,5775
25
25
  experimaestro/core/serializers.py,sha256=R_CAMyjjfU1oi-eHU6VlEUixJpFayGqEPaYu7VsD9xA,1197
26
26
  experimaestro/core/types.py,sha256=AH3ni1nIKGTeRmc7ECL6GH_dYqiuZp_mAN4E-JqdqnY,21741
27
27
  experimaestro/core/utils.py,sha256=JfC3qGUS9b6FUHc2VxIYUI9ysNpXSQ1LjOBkjfZ8n7o,495
@@ -35,8 +35,8 @@ experimaestro/ipc.py,sha256=Xn3tYME83jLEB0nFak3DwEIhpL5IRZpCl3jirBF_jl4,1570
35
35
  experimaestro/launcherfinder/__init__.py,sha256=qRUDyv3B9UsAM8Q31mRrZrTZox0AptwdmOY4f2K-TUo,279
36
36
  experimaestro/launcherfinder/base.py,sha256=q47SsF_cXdo5O6ZhFKn5385WVFcx8Wd-BcEpd6tRpbs,515
37
37
  experimaestro/launcherfinder/parser.py,sha256=pYbfEJw7osnqZWm7fkVhQawhpNU8dLU_6vEjtXdc8E8,2279
38
- experimaestro/launcherfinder/registry.py,sha256=4Ix86rrooRucOlKtiCufmdvrebT-FRrzpqQu0qHpJJg,6337
39
- experimaestro/launcherfinder/specs.py,sha256=G8za6mEmkVxuZY_ab3OhWJIpONpcBMO_iXeB30sUbhI,6448
38
+ experimaestro/launcherfinder/registry.py,sha256=mhFAVgk8t2qWemUlhgM4nftn2x1THm7LTKSyDVsQQ9M,6379
39
+ experimaestro/launcherfinder/specs.py,sha256=j3rObYRUi8WbU9n8220usOIWJ9p68Uti0BjkQRqGiZc,6560
40
40
  experimaestro/launchers/__init__.py,sha256=lXn544sgJExr6uirILWzAXu_IfmfyqFZOt4OzRnjHXg,2525
41
41
  experimaestro/launchers/direct.py,sha256=JZh6WOPnO6ED_xlOs8pL4MRFmnRhmXzpVxTl-ByaD2A,258
42
42
  experimaestro/launchers/oar.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -150,8 +150,8 @@ experimaestro/utils/jupyter.py,sha256=JcEo2yQK7x3Cr1tNl5FqGMZOICxCv9DwMvL5xsWdQP
150
150
  experimaestro/utils/resources.py,sha256=j-nvsTFwmgENMoVGOD2Ap-UD3WU85WkI0IgeSszMCX4,1328
151
151
  experimaestro/utils/settings.py,sha256=jpFMqF0DLL4_P1xGal0zVR5cOrdD8O0Y2IOYvnRgN3k,793
152
152
  experimaestro/xpmutils.py,sha256=S21eMbDYsHfvmZ1HmKpq5Pz5O-1HnCLYxKbyTBbASyQ,638
153
- experimaestro-1.8.5.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
154
- experimaestro-1.8.5.dist-info/METADATA,sha256=0qVBZsnk31ZTq0hrOn9yOW7xTggTuTzqX5j5uZaQ3zA,6170
155
- experimaestro-1.8.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
156
- experimaestro-1.8.5.dist-info/entry_points.txt,sha256=TppTNiz5qm5xm1fhAcdLKdCLMrlL-eQggtCrCI00D9c,446
157
- experimaestro-1.8.5.dist-info/RECORD,,
153
+ experimaestro-1.8.7.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
154
+ experimaestro-1.8.7.dist-info/METADATA,sha256=lQqxqqwMoIjPi6km8uxHk-aHYe3V3MIUYnfibHisfz0,6170
155
+ experimaestro-1.8.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
156
+ experimaestro-1.8.7.dist-info/entry_points.txt,sha256=TppTNiz5qm5xm1fhAcdLKdCLMrlL-eQggtCrCI00D9c,446
157
+ experimaestro-1.8.7.dist-info/RECORD,,