Add a flag

This commit is contained in:
lzhengning 2022-09-20 16:23:23 +08:00
parent 1a91f1dd01
commit a44c016408
2 changed files with 3 additions and 2 deletions

View File

@ -9,7 +9,7 @@
# file 'LICENSE.txt', which is part of this source code package.
# ***************************************************************
__version__ = '1.3.5.15'
__version__ = '1.3.5.16'
from jittor_utils import lock
with lock.lock_scope():
ori_int = int

View File

@ -39,6 +39,7 @@ Executor exe;
EXTERN_LIB MemoryProfiler memory_profiler;
DECLARE_FLAG(int, profile_memory_enable);
DEFINE_FLAG(int, gopt_disable, 0, "Disable graph optimizer.");
DEFINE_FLAG(int, use_threading, 0, "Allow to use python threading with jittor.");
// from fetch_op.cc
EXTERN_LIB list<VarPtr> fetcher_to_free;
@ -192,7 +193,7 @@ static void top_weak_sync(vector<Var*>& vars) {
}
void Executor::run_sync(vector<Var*> vars, bool device_sync, bool weak_sync) {
if (weak_sync)
if (weak_sync && !use_threading)
top_weak_sync(vars);
auto allocator = get_allocator();
auto temp_allocator = get_allocator(true);