Open serhaty opened 5 years ago
I downgraded my llvm version to 8.0.1 using brew but now getting some build failure, when building torch_tvm itself. here is the log from first error:
In file included from /Users/serhaty/local/tvm/torch_tvm/operators.cpp:6:
In file included from /Users/serhaty/local/pytorch/torch/include/torch/csrc/autograd/record_function.h:3:
In file included from /Users/serhaty/local/pytorch/torch/include/ATen/core/ivalue.h:5:
In file included from /Users/serhaty/local/pytorch/torch/include/ATen/core/TensorBody.h:11:
In file included from /Users/serhaty/local/pytorch/torch/include/c10/core/TensorImpl.h:17:
In file included from /Users/serhaty/local/pytorch/torch/include/c10/util/Logging.h:28:
/Users/serhaty/local/pytorch/torch/include/c10/util/logging_is_not_google_glog.h:169:9: warning: 'CHECK_NOTNULL' macro redefined [-Wmacro-redefined]
#define CHECK_NOTNULL(val) \
^
/Users/serhaty/local/tvm/tvm/3rdparty/dmlc-core/include/dmlc/logging.h:215:9: note: previous definition is here
#define CHECK_NOTNULL(x) \
^
In file included from /Users/serhaty/local/tvm/torch_tvm/compiler.cpp:1:
In file included from /Users/serhaty/local/tvm/torch_tvm/compiler.h:3:
In file included from /Users/serhaty/local/pytorch/torch/include/torch/csrc/jit/argument_spec.h:3:
In file included from /Users/serhaty/local/pytorch/torch/include/ATen/core/jit_type.h:3:
In file included from /Users/serhaty/local/pytorch/torch/include/ATen/core/TensorBody.h:3:
In file included from /Users/serhaty/local/pytorch/torch/include/c10/core/Device.h:3:
In file included from /Users/serhaty/local/pytorch/torch/include/c10/core/DeviceType.h:8:
In file included from /Users/serhaty/local/pytorch/torch/include/c10/macros/Macros.h:146:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream:174:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:138:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:505:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string_view:176:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__string:57:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:641:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:3161:38: error: implicit instantiation of undefined
template 'std::__1::hash<c10::ScalarType>'
: public integral_constant<bool, __is_constructible(_Tp, _Args...)>
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:3420:14: note: in instantiation of template class
'std::__1::is_constructible<std::__1::hash<c10::ScalarType>, const std::__1::hash<c10::ScalarType> &>' requested here
: public is_constructible<_Tp,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:1597:5: note: in instantiation of template class
'std::__1::is_copy_constructible<std::__1::hash<c10::ScalarType> >' requested here
is_copy_constructible<_Hash>::value &&
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table:868:19: note: in instantiation of template type alias
'__check_hash_requirements' requested here
static_assert(__check_hash_requirements<_Key, _Hash>::value,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table:883:1: note: in instantiation of template class
'std::__1::__enforce_unordered_container_requirements<c10::ScalarType, std::__1::hash<c10::ScalarType>, std::__1::equal_to<c10::ScalarType> >' requested here
typename __enforce_unordered_container_requirements<_Key, _Hash, _Equal>::type
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/unordered_map:856:26: note: while substituting explicitly-specified
template arguments into function template '__diagnose_unordered_container_requirements'
static_assert(sizeof(__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), "");
^
/Users/serhaty/local/tvm/torch_tvm/compiler.cpp:92:73: note: in instantiation of template class 'std::__1::unordered_map<c10::ScalarType, tvm::DataType,
std::__1::hash<c10::ScalarType>, std::__1::equal_to<c10::ScalarType>, std::__1::allocator<std::__1::pair<const c10::ScalarType, tvm::DataType> > >' requested here
static const std::unordered_map<at::ScalarType, tvm::relay::DataType> type_mapping = {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:417:50: note: template is declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:3161:38: error: implicit instantiation of undefined
template 'std::__1::hash<c10::ScalarType>'
: public integral_constant<bool, __is_constructible(_Tp, _Args...)>
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:3434:14: note: in instantiation of template class
'std::__1::is_constructible<std::__1::hash<c10::ScalarType>, std::__1::hash<c10::ScalarType> &&>' requested here
: public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:1598:5: note: in instantiation of template class
'std::__1::is_move_constructible<std::__1::hash<c10::ScalarType> >' requested here
is_move_constructible<_Hash>::value &&
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table:868:19: note: in instantiation of template type alias
'__check_hash_requirements' requested here
static_assert(__check_hash_requirements<_Key, _Hash>::value,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table:883:1: note: in instantiation of template class
'std::__1::__enforce_unordered_container_requirements<c10::ScalarType, std::__1::hash<c10::ScalarType>, std::__1::equal_to<c10::ScalarType> >' requested here
typename __enforce_unordered_container_requirements<_Key, _Hash, _Equal>::type
@bwasti here is the version of clang++
$ clang++ --version
clang version 8.0.1 (tags/RELEASE_801/final)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
the last error seems related to pytorch -- can you try a different version of PT?
I did rebuild both pytorch and tvm with clang++ which cleared recent errors but looks like there is one more error remaining:
In file included from /Users/serhaty/local/tvm/torch_tvm/compiler.h:5:
In file included from /Users/serhaty/local/tvm/tvm/include/tvm/relay/expr.h:27: In file included from /Users/serhaty/local/tvm/tvm/include/tvm/attrs.h:48:
In file included from /Users/serhaty/local/tvm/tvm/3rdparty/dmlc-core/include/dmlc/common.h:14: /Users/serhaty/local/tvm/tvm/3rdparty/dmlc-core/include/dmlc/./logging.h:257:9: warning: 'LOG' macro redefined [-Wmacro-redefined]
#define LOG(severity) LOG_##severity.stream() ^
/Users/serhaty/local/pytorch/torch/include/c10/util/logging_is_not_google_glog.h:96:9: note: previous definition is here #define LOG(n) \ ^
In file included from /Users/serhaty/local/tvm/torch_tvm/register.cpp:8: In file included from /Users/serhaty/local/tvm/torch_tvm/compiler.h:5: In file included from /Users/serhaty/local/tvm/tvm/include/tvm/relay/expr.h:27:
In file included from /Users/serhaty/local/tvm/tvm/include/tvm/attrs.h:48: In file included from /Users/serhaty/local/tvm/tvm/3rdparty/dmlc-core/include/dmlc/common.h:14:
/Users/serhaty/local/tvm/tvm/3rdparty/dmlc-core/include/dmlc/./logging.h:259:9: warning: 'LOG_IF' macro redefined [-Wmacro-redefined]
#define LOG_IF(severity, condition) \ ^
/Users/serhaty/local/pytorch/torch/include/c10/util/logging_is_not_google_glog.h:101:9: note: previous definition is here #define LOG_IF(n, condition) \ ^
18 warnings and 1 error generated.
make[2]: *** [CMakeFiles/_torch_tvm.dir/torch_tvm/memory_utils.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs....
/Users/serhaty/local/tvm/torch_tvm/register.cpp:124:14: error: conversion from 'tvm::runtime::TVMArgValue' to 'size_t' (aka 'unsigned long') is ambiguous
size_t id = args[0]; ^ ~~~~~~~
/Users/serhaty/local/tvm/tvm/include/tvm/runtime/packed_func.h:441:3: note: candidate function
operator double() const { ^
/Users/serhaty/local/tvm/tvm/include/tvm/runtime/packed_func.h:451:3: note: candidate function operator int64_t() const {
^
/Users/serhaty/local/tvm/tvm/include/tvm/runtime/packed_func.h:455:3: note: candidate function operator uint64_t() const { ^
/Users/serhaty/local/tvm/tvm/include/tvm/runtime/packed_func.h:459:3: note: candidate function
operator int() const { ^
/Users/serhaty/local/tvm/tvm/include/tvm/runtime/packed_func.h:465:3: note: candidate function
operator bool() const { ^
18 warnings and 1 error generated. make[2]: *** [CMakeFiles/_torch_tvm.dir/torch_tvm/register.cpp.o] Error 1
make[1]: *** [CMakeFiles/_torch_tvm.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
File "setup.py", line 273, in <module> url='https://github.com/pytorch/tvm',
File "//anaconda3/envs/pytorch/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "//anaconda3/envs/pytorch/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "//anaconda3/envs/pytorch/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd) File "//anaconda3/envs/pytorch/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run() File "setup.py", line 181, in run
self.run_command('build_ext')
File "//anaconda3/envs/pytorch/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "//anaconda3/envs/pytorch/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 187, in run self.run_command('cmake_build') File "//anaconda3/envs/pytorch/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command) File "//anaconda3/envs/pytorch/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run()
File "setup.py", line 176, in run self._run_build() File "setup.py", line 165, in _run_build
subprocess.check_call(build_args) File "//anaconda3/envs/pytorch/lib/python3.7/subprocess.py", line 347, in check_call raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['//anaconda3/envs/pytorch/bin/cmake', '--build', '.', '--', '-j', '16']' returned non-zero exit status 2.
/Users/serhaty/local/tvm/torch_tvm/register.cpp:124:14: error: conversion from 'tvm::runtime::TVMArgValue' to 'size_t' (aka 'unsigned long') is ambiguous
size_t id = args[0];
seems legit
I am trying to build the project but it is failing errors on llvm-project directory. Here are steps I am following to build the project on my mac laptop:
And this is my environment setup of the tools:
Here is the output from the above command: