DeepGraphLearning / AStarNet

Official implementation of A* Networks
MIT License
134 stars 15 forks source link

subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1. #6

Open Irena-Zhang opened 1 month ago

Irena-Zhang commented 1 month ago

`Loading /public/home/yqzhang/modeltest/0_path_model/AStarNet-master/datasets/knowledge_graphs/fb15k237_train.tx Loading /public/home/yqzhang/modeltest/0_path_model/AStarNet-master/datasets/knowledge_graphs/fb15k237_valid.tx Loading /public/home/yqzhang/modeltest/0_path_model/AStarNet-master/datasets/knowledge_graphs/fb15k237_test.txt 10:25:25 FB15k237(

entity: 14541

relation: 237

triplet: 310116

) 10:25:25 #train: 272115, #valid: 17535, #test: 20466 Traceback (most recent call last): File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1906, in _run_ninja_build env=env) File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/subprocess.py", line 512, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "script/run.py", line 58, in solver = util.build_solver(cfg, dataset) File "/public/home/yqzhang/modeltest/0_path_model/AStarNet-master/reasoning/util.py", line 104, in build_solver task = core.Configurable.load_config_dict(cfg.task) File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/core/core.py", line 269, in load_config_dict v = _Configurable.load_config_dict(v) File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/core/core.py", line 269, in load_config_dict v = _Configurable.load_config_dict(v) File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/core/core.py", line 277, in load_config_dict return cls(new_config) File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/decorator.py", line 232, in fun return caller(func, *(extras + args), *kw) File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/core/core.py", line 296, in wrapper return init(self, args, kwargs) File "/public/home/yqzhang/modeltest/0_path_model/AStarNet-master/reasoning/layer.py", line 55, in init functional.generalized_rspmm(adjacency, relation_input, input, sum="add", mul="mul") File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/layers/functional/spmm.py", line 378, in generalized_rspmm return Function.apply(sparse.coalesce(), relation, input) File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/layers/functional/spmm.py", line 174, in forward forward = spmm.rspmm_add_mul_forward_cpu File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/utils/torch.py", line 26, in getattr return getattr(self.module, key) File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/utils/decorator.py", line 102, in get result = self.func(obj) File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/utils/torch.py", line 32, in module self.verbose, **self.kwargs) File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1296, in load keep_intermediates=keep_intermediates) File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1518, in _jit_compile is_standalone=is_standalone) File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1626, in _write_ninja_file_and_build_library error_prefix=f"Error building extension '{name}'") File "/public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1916, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error building extension 'spmm': [1/5] c++ -MMD -MF rspmm.o.d -DTORCH_EXTENSION_NAME=spmm -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/TH -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/THC -isystem /public/home/yqzhang/cuda/cuda11/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -Ofast -fopenmp -DAT_PARALLEL_OPENMP -DCUDA_OP -c /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/layers/functional/extension/rspmm.cpp -o rspmm.o [2/5] c++ -MMD -MF spmm.o.d -DTORCH_EXTENSION_NAME=spmm -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/TH -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/THC -isystem /public/home/yqzhang/cuda/cuda11/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -Ofast -fopenmp -DAT_PARALLEL_OPENMP -DCUDA_OP -c /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/layers/functional/extension/spmm.cpp -o spmm.o [3/5] /public/home/yqzhang/cuda/cuda11/bin/nvcc -DTORCH_EXTENSION_NAME=spmm -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/TH -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/THC -isystem /public/home/yqzhang/cuda/cuda11/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -O3 -std=c++14 -c /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/layers/functional/extension/rspmm.cu -o rspmm.cuda.o FAILED: rspmm.cuda.o /public/home/yqzhang/cuda/cuda11/bin/nvcc -DTORCH_EXTENSION_NAME=spmm -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/TH -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/THC -isystem /public/home/yqzhang/cuda/cuda11/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -O3 -std=c++14 -c /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/layers/functional/extension/rspmm.cu -o rspmm.cuda.o /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’: 435 | function(_Functor&& f) | ^ /usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’ /usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’: 530 | operator=(_Functor&& f) | ^ /usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’ [4/5] /public/home/yqzhang/cuda/cuda11/bin/nvcc -DTORCH_EXTENSION_NAME=spmm -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/TH -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/THC -isystem /public/home/yqzhang/cuda/cuda11/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -O3 -std=c++14 -c /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/layers/functional/extension/spmm.cu -o spmm.cuda.o FAILED: spmm.cuda.o /public/home/yqzhang/cuda/cuda11/bin/nvcc -DTORCH_EXTENSION_NAME=spmm -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/TH -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torch/include/THC -isystem /public/home/yqzhang/cuda/cuda11/include -isystem /public/home/yqzhang/anaconda3/envs/kgmodel/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -O3 -std=c++14 -c /public/home/yqzhang/anaconda3/envs/kgmodel/lib/python3.7/site-packages/torchdrug/layers/functional/extension/spmm.cu -o spmm.cuda.o /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’: 435 | function(_Functor&& f) | ^ /usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’ /usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’: 530 | operator=(_Functor&& f) | ^ /usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’ ninja: build stopped: subcommand failed.`

Hello, Thanks for your nice work. When I try to replicate your results in GPU, I meet the error about C++ spmm. Would you know how to fix this? Thanks, and have a nice day!

Wendysigh commented 3 weeks ago

I also encounter similar issues. don't how to fix

Wendysigh commented 3 weeks ago

I found the solution discussed in previous issue: https://github.com/DeepGraphLearning/AStarNet/issues/3 the problem is caused by TorchDrug, the missing header file in different versions, e.g., "ATen/SparseTensorUtils.h" should be change to "ATen/native/SparseTensorUtils.h".

Irena-Zhang commented 2 days ago

I found the solution discussed in previous issue: #3 the problem is caused by TorchDrug, the missing header file in different versions, e.g., "ATen/SparseTensorUtils.h" should be change to "ATen/native/SparseTensorUtils.h".

Thanks for your tip! I will try to modify it.