Hi I am trying to use the LLVM dumped from the tfcompile to run inference on a model. I have:
-
Successfully dumped the LLVM.
-
Written a main.c that should correctly run inference on the model using the buffer table used in the LLVM.
-
Attempted to compile the LLVM with the main with clang-12 and received the following errors:
/tmp/module_0000-e6586b.o: In function `entry':
__compute_module:(.text+0x105): undefined reference to `__xla_cpu_runtime_EigenConv2DF32'
__compute_module:(.text+0x3b7): undefined reference to `__xla_cpu_runtime_EigenConv2DF32'
__compute_module:(.text+0x65b): undefined reference to `__xla_cpu_runtime_EigenConv2DF32'
__compute_module:(.text+0x8fe): undefined reference to `__xla_cpu_runtime_EigenConv2DF32'
-
I found the ‘__xla_cpu_runtime_EigenConv2DF32’ function within the TensorFlow repository and built the library ‘runtime_conv2d’ (tensorflow/tensorflow/compiler/xla/service/cpu/BUILD at 9f5dc7ab901845500be5a5bcc5051fbd73584399 · tensorflow/tensorflow · GitHub)
-
I included the library in the compilation and got the following errors:
libruntime_conv2d.so: undefined reference to `Eigen::internal::UseCustomContractionKernels()'
libruntime_conv2d.so: undefined reference to `dnnl_sgemm'
libruntime_conv2d.so: undefined reference to `xla::ExecutableRunOptions::intra_op_thread_pool() const'
- I have done some digging and found that these references are included in the bazel build of the model but for some reason I get undefined references.
Is there a way to fix this error? I assume that somewhere tfcompile links the LLVM code to these conv functions but I cannot find where?
Many thanks