tvm
tvm copied to clipboard
Can't compile from source with TFLite support
I am trying to compile TVM from the source in order to have microTVM support and GPU acceleration using Cuda and Tensorflow.
Expected behavior
TVM compiled from source, microTVM enabled, with Tensorflow, Tensorflow-lite, Cuda, and CMSIS-NN support
Actual behavior
During compilation, CMAKE returns an error due to the Tensorflow dependency. config.cmake
1. First Try -- USE_TENSORFLOW_PATH set to 'none'
In file included from /home/user/AI/tvm/src/runtime/contrib/tflite/tflite_runtime.cc:23: /home/user/AI/tvm/src/runtime/contrib/tflite/tflite_runtime.h:29:10: fatal error: tensorflow/lite/interpreter.h: No such file or directory 29 | #include <tensorflow/lite/interpreter.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/tvm_runtime_objs.dir/build.make:856: CMakeFiles/tvm_runtime_objs.dir/src/runtime/contrib/tflite/tflite_runtime.cc.o] Error 1 make[2]: *** Waiting for unfinished jobs...
This error makes sense since the compiler does not know where to find the required includes. But if I try to specify the TensorFlow source path...
2. Second Try -- USE_TENSORFLOW_PATH set to "~/AI/tensorflow_src"
/bin/ld: /home/user/AI/tflite_build/libtensorflow-lite.a(rfft2d.cc.o): in function
tflite::ops::builtin::rfft2d::Rfft2dImpl(int, int, double**, int*, double*)': rfft2d.cc:(.text+0x936): undefined reference tordft2d'
The complete log can be found here: https://pastebin.com/0eQStGPn
Environment
Ubuntu 20.04 kernel 5.15.0-41 Python 3.8.10 GCC,G++ 11.1 TVM from source/master LLVM 14 NVIDIA-SMI 515.48.07 -- Driver Version: 515.48.07 -- CUDA Version: 11.7 ninja from source/master NNPack from source (compiled as https://tvm.apache.org/docs/install/nnpack.html) Tensorflow lite from source (compiled as https://www.tensorflow.org/lite/guide/build_cmake)
Steps to reproduce
Following https://tvm.apache.org/docs/install/from_source.html
cmake ..
make -j24