فهرست منبع

reduce default shmbuffer size (tested to be stable, performance platoes after 16; 4096 was less memory-efficient)

justheuristic 4 سال پیش
والد
کامیت
c57eecc117
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      hivemind/utils/mpfuture.py

+ 1 - 1
hivemind/utils/mpfuture.py

@@ -53,7 +53,7 @@ class SharedBytes:
         """Create another shared byte value, represented as a scalar uint8 tensor"""
         """Create another shared byte value, represented as a scalar uint8 tensor"""
         with cls._lock:
         with cls._lock:
             if cls._pid != os.getpid() or cls._buffer is None or cls._index >= len(cls._buffer):
             if cls._pid != os.getpid() or cls._buffer is None or cls._index >= len(cls._buffer):
-                buffer_size = int(os.environ.get("HIVEMIND_SHM_BUFFER_SIZE", 4096))
+                buffer_size = int(os.environ.get("HIVEMIND_SHM_BUFFER_SIZE", 16))
                 cls._pid = os.getpid()
                 cls._pid = os.getpid()
                 cls._buffer = torch.empty([buffer_size], dtype=torch.uint8).share_memory_()
                 cls._buffer = torch.empty([buffer_size], dtype=torch.uint8).share_memory_()
                 cls._index = 0
                 cls._index = 0