experimaestro 1.10.1__py3-none-any.whl → 1.12.0__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.

@@ -29,7 +29,7 @@ class CudaSpecification:
29
29
  def __repr__(self):
30
30
  return (
31
31
  f"CUDA({self.model} "
32
- f"max={format_size(self.memory)}/min={format_size(self.min_memory)})"
32
+ f"max={format_size(self.memory, binary=True)}/min={format_size(self.min_memory, binary=True)})"
33
33
  )
34
34
 
35
35
 
@@ -47,6 +47,13 @@ class CPUSpecification:
47
47
  cpu_per_gpu: int = 0
48
48
  """Number of CPU per GPU (0 if not defined)"""
49
49
 
50
+ def __repr__(self):
51
+ return (
52
+ f"CPU("
53
+ f"mem={format_size(self.memory, binary=True)}, cores={self.cores}"
54
+ ")"
55
+ )
56
+
50
57
  def match(self, other: "CPUSpecification"):
51
58
  return (self.memory >= other.memory) and (self.cores >= other.cores)
52
59
 
experimaestro/run.py CHANGED
@@ -8,6 +8,7 @@ import json
8
8
  from typing import List
9
9
  import fasteners
10
10
  from experimaestro.notifications import progress, report_eoj
11
+ from experimaestro.utils.multiprocessing import delayed_shutdown
11
12
  from .core.types import ObjectType
12
13
  from experimaestro.utils import logger
13
14
  from experimaestro.core.objects import ConfigInformation
@@ -96,6 +97,7 @@ class TaskRunner:
96
97
  self.failedpath.write_text(str(code))
97
98
  self.cleanup()
98
99
  logger.info("Exiting")
100
+ delayed_shutdown(60, exit_code=code)
99
101
  sys.exit(1)
100
102
 
101
103
  def run(self):
@@ -0,0 +1,44 @@
1
+ import logging
2
+ import multiprocessing as mp
3
+ import time
4
+ import os
5
+ import signal
6
+ import threading
7
+
8
+
9
+ def delayed_shutdown(delay=60, *, exit_code=1, grace_period=5):
10
+ """After *delay*'s try a graceful stop, then SIGKILL anything left.
11
+
12
+ :param delay: Delay in seconds before killing
13
+ :param grace_period: Delay in seconds before force-killing a child process
14
+ :param exit_code: The exit code to use
15
+ """
16
+
17
+ def _killer():
18
+ time.sleep(delay)
19
+
20
+ logging.info("Stall dectected – killing all subprocesses")
21
+
22
+ # 1️⃣ Try graceful termination
23
+ for p in mp.active_children():
24
+ # sends SIGTERM / TerminateProcess
25
+ p.terminate()
26
+
27
+ alive = mp.active_children()
28
+ deadline = time.time() + grace_period
29
+ while alive and time.time() < deadline:
30
+ alive = [p for p in alive if p.is_alive()]
31
+ time.sleep(0.1)
32
+
33
+ # 2️⃣ Anything still alive? Nuke it.
34
+ for p in alive:
35
+ try:
36
+ os.kill(p.pid, signal.SIGKILL)
37
+ except OSError:
38
+ pass
39
+
40
+ # 3️⃣ Finally kill the parent
41
+ os.kill(os.getpid(), signal.SIGKILL)
42
+
43
+ # Start the thread (non blocking)
44
+ threading.Thread(target=_killer, daemon=True).start()
@@ -1,8 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: experimaestro
3
- Version: 1.10.1
3
+ Version: 1.12.0
4
4
  Summary: "Experimaestro is a computer science experiment manager"
5
5
  License: GPL-3
6
+ License-File: LICENSE
6
7
  Keywords: experiment manager
7
8
  Author: Benjamin Piwowarski
8
9
  Author-email: benjamin@piwowarski.fr
@@ -20,8 +21,8 @@ Requires-Dist: click (>=8)
20
21
  Requires-Dist: decorator (>=5,<6)
21
22
  Requires-Dist: docstring-parser (>=0.15,<1)
22
23
  Requires-Dist: fasteners (>=0.19,<1)
23
- Requires-Dist: flask (>=2.3,<3)
24
- Requires-Dist: flask-socketio (>=5.3,<6)
24
+ Requires-Dist: flask (>=2.3)
25
+ Requires-Dist: flask-socketio (>=5.3)
25
26
  Requires-Dist: gevent (>=25)
26
27
  Requires-Dist: gevent-websocket (>=0.10)
27
28
  Requires-Dist: huggingface-hub (>0.17)
@@ -36,7 +36,7 @@ experimaestro/launcherfinder/__init__.py,sha256=qRUDyv3B9UsAM8Q31mRrZrTZox0Aptwd
36
36
  experimaestro/launcherfinder/base.py,sha256=q47SsF_cXdo5O6ZhFKn5385WVFcx8Wd-BcEpd6tRpbs,515
