There is an optimization pass which precomputes the computation graph to prune the nodes that can be calculated in advance. So you should be able to run float16 on your building environment. For your problem,
@tqchen says:
This is because the native x86 do not have fp16 support. We need to link a fallback library from compiler-rt. I do not know however, how to do this properly. So here is one hack that works.
clone https://github.com/llvm-mirror/compiler-rt to local folder.
Add a file src/runtime/fp16_f2h.cc
to your tvm code, with the following line
extern "C" {
#include "/path/to/compiler-rt/lib/builtins/truncsfhf2.c"
}
Add another file src/runtime/fp16_h2f.cc
, with the following line
extern "C" {
#include "/path/to/compiler-rt/lib/builtins/extendhfsf2.c"
}
That specific file contains a fallback implementation that can be used in x86. A better way to solve this problem would be figure out how to link compiler-rt’s builtin properly. Which I am not able to do so far.