diff --git a/python/jittor/__init__.py b/python/jittor/__init__.py index 94dde310..7610ac1f 100644 --- a/python/jittor/__init__.py +++ b/python/jittor/__init__.py @@ -9,7 +9,7 @@ # file 'LICENSE.txt', which is part of this source code package. # *************************************************************** -__version__ = '1.2.3.36' +__version__ = '1.2.3.37' from jittor_utils import lock with lock.lock_scope(): ori_int = int diff --git a/python/jittor/dataset/dataset.py b/python/jittor/dataset/dataset.py index 46538e1a..be0c270f 100644 --- a/python/jittor/dataset/dataset.py +++ b/python/jittor/dataset/dataset.py @@ -72,6 +72,8 @@ class Dataset(object): stop_grad = True, keep_numpy_array = False): super().__init__() + if os.environ.get("DISABLE_MULTIPROCESSING", '0') == '1': + num_workers = 0 self.total_len = None self.batch_size = batch_size self.shuffle = shuffle diff --git a/python/jittor_utils/__init__.py b/python/jittor_utils/__init__.py index b9e04353..1aeb1e51 100644 --- a/python/jittor_utils/__init__.py +++ b/python/jittor_utils/__init__.py @@ -193,6 +193,16 @@ def run_cmds(cmds, cache_path, jittor_path, msg="run_cmds"): finally: mp.current_process()._config['daemon'] = bk +if os.environ.get("DISABLE_MULTIPROCESSING", '0') == '1': + os.environ["use_parallel_op_compiler"] = '1' + def run_cmds(cmds, cache_path, jittor_path, msg="run_cmds"): + cmds = [ [cmd, cache_path, jittor_path] for cmd in cmds ] + n = len(cmds) + dp = DelayProgress(msg, n) + for i,cmd in enumerate(cmds): + dp.update(i) + do_compile(cmd) + def download(url, filename): if os.path.isfile(filename):