pytorch / extension-cpp

C++ extensions in PyTorch
1.02k stars 214 forks source link

Does extension-cpp works with Pytorch 0.4? #38

Closed hadifar closed 5 years ago

hadifar commented 5 years ago

I tried to run the cuda version on pytorch 0.4 but it said:

writing manifest file 'lltm_cuda.egg-info/SOURCES.txt'
reading manifest file 'lltm_cuda.egg-info/SOURCES.txt'
writing manifest file 'lltm_cuda.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'lltm_cuda' extension
creating build
creating build/temp.linux-x86_64-3.7
gcc -pthread -B /groups/wall2-ilabt-iminds-be/cmsearch/users/amir/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/groups/wall2-ilabt-iminds-be/cmsearch/users/amir/miniconda3/lib/python3.7/site-packages/torch/lib/include -I/groups/wall2-ilabt-iminds-be/cmsearch/users/amir/miniconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/groups/wall2-ilabt-iminds-be/cmsearch/users/amir/miniconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/groups/wall2-ilabt-iminds-be/cmsearch/users/amir/miniconda3/include/python3.7m -c lltm_cuda.cpp -o build/temp.linux-x86_64-3.7/lltm_cuda.o -DTORCH_EXTENSION_NAME=lltm_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
lltm_cuda.cpp:1:29: fatal error: torch/extension.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

Do you have any idea how can I resolve this issue? (If I update to pytorch 1.xx it would be OK but I need 0.4x version)

soumith commented 5 years ago

doesn't work in 0.4

ClementPinard commented 5 years ago

See this repo at a previous commit for compatibility with torch 0.4 https://github.com/pytorch/extension-cpp/tree/eea6d318bc6b86d43e8091156961f73beb293a13

It is extremely discouraged to write cpp extensions with now deprecated torch 0.4 's API though.