TVM Build Failure in recent version

When I update my TVM version to the latest version(commit-id: f3d8ba48511106a5904abea18d5a1f596871ac3d), It build failure.

When I rolled back TVM to a history version, TVM was built successfully in an old version on Mar 25. 2022 (commit-id: 079eb4e).

Traceback

2 errors generated.
CMakeFiles/tvm_objs.dir/build.make:3743: recipe for target 'CMakeFiles/tvm_objs.dir/src/tir/usmp/utils.cc.o' failed
make[2]: *** [CMakeFiles/tvm_objs.dir/src/tir/usmp/utils.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /workplace/software/tvm/tvm/src/target/compilation_config.cc:25:
In file included from /workplace/software/tvm/tvm/include/tvm/runtime/device_api.h:28:
In file included from /workplace/software/tvm/tvm/include/tvm/runtime/ndarray.h:28:
In file included from /workplace/software/tvm/tvm/include/tvm/runtime/container/./optional.h:29:
In file included from /workplace/software/tvm/tvm/include/tvm/runtime/container/base.h:27:
In file included from /workplace/software/tvm/tvm/3rdparty/dmlc-core/include/dmlc/./logging.h:132:
In file included from /workplace/software/tvm/tvm/include/tvm/runtime/logging.h:42:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/unordered_map:47:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/hashtable.h:35:
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/hashtable_policy.h:85:11: error: implicit instantiation of undefined template 'std::hash<DLDeviceType>'
        noexcept(declval<const _Hash&>()(declval<const _Key&>()))>
                 ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/type_traits:138:14: note: in instantiation of template class 'std::__detail::__is_noexcept_hash<DLDeviceType,
      std::hash<DLDeviceType> >' requested here
    : public conditional<_B1::value, _B2, _B1>::type
             ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/type_traits:148:39: note: in instantiation of template class
      'std::__and_<std::__is_fast_hash<std::hash<DLDeviceType> >, std::__detail::__is_noexcept_hash<DLDeviceType, std::hash<DLDeviceType> > >' requested here
    : public integral_constant<bool, !_Pp::value>
                                      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unordered_set.h:45:34: note: in instantiation of template class
      'std::__not_<std::__and_<std::__is_fast_hash<std::hash<DLDeviceType> >, std::__detail::__is_noexcept_hash<DLDeviceType, std::hash<DLDeviceType> > > >' requested here
           typename _Tr = __uset_traits<__cache_default<_Value, _Hash>::value>>
                                        ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unordered_set.h:95:15: note: in instantiation of default argument for '__uset_hashtable<DLDeviceType,
      std::hash<DLDeviceType>, std::equal_to<DLDeviceType>, std::allocator<DLDeviceType> >' required here
      typedef __uset_hashtable<_Value, _Hash, _Pred, _Alloc>  _Hashtable;
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/workplace/software/tvm/tvm/src/target/compilation_config.cc:149:36: note: in instantiation of template class 'std::unordered_set<DLDeviceType, std::hash<DLDeviceType>,
      std::equal_to<DLDeviceType>, std::allocator<DLDeviceType> >' requested here
  std::unordered_set<DLDeviceType> primitive_target_device_types;
                                   ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/system_error:134:12: note: template is declared here
    struct hash;
           ^
In file included from /workplace/software/tvm/tvm/src/target/compilation_config.cc:25:
In file included from /workplace/software/tvm/tvm/include/tvm/runtime/device_api.h:28:
In file included from /workplace/software/tvm/tvm/include/tvm/runtime/ndarray.h:33:
In file included from /workplace/software/tvm/tvm/include/tvm/runtime/serializer.h:28:
In file included from /workplace/software/tvm/tvm/3rdparty/dmlc-core/include/dmlc/./io.h:446:
In file included from /workplace/software/tvm/tvm/3rdparty/dmlc-core/include/dmlc/serializer.h:26:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/unordered_set:48:
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unordered_set.h:494:7: error: multiple overloads of 'erase' instantiate to the same signature
      'std::unordered_set<DLDeviceType, std::hash<DLDeviceType>, std::equal_to<DLDeviceType>, std::allocator<DLDeviceType> >::iterator (std::unordered_set<DLDeviceType,
      std::hash<DLDeviceType>, std::equal_to<DLDeviceType>, std::allocator<DLDeviceType> >::iterator)' (aka 'int (int)')
      erase(iterator __position)
      ^
/workplace/software/tvm/tvm/src/target/compilation_config.cc:149:36: note: in instantiation of template class 'std::unordered_set<DLDeviceType, std::hash<DLDeviceType>,
      std::equal_to<DLDeviceType>, std::allocator<DLDeviceType> >' requested here
  std::unordered_set<DLDeviceType> primitive_target_device_types;
                                   ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unordered_set.h:489:7: note: previous declaration is here
      erase(const_iterator __position)
      ^
2 errors generated.
CMakeFiles/tvm_objs.dir/build.make:3869: recipe for target 'CMakeFiles/tvm_objs.dir/src/target/compilation_config.cc.o' failed
make[2]: *** [CMakeFiles/tvm_objs.dir/src/target/compilation_config.cc.o] Error 1
1 warning generated.
CMakeFiles/Makefile2:228: recipe for target 'CMakeFiles/tvm_objs.dir/all' failed
make[1]: *** [CMakeFiles/tvm_objs.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

Environment

  • Ubuntu 18.04
  • cmake 3.23.1
  • LLVM 8.0.1
  • gcc 5.4.0