无法编译CogDL中的快速算子库
fixtech opened this issue · comments
源码编译,然后在运行时,发现没有调用cogdl/cogdl/operators/中相关的算子,例如GCN算法中,使用的spmm_scatter,而不是使用spmm/spmm_kernel.cu中的算子
pdb调试发现cogdl/operators/spmm.py:12,有个try: except;try失败,从而csrspmm = None
此处try的报错为:
RuntimeError: Error building extension 'spmm': [1/2] 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="_cxxabi1013" -isystem /usr/local/lib/python3.8/dist-packages/torch/include -isystem /usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/api/include -isystem /usr/local/lib/python3.8/dist-packages/torch/include/TH -isystem /usr/local/lib/python3.8/dist-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /usr/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -c /LARGE_RAID_DISK/home/s00555996/06_CogDL/cogdl/cogdl/operators/spmm/spmm.cpp -o spmm.o
FAILED: spmm.o
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="_cxxabi1013" -isystem /usr/local/lib/python3.8/dist-packages/torch/include -isystem /usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/api/include -isystem /usr/local/lib/python3.8/dist-packages/torch/include/TH -isystem /usr/local/lib/python3.8/dist-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /usr/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -c /LARGE_RAID_DISK/home/s00555996/06_CogDL/cogdl/cogdl/operators/spmm/spmm.cpp -o spmm.o
In file included from /usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/Device.h:3:0,
from /usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/api/include/torch/python.h:8,
from /usr/local/lib/python3.8/dist-packages/torch/include/torch/extension.h:6,
from /LARGE_RAID_DISK/home/s00555996/06_CogDL/cogdl/cogdl/operators/spmm/spmm.cpp:1:
/usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/python_headers.h:10:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
Environment
- OS: ubuntu 18.04
- Python version: 3.8
- PyTorch version: 1.12.0+cu116
- CUDA/cuDNN version: 116
- How did you try to install CogDL (wheel, source):source
- Any other relevant information: