Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Irena-Zhang opened this issue Sep 27, 2024 · 2 comments

Comments

@Irena-Zhang
Copy link

`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 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS
-D__CUDA_NO_BFLOAT16_CONVERSIONS
-D__CUDA_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 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS
-D__CUDA_NO_BFLOAT16_CONVERSIONS
-D__CUDA_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 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS
-D__CUDA_NO_BFLOAT16_CONVERSIONS
-D__CUDA_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 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS
-D__CUDA_NO_BFLOAT16_CONVERSIONS
-D__CUDA_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
Copy link

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

@Wendysigh
Copy link

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants