mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 06:53:19 -10:00
The farm's GPU wait gives up on a run that ran out of its own time, as .remote() did
Modal's FunctionTimeoutError is a subclass of its TimeoutError, so waited() caught a run's own timeout as "no answer yet" and asked again forever, logging "waiting" instead of failing the job. It now goes up as before. Test: a run that timed out fails the job with no wait lines.
This commit is contained in:
1 parent
349a934eb9
commit
cdcb8dacbd
2 files changed
+20
-1
No files matched your search
@@ -64,7 +64,11 @@ def waited(fn, log, *a, **kw):
|
||||
while True:
|
||||
try:
|
||||
return call.get(timeout=WAIT_SAY_S)
|
||||
except timeouts:
|
||||
except timeouts as e:
|
||||
# Modal's FunctionTimeoutError is a TimeoutError too: the run itself ran out of time, so it goes up as
|
||||
# .remote() raised it, not waited on again (it would answer the same at once, forever)
|
||||
if type(e).__name__ == "FunctionTimeoutError":
|
||||
raise
|
||||
log(f"raea farm: waiting {time.time() - t:.0f} s for a GPU run to answer (queued while the workspace's GPUs are busy, or still drawing)")
|
||||
|
||||
|
||||
|
||||
@@ -174,4 +174,19 @@ assert fp.waited(SlowGpu(), log, "j4", ["render"]) == {"code": 0, "out": "drawn"
|
||||
assert sum("waiting" in l and "GPU run" in l for l in lines) == 2, lines
|
||||
ok("a GPU run that hasn't answered is said in the log every WAIT_SAY_S until it does")
|
||||
|
||||
# a GPU run that ran out of its own time fails the job, as .remote() did, instead of being waited on forever
|
||||
class FunctionTimeoutError(TimeoutError): pass
|
||||
class TimedOutCall:
|
||||
def get(self, timeout=None): raise FunctionTimeoutError("Function timeout")
|
||||
class TimedOutGpu:
|
||||
def spawn(self, *a, **kw): return TimedOutCall()
|
||||
lines.clear()
|
||||
try:
|
||||
fp.waited(TimedOutGpu(), log, "j5", ["render"])
|
||||
raise AssertionError("waited() swallowed a function timeout")
|
||||
except FunctionTimeoutError:
|
||||
pass
|
||||
assert not any("waiting" in l for l in lines), lines
|
||||
ok("a GPU run that timed out fails the job instead of being waited on forever")
|
||||
|
||||
shutil.rmtree(root)
|
||||
Reference in new issue
Block a user