GraphRuntimeCreate is in deadloop?


#1

Dear All,
** Im facing a wierd problem with this simple script. **
When my input shape is (1, 5, 85, 20, 20), this script works fine. When its (1, 5, 85, 19, 19) GraphCreate is going in some deadloop. Any idea why this is happening?

import numpy as np
import tvm
from tvm.contrib import graph_runtime
import nnvm.symbol as _sym
import nnvm.compiler

def test_concat(val):
    split_size = 85;
    h = w = val

    input_shape = (1, 5, split_size, h, w)
    data = np.random.uniform(size=input_shape).astype(np.float32)
    print("input_shape=", input_shape)

    x = _sym.Variable("data", shape=data.shape)
    splits = _sym.split(x, indices_or_sections=split_size, axis=2)
    sym = _sym.concatenate(*splits, axis=2)
    print("sym generated")

    print("nnvm.compiler.build...")
    graph, lib, params = nnvm.compiler.build(sym, 'llvm')
    print("graph_runtime.create...")
    m = graph_runtime.create(graph, lib, tvm.cpu(0))
    print("set_input...")
    m.set_input('data', tvm.nd.array(data))
    print("Running the test image...")
    m.run()
    x = m.get_output(0)
    print("output_shape=", x.asnumpy().shape)
    print("test_concat OK (val)=", val)

test_concat(20) #Working
test_concat(19) #Not working

The current executing call stack is below.

#0  0x00007fffe6267472 in llvm::SUnit::addPred(llvm::SDep const&, bool) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#1  0x00007fffe626ae41 in llvm::ScheduleDAGInstrs::addPhysRegDeps(llvm::SUnit*, unsigned int) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#2  0x00007fffe6272d13 in llvm::ScheduleDAGInstrs::buildSchedGraph(llvm::AAResults*, llvm::RegPressureTracker*, llvm::PressureDiffs*, llvm::LiveIntervals*, bool) ()
   from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#3  0x00007fffe61b79a3 in llvm::ScheduleDAGMILive::buildDAGWithRegPressure() () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#4  0x00007fffe61b7a1c in llvm::ScheduleDAGMILive::schedule() () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#5  0x00007fffe61ad73f in (anonymous namespace)::MachineSchedulerBase::scheduleRegions(llvm::ScheduleDAGInstrs&, bool) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#6  0x00007fffe61b72b7 in (anonymous namespace)::MachineScheduler::runOnMachineFunction(llvm::MachineFunction&) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#7  0x00007fffe614a120 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#8  0x00007fffe5fa5278 in llvm::FPPassManager::runOnFunction(llvm::Function&) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#9  0x00007fffe5fa52c3 in llvm::FPPassManager::runOnModule(llvm::Module&) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#10 0x00007fffe5fa4b0f in llvm::legacy::PassManagerImpl::run(llvm::Module&) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#11 0x00007fffe6fcc1b7 in llvm::MCJIT::emitObject(llvm::Module*) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#12 0x00007fffe6fcc8be in llvm::MCJIT::generateCodeForModule(llvm::Module*) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#13 0x00007fffe6fcb6f3 in llvm::MCJIT::findSymbol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#14 0x00007fffe6fcb990 in llvm::MCJIT::getSymbolAddress(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#15 0x00007fffe6fcbb56 in llvm::MCJIT::getGlobalValueAddress(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/llvm-5.0/lib/libLLVM-5.0.so.1
#16 0x00007fffe9507dd5 in tvm::codegen::LLVMModuleNode::LazyInitJIT() () from /home/siju/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so
#17 0x00007fffe9508418 in tvm::codegen::LLVMModuleNode::GetFunction(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<tvm::runtime::ModuleNode> const&) () from /home/siju/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so
#18 0x00007fffe956a18b in tvm::runtime::GraphRuntime::CreateTVMOp(tvm::runtime::TVMOpParam const&, std::vector<DLTensor, std::allocator<DLTensor> > const&, unsigned long) ()
   from /home/siju/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so
#19 0x00007fffe956a965 in tvm::runtime::GraphRuntime::SetupOpExecs() () from /home/siju/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so
#20 0x00007fffe956badc in tvm::runtime::GraphRuntime::Init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tvm::runtime::Module, std::vector<DLContext, std::allocator<DLContext> > const&) () from /home/siju/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so
#21 0x00007fffe956bd3d in tvm::runtime::GraphRuntimeCreate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tvm::runtime::Module const&, std::vector<DLContext, std::allocator<DLContext> > const&) () from /home/siju/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so
#22 0x00007fffe956c060 in tvm::runtime::{lambda(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)#1}::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const [clone .isra.569] ()
   from /home/siju/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so
#23 0x00007fffe956c294 in std::_Function_handler<void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*), tvm::runtime::{lambda(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)#1}>::_M_invoke(std::_Any_data const&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) () from /home/siju/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so
#24 0x00007fffe950ceae in TVMFuncCall () from /home/siju/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so
#25 0x00007fffe490f4fa in __pyx_f_4core_FuncCall (__pyx_v_ret_tcode=0x7fffffffd374, __pyx_v_ret_val=0x7fffffffd378, __pyx_v_args=0x7fffe2e83c78, __pyx_v_chandle=0x174d000)
    at tvm/_ffi/_cython/core.cpp:6755
#26 __pyx_pf_4core_12FunctionBase_4__call__ (__pyx_v_self=<optimized out>, __pyx_v_args=0x7fffe2e83c78) at tvm/_ffi/_cython/core.cpp:7508