瀏覽代碼

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
Nel Nibcord 4 月之前
父節點
當前提交
124a0338b4
共有 1 個文件被更改,包括 3 次插入5 次删除
  1. 3 5
      exo/main.py

+ 3 - 5
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 = []