diff --git a/Dockerfile b/Dockerfile index 367558df..d0b5cc0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,8 @@ RUN pip3 install \ RUN pip3 install matplotlib +RUN apt install openmpi-bin openmpi-common libopenmpi-dev -y + COPY . . RUN pip3 install . --timeout 100 diff --git a/README.md b/README.md index 49ac9e4f..78ad8804 100644 --- a/README.md +++ b/README.md @@ -258,7 +258,7 @@ print(c.name()) # Output: c ``` -###Operations +### Operations Jittor'op is simular with numpy. Let's try some operations. We create Var `a` and `b` via operation `jt.float32`, and add them. Printing those variables shows they have the same shape and dtype. diff --git a/README.src.md b/README.src.md index 1277bcfc..3fbdb14a 100644 --- a/README.src.md +++ b/README.src.md @@ -322,7 +322,7 @@ print(c.name()) # Output: c ``` -###Operations +### Operations ### 数据运算 diff --git a/python/jittor_utils/__init__.py b/python/jittor_utils/__init__.py index 710a25c3..09f381c0 100644 --- a/python/jittor_utils/__init__.py +++ b/python/jittor_utils/__init__.py @@ -129,9 +129,17 @@ def do_compile(args): run_cmd(cmd) return True +pool_size = 0 + def run_cmds(cmds, cache_path, jittor_path): + global pool_size + if pool_size == 0: + mem_bytes = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') + mem_gib = mem_bytes/(1024.**3) + pool_size = min(8,max(int(mem_gib // 3), 1)) + LOG.i(f"Total mem: {mem_gib:.2f}GB, using {pool_size} procs for compiling.") cmds = [ [cmd, cache_path, jittor_path] for cmd in cmds ] - with Pool(8) as p: + with Pool(pool_size) as p: p.map(do_compile, cmds) def download(url, filename): diff --git a/setup.py b/setup.py index 0e530b59..e57c69ab 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ with open(os.path.join(path, "README.md"), "r", encoding='utf8') as fh: setuptools.setup( name='jittor', - version='1.1.2', + version='1.1.3', # scripts=[], author="Jittor Group", author_email="ran.donglang@gmail.com",