[object Object]

← back to Exo

Slightly simplified waiting for outstanding requests

124a0338b4892190dd3f6fb329225286b970088f · 2024-12-10 13:03:48 -0800 · Nel Nibcord

Ultimately this whole synchronization mechanism is kind of a hack for this proof of concept, and making a more robust mechanism would be part of designing a more integrated testing system. However, I think this addresses the code comprehensibility concern somewhat while still keeping the synchronization in a working state

Files touched

Diff

commit 124a0338b4892190dd3f6fb329225286b970088f
Author: Nel Nibcord <blindcrone@tuta.io>
Date:   Tue Dec 10 13:03:48 2024 -0800

    Slightly simplified waiting for outstanding requests
    
    Ultimately this whole synchronization mechanism is kind of a hack for this proof of concept, and making a more robust mechanism would be part of designing a more integrated testing system. However, I think this addresses the code comprehensibility concern somewhat while still keeping the synchronization in a working state
---
 exo/main.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/exo/main.py b/exo/main.py
index 3a01f08c..d39f1148 100644
--- a/exo/main.py
+++ b/exo/main.py
@@ -219,11 +219,9 @@ def clean_path(path):
     return os.path.expanduser(path)
 
 async def hold_outstanding(node: Node):
-  while True:
-    if node.outstanding_requests:
-      await asyncio.sleep(1)
-    else:
-      return      
+  while node.outstanding_requests:
+    await asyncio.sleep(.5)
+  return 
 
 async def run_iter(node: Node, shard: Shard, train: bool, data, batch_size=1):
   losses = []

← a4313da8 Removed statefulModel stuff from mlx impl too  ·  back to Exo  ·  Missed one cc66a0b7 →