I’m running into some problems trying to save a pre-compiled nnvm to a file and load it back again:
File “/home/agsim/repos/agsim/install/python/agsim/utils/tvm_helper.py”, line 35, in get_tvm_graph_runtime
lib.export_library(target_dir+‘lib.o’)
File “/home/agsim/virtualenvs/py3/lib/python3.5/site-packages/tvm-0.5.dev0-py3.5-linux-x86_64.egg/tvm/module.py”, line 121, in export_library
fcompile(file_name, files, **kwargs)
File “/home/agsim/virtualenvs/py3/lib/python3.5/site-packages/tvm-0.5.dev0-py3.5-linux-x86_64.egg/tvm/contrib/cc.py”, line 33, in create_shared
_linux_shared(output, objects, options, cc)
File “/home/agsim/virtualenvs/py3/lib/python3.5/site-packages/tvm-0.5.dev0-py3.5-linux-x86_64.egg/tvm/contrib/cc.py”, line 58, in _linux_shared
raise RuntimeError(msg)
RuntimeError: Compilation error:
/usr/bin/ld: /tmp/tmp37hq10iw/lib.o: relocation R_X86_64_32S against `.rodata.cst16’ can not be used when making a shared object; recompile with -fPIC
/tmp/tmp37hq10iw/lib.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
I think i’ve narrowed it down to when export_library is calling save…
self.save(path_obj)
_SaveToFile(…)
I’m fairly certain that’s calling SaveToFile in src/codegen/llvm/llvm_module.cc
Is there something that I’m missing? I’m trying to follow the Get Started with NNVM tutorial but use LLVM instead of CUDA.