mirror of https://github.com/Jittor/Jittor
limit pool size
This commit is contained in:
parent
ea781154f9
commit
3274fade1f
|
@ -36,6 +36,8 @@ RUN pip3 install \
|
||||||
|
|
||||||
RUN pip3 install matplotlib
|
RUN pip3 install matplotlib
|
||||||
|
|
||||||
|
RUN apt install openmpi-bin openmpi-common libopenmpi-dev -y
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN pip3 install . --timeout 100
|
RUN pip3 install . --timeout 100
|
||||||
|
|
|
@ -129,9 +129,17 @@ def do_compile(args):
|
||||||
run_cmd(cmd)
|
run_cmd(cmd)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
pool_size = 0
|
||||||
|
|
||||||
def run_cmds(cmds, cache_path, jittor_path):
|
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 ]
|
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)
|
p.map(do_compile, cmds)
|
||||||
|
|
||||||
def download(url, filename):
|
def download(url, filename):
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -21,7 +21,7 @@ with open(os.path.join(path, "README.md"), "r", encoding='utf8') as fh:
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name='jittor',
|
name='jittor',
|
||||||
version='1.1.2',
|
version='1.1.3',
|
||||||
# scripts=[],
|
# scripts=[],
|
||||||
author="Jittor Group",
|
author="Jittor Group",
|
||||||
author_email="ran.donglang@gmail.com",
|
author_email="ran.donglang@gmail.com",
|
||||||
|
|
Loading…
Reference in New Issue