NVlabs / AutoDMP

Apache License 2.0
124 stars 22 forks source link

build failed #1

Open Mr-Fang-VLSI opened 1 year ago

Mr-Fang-VLSI commented 1 year ago

I used the docker image from limbo018/dreamplace:cuda. And when I try to build AutoDMP, several functions are not matched or not found, the log is below.

In file included from /home/grads/d/donghao/.local/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:37:0, from /home/grads/d/donghao/.local/lib/python3.8/site-packages/torch/include/ATen/core/Tensor.h:3, from /home/grads/d/donghao/.local/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3, from /home/grads/d/donghao/.local/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/function_hook.h:3, from /home/grads/d/donghao/.local/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/cpp_hook.h:2, from /home/grads/d/donghao/.local/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/variable.h:6, from /home/grads/d/donghao/.local/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/autograd.h:3, from /home/grads/d/donghao/.local/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/autograd.h:3, from /home/grads/d/donghao/.local/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7, from /home/grads/d/donghao/.local/lib/python3.8/site-packages/torch/include/torch/extension.h:4, from /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/../utility/src/torch.h:13, from /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/src/dct.h:9, from /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/src/dct.cpp:6: /home/grads/d/donghao/.local/lib/python3.8/site-packages/torch/include/ATen/core/TensorBase.h:548:7: note: candidate: template T at::TensorBase::data_ptr() const T data_ptr() const; ^~~~ /home/grads/d/donghao/.local/lib/python3.8/site-packages/torch/include/ATen/core/TensorBase.h:548:7: note: template argument deduction/substitution failed: In file included from /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/src/dct.h:9:0, from /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/src/dct.cpp:6: /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/src/dct.cpp: In lambda function: /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/../utility/src/torch.h:32:3: error: 'AT_PRIVATE_CASE_TYPE' was not declared in this scope AT_PRIVATE_CASE_TYPE(NAME, enum_type, type, VA_ARGS__) ^ /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/../utility/src/torch.h:32:3: note: in definition of macro 'DREAMPLACE_PRIVATE_CASE_TYPE' AT_PRIVATE_CASE_TYPE(NAME, enum_type, type, VA_ARGS) ^~~~~~~~ /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/src/dct.cpp:174:3: note: in expansion of macro 'DREAMPLACE_DISPATCH_FLOATING_TYPES' DREAMPLACE_DISPATCH_FLOATING_TYPES(x, "idct2_forward", [&] { ^ /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/../utility/src/torch.h:32:3: note: suggested alternative: 'DREAMPLACE_PRIVATE_CASE_TYPE' AT_PRIVATE_CASE_TYPE(NAME, enum_type, type, VA_ARGS) ^ /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/../utility/src/torch.h:32:3: note: in definition of macro 'DREAMPLACE_PRIVATE_CASE_TYPE' AT_PRIVATE_CASE_TYPE(NAME, enum_type, type, __VA_ARGS) ^~~~~~~~ /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/src/dct.cpp:174:3: note: in expansion of macro 'DREAMPLACE_DISPATCH_FLOATING_TYPES' DREAMPLACE_DISPATCH_FLOATING_TYPES(x, "idct2_forward", [&] { ^ /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/../utility/src/torch.h:32:58: error: expected primary-expression before ')' token AT_PRIVATE_CASE_TYPE(NAME, enum_type, type, VA_ARGS) ^ /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/../utility/src/torch.h:75:7: note: in expansion of macro 'DREAMPLACE_PRIVATE_CASE_TYPE' DREAMPLACE_PRIVATE_CASE_TYPE(NAME, at::ScalarType::Float, float, VA_ARGS) \ ^~~~~~~~ /home/grads/d/donghao/AutoDMP/dreamplace/ops/dct/src/dct.cpp:174:3: note: in expansion of macro 'DREAMPLACE_DISPATCH_FLOATING_TYPES' DREAMPLACE_DISPATCH_FLOATING_TYPES(x, "idct2_forward", [&] { ^ dreamplace/ops/dct/CMakeFiles/dct_cpp.dir/build.make:78: recipe for target 'dreamplace/ops/dct/CMakeFiles/dct_cpp.dir/src/dct.cpp.o' failed make[2]: [dreamplace/ops/dct/CMakeFiles/dct_cpp.dir/src/dct.cpp.o] Error 1 make[2]: Leaving directory '/home/grads/d/donghao/AutoDMP/build' CMakeFiles/Makefile2:2811: recipe for target 'dreamplace/ops/dct/CMakeFiles/dct_cpp.dir/all' failed make[1]: [dreamplace/ops/dct/CMakeFiles/dct_cpp.dir/all] Error 2 make[1]: Leaving directory '/home/grads/d/donghao/AutoDMP/build' Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 Singularity> make install

AIbotLab commented 1 year ago

You can try like below Add the following code to the file AutoDMP-main/dreamplace/ops/utility/src/torch.h

line 29
#if TORCH_MAJOR_VERSION > 1 || (TORCH_MAJOR_VERSION == 1 && TORCH_MINOR_VERSION >= 8)
#Add after this paragraph

// AT_PRIVATE_CASE_TYPE was recently removed from the public dispatch API (look in the Dispatch.h)
#define AT_PRIVATE_CASE_TYPE(NAME, enum_type, type, ...) \
  case enum_type: {                                      \
    using scalar_t = type;                               \
    return __VA_ARGS__();                                \
  }
agnesina commented 1 year ago

Hi, as AlbotLab said, adding the torch version check for AT_PRIVATE_CASE_TYPE should fix the issue. We actually expected users to use our Dockerfile which has torch 1.10.