VTA_LOG_UOP_BUFF_SIZE was not declared in this scope

[  0%] Building CXX object CMakeFiles/vta_tsim.dir/vta/src/runtime.cc.o
In file included from /root/tvm/vta/src/runtime.cc:29:0:
/root/tvm/vta/include/vta/hw_spec.h:104:33: error: 'VTA_LOG_UOP_BUFF_SIZE' was not declared in this scope
 #define VTA_LOG_UOP_BUFF_DEPTH (VTA_LOG_UOP_BUFF_SIZE - VTA_LOG_UOP_WIDTH + 3)
                                 ^
/root/tvm/vta/include/vta/hw_spec.h:303:29: note: in expansion of macro 'VTA_LOG_UOP_BUFF_DEPTH'
   uint64_t uop_bgn        : VTA_LOG_UOP_BUFF_DEPTH;
                             ^
/root/tvm/vta/include/vta/hw_spec.h:104:33: error: 'VTA_LOG_UOP_BUFF_SIZE' was not declared in this scope
 #define VTA_LOG_UOP_BUFF_DEPTH (VTA_LOG_UOP_BUFF_SIZE - VTA_LOG_UOP_WIDTH + 3)
                                 ^
/root/tvm/vta/include/vta/hw_spec.h:305:29: note: in expansion of macro 'VTA_LOG_UOP_BUFF_DEPTH'
   uint64_t uop_end        : VTA_LOG_UOP_BUFF_DEPTH + 1;
                             ^
/root/tvm/vta/include/vta/hw_spec.h:104:33: error: 'VTA_LOG_UOP_BUFF_SIZE' was not declared in this scope
 #define VTA_LOG_UOP_BUFF_DEPTH (VTA_LOG_UOP_BUFF_SIZE - VTA_LOG_UOP_WIDTH + 3)
                                 ^
/root/tvm/vta/include/vta/hw_spec.h:367:29: note: in expansion of macro 'VTA_LOG_UOP_BUFF_DEPTH'
   uint64_t uop_bgn        : VTA_LOG_UOP_BUFF_DEPTH;
                             ^
/root/tvm/vta/include/vta/hw_spec.h:104:33: error: 'VTA_LOG_UOP_BUFF_SIZE' was not declared in this scope
 #define VTA_LOG_UOP_BUFF_DEPTH (VTA_LOG_UOP_BUFF_SIZE - VTA_LOG_UOP_WIDTH + 3)
                                 ^
/root/tvm/vta/include/vta/hw_spec.h:369:29: note: in expansion of macro 'VTA_LOG_UOP_BUFF_DEPTH'
   uint64_t uop_end        : VTA_LOG_UOP_BUFF_DEPTH + 1;
                             ^
/root/tvm/vta/include/vta/hw_spec.h:62:33: error: 'VTA_LOG_UOP_BUFF_SIZE' was not declared in this scope
 #define VTA_UOP_BUFF_SIZE (1 << VTA_LOG_UOP_BUFF_SIZE)
                                 ^
/root/tvm/vta/include/vta/hw_spec.h:102:29: note: in expansion of macro 'VTA_UOP_BUFF_SIZE'
 #define VTA_UOP_BUFF_DEPTH (VTA_UOP_BUFF_SIZE / VTA_UOP_ELEM_BYTES)
                             ^
/root/tvm/vta/src/runtime.cc:485:37: note: in expansion of macro 'VTA_UOP_BUFF_DEPTH'
   static constexpr int kMaxNumUop = VTA_UOP_BUFF_DEPTH;

@jroesch @tmoreau89
Why CI does not handle this bug?
Does it use different cmake config where VTA is OFF?

1 Like

@apivovarov I think VTA_LOG_UOP_BUFF_SIZE is a variable to be customized, and it’s defined in vta_config.json. To better understand how VTA is built, please refer to the install document.

@liangfu Can you reproduce the error? Try to build with LLVM

mkdir build
cd build
cp ../cmake/config.cmake .
cmake USE_LLVM=ON ..
make

Install TVM from Source https://docs.tvm.ai/install/from_source.html

You can try adding VERBOSE=1 to make to see if all definitions show up in the compiler command line.

The first definition passed to the compiler invocation has the first letter truncated, i.e. instead of -DVTA_XYZ it ends up being -DTA_XYZ. Depending of whether the symbol is actually used, you get the compilation error or not.

likely due to an out-dated vta_config.json, try to clone from a clean source will likely solve the problem

Why VTA is enabled by default? Should we disable it in cmake config by default?

There is no additional dependencies in the simulator backend and we want our compilers to have testcases for tpu like accelerators, so it is enabled by default

Would be great if you can dig deeper into what is your particular case and does clean clone resolved the problem. As CI also build with vta simulator and it did not catch the problem

I tried to build TVM with LLVM from scratch another day and it worked fine. Not sure what exactly was the issue at the beginning. Maybe different cmake version.

About cmake config:
Even LLVM is OFF in cmake config by default…

Maybe we can turn off all VTAs in cmake config by default and explicitly enable VTA for CI builds?

Again, the problem is with how the compile command definitions are generated: VTA_LOG_UOP_BUFF_SIZE was not declared in this scope
We’ve run into this problem before.

can you suggest a possible patch to fix this problem? possibly by reordering the compilation flag.

Setting the file vta_config.json to DOS format seems to solve the problem.

Meet the problem too, until now I found python3.5 will cause the build fail randomly, I try to use python3.6 as the default python, then the build can success every time until now, but the root cause don’t be figured out.

I’m using python 3.7.3 on Mac and I ran into this problem as well. “VTA_LOG_UOP_BUFF_SIZE” is not declared in hw_spec.h. At the moment I have to disable all VTA builds in config.cmake to get the top build pass through.

Meet the problem too,How to set?