Build error: TypeError: Map is not registered via TVM_REGISTER_NODE_TYPE

Hello, while building the ONNX model (originally Pytorch) in TVM I got the following error: TypeError: Map is not registered via TVM_REGISTER_NODE_TYPE

I have quite hard time understanding the reason because as far as I know there is no any “Map” node you can use in the PyTorch/ONNX, also if I use run .graph on the ONNX model the output does not contain any definition of the “Map”

Just to make sure, I have tried to update the local repository, build it through conda environment, create a new python environment (venv) and run install from the build folder but Im still getting the same error

GitHub link: Build error: TypeError: Map is not registered via TVM_REGISTER_NODE_TYPE · Issue #7697 · apache/tvm (

Ah sorry I just found that its for node type. Since the community just merged a PR this morning that could print the backtrace line when crashing, could you do the following to gather more information:

  1. Update the repo to the latest commit.
  2. git submodule update.
  3. Build TVM with set(USE_LIBBACKTRACE ON).
  4. Run your script and post the error tracing here.

Also cc @junrushao1994

Sorry, I should have mentioned that I am building it on Windows, thus this option seems unavailable as I will get the following error:

-- Building with libbacktrace...
CMake Error at C:/ProgramData/Miniconda3/envs/tvm-build/Library/share/cmake-3.18/Modules/ExternalProject.cmake:2555 (message):
  No download info given for 'project_libbacktrace' and its source directory:


  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * URL
Call Stack (most recent call first):
  C:/ProgramData/Miniconda3/envs/tvm-build/Library/share/cmake-3.18/Modules/ExternalProject.cmake:3206 (_ep_add_download_command)
  cmake/modules/Libbacktrace.cmake:19 (ExternalProject_Add)
  CMakeLists.txt:405 (include)

Ah yes this doesn’t work on Windows now. Then could you just post whatever error message you got?

So the stack is really concise and so basically it referred to the reflection.h file, line 390 and error was just like the one in the tile: TypeError: Map is not registered via TVM_REGISTER_NODE_TYPE

may i take a look at the script you are using and the full stacktrace of the error? thanks a lot!

Ok I’m sorry for the confusion - I have solved the problem by using conda version of tvm rather than locally built one, thanks guys

Now there is another issue that the model contains dynamic layers, in particular, first convolutional layer has dimensions defined as [?, 4, ?, ?] → it can take arbitrary batch size with arbitrarily sized images, the only condition is to have 4 channels. Such dimension however fails on _pad intvm\topi\nn\ due to the fact that data.shape property has unknows (these ?), in particular it fails on the line containing not_zero.append(indices[i] < data.shape[i] + pad_before[i]). My question would be if there is a plan to support dynamic layers please? @junrushao1994 @comaniac