justheuristic 3 роки тому
батько
коміт
60ff413b07

+ 1 - 1
hivemind/averaging/partition.py

@@ -13,7 +13,7 @@ from hivemind.proto import runtime_pb2
 from hivemind.utils.asyncio import amap_in_executor
 
 T = TypeVar("T")
-DEFAULT_PART_SIZE_BYTES = 2 ** 20
+DEFAULT_PART_SIZE_BYTES = 2 ** 19
 
 
 class TensorPartContainer:

+ 3 - 1
hivemind/p2p/p2p_daemon.py

@@ -277,7 +277,8 @@ class P2P:
     TOutputProtobuf = TypeVar("TOutputProtobuf")
 
     @staticmethod
-    async def send_protobuf(protobuf: Union[TOutputProtobuf, RPCError], writer: asyncio.StreamWriter, *, chunk_size: int = 2 ** 15) -> None:
+    async def send_protobuf(protobuf: Union[TOutputProtobuf, RPCError],
+                            writer: asyncio.StreamWriter, *, chunk_size: int = 2 ** 16) -> None:
         if isinstance(protobuf, RPCError):
             writer.write(P2P.ERROR_MARKER)
         else:
@@ -305,6 +306,7 @@ class P2P:
             protobuf.ParseFromString(data)
             return protobuf, None
         elif msg_type == P2P.ERROR_MARKER:
+            #TODO
             protobuf = RPCError()
             protobuf.ParseFromString(await P2P.receive_raw_data(reader))
             return None, protobuf

+ 2 - 2
hivemind/p2p/p2p_daemon_bindings/control.py

@@ -62,7 +62,7 @@ class DaemonConnector:
         Open connection to daemon and upgrade it to a persistent one
         """
         reader, writer = await self.open_connection()
-        writer.transport.set_write_buffer_limits(low=2 ** 18, high=2 ** 20)
+        writer.transport.set_write_buffer_limits(low=2 ** 16, high=2 ** 18)
         req = p2pd_pb.Request(type=p2pd_pb.Request.PERSISTENT_CONN_UPGRADE)
         await write_pbmsg(writer, req)
 
@@ -345,7 +345,7 @@ class ControlClient:
         self, peer_id: PeerID, protocols: Sequence[str]
     ) -> Tuple[StreamInfo, asyncio.StreamReader, asyncio.StreamWriter]:
         reader, writer = await self.daemon_connector.open_connection()
-        writer.transport.set_write_buffer_limits(low=2 ** 18, high=2 ** 20)
+        writer.transport.set_write_buffer_limits(low=2 ** 16, high=2 ** 18)
 
         stream_open_req = p2pd_pb.StreamOpenRequest(peer=peer_id.to_bytes(), proto=list(protocols))
         req = p2pd_pb.Request(type=p2pd_pb.Request.STREAM_OPEN, streamOpen=stream_open_req)