37
37
  experimaestro/launcherfinder/parser.py,sha256=MIHhjs2sTVxLHLcc1CgFid9XxhInXker8QdA-GBA-Bk,2364
38
38
  experimaestro/launcherfinder/registry.py,sha256=F16A7SE_CgzaTBC-LBlurbthTDvYUa5iyjJftkDNN4M,6420
39
- experimaestro/launcherfinder/specs.py,sha256=484S4-N22Y10BsyTpNwW0l369ALAJUrXQK9LsYSYsaQ,7705
39
+ experimaestro/launcherfinder/specs.py,sha256=eQC2pwAnvq7kF2xmAfHpg_Wx6_lH6YMf3ZCDwqatjKk,7898
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
@@ -52,7 +52,7 @@ experimaestro/mypy.py,sha256=M39VFuDrab-ymlCDIF5jys9oKpTwnuBPzb1T8Un5J3s,285
52
52
  experimaestro/notifications.py,sha256=TLG9sw6bxukj0Wj4ZXASn-A9sQuET_exzUHtgk8AgRQ,9335
53
53
  experimaestro/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  experimaestro/rpyc.py,sha256=ZRKol-3tVoeoUITLNFenLF4dhWBLW_FvSV_GvsypmeI,3605
55
- experimaestro/run.py,sha256=58ZlIZ2dQ7a0un2iGiyHJhK14zc18BnpEFDis7OyTPA,5222
55
+ experimaestro/run.py,sha256=_szMzKn-67ulT6Wy21dzhB1g6_fiL379JnBC0zJqpIY,5332
56
56
  experimaestro/scheduler/__init__.py,sha256=ERmmOxz_9mUkIuccNbzUa5Y6gVLLVDdyc4cCxbCCUbY,20
57
57
  experimaestro/scheduler/base.py,sha256=294a_29UtsSfoW4NpL4_6mvDyDslG0qDXGmVkcGRUDA,35829
58
58
  experimaestro/scheduler/dependencies.py,sha256=n9XegwrmjayOIxt3xhuTEBVEBGSq4oeVdzz-FviDGXo,1994
@@ -147,11 +147,12 @@ experimaestro/utils/__init__.py,sha256=BdYguxAbR1jOQPV36OgGA31itaMvBJ6WVPV6b4Jn4
147
147
  experimaestro/utils/asyncio.py,sha256=9r_vFQs6T6tqmymC_DbHVFhY9YVRO6X48uEuyL_ugP8,726
148
148
  experimaestro/utils/jobs.py,sha256=42FAdKcn_v_-M6hcQZPUBr9kbDt1eVsk3a4E8Gc4eu8,2394
149
149
  experimaestro/utils/jupyter.py,sha256=JcEo2yQK7x3Cr1tNl5FqGMZOICxCv9DwMvL5xsWdQPk,2183
150
+ experimaestro/utils/multiprocessing.py,sha256=am3DkHP_kmWbpynbck2c9QystCUtPBoSAC0ViBVzndU,1275
150
151
  experimaestro/utils/resources.py,sha256=j-nvsTFwmgENMoVGOD2Ap-UD3WU85WkI0IgeSszMCX4,1328
151
152
  experimaestro/utils/settings.py,sha256=jpFMqF0DLL4_P1xGal0zVR5cOrdD8O0Y2IOYvnRgN3k,793
152
153
  experimaestro/xpmutils.py,sha256=S21eMbDYsHfvmZ1HmKpq5Pz5O-1HnCLYxKbyTBbASyQ,638
153
- experimaestro-1.10.1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
154
- experimaestro-1.10.1.dist-info/METADATA,sha256=5RTdMyryQUQXXnO3VQbI1i0pKFgaVG89LZsyQzaomgw,5689
155
- experimaestro-1.10.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
156
- experimaestro-1.10.1.dist-info/entry_points.txt,sha256=TppTNiz5qm5xm1fhAcdLKdCLMrlL-eQggtCrCI00D9c,446
157
- experimaestro-1.10.1.dist-info/RECORD,,
154
+ experimaestro-1.12.0.dist-info/METADATA,sha256=BbLWHf4Fg1w4rkSNnAjjdRWf9S4aNx92uKlePpSacQc,5705
155
+ experimaestro-1.12.0.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
156
+ experimaestro-1.12.0.dist-info/entry_points.txt,sha256=TppTNiz5qm5xm1fhAcdLKdCLMrlL-eQggtCrCI00D9c,446
157
+ experimaestro-1.12.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
158
+ experimaestro-1.12.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.3
2
+ Generator: poetry-core 2.2.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any