Hello I try to build official pytorch CUDA example from GitHub - pytorch/extension-cpp: C++ extensions in PyTorch
python setup.py install
invoked from the cuda subfolder of extension-cpp works well
Hovewer when I try to run
python jit.py
I get error
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.9.18
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
C:\Windows\System32>python D:\projects\extension-cpp\cuda\jit.py
Using C:\Users\jakub\AppData\Local\torch_extensions\torch_extensions\Cache\py37_cu113 as PyTorch extensions root...
Traceback (most recent call last):
File "D:\projects\extension-cpp\cuda\jit.py", line 3, in <module>
'lltm_cuda', ['lltm_cuda.cpp', 'lltm_cuda_kernel.cu'], verbose=True)
File "C:\Users\jakub\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\cpp_extension.py", line 1136, in load
keep_intermediates=keep_intermediates)
File "C:\Users\jakub\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\cpp_extension.py", line 1314, in _jit_compile
is_standalone=is_standalone,
File "C:\Users\jakub\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\_cpp_extension_versioner.py", line 45, in bump_version_if_changed
hash_value = hash_source_files(hash_value, source_files)
File "C:\Users\jakub\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\_cpp_extension_versioner.py", line 15, in hash_source_files
with open(filename) as file:
FileNotFoundError: [Errno 2] No such file or directory: 'lltm_cuda.cpp'
I also faund that somebody tried to make it work by changing setup.py to
setup(
name='lltm_cuda',
ext_modules=[
CUDAExtension('lltm_cuda', [
'lltm_cuda.cpp',
'lltm_cuda_kernel.cu'],
include_dirs=['/playpen/extension-cpp/demo/includes']
),
],
cmdclass={
'build_ext': BuildExtension
})
but I can not figure it out what include directory to include here because when I try
from torch.utils.cpp_extension import load
lltm_cuda = load(
'lltm_cuda', ['D:/projects/extension-cpp/cuda/lltm_cuda.cpp', 'D:/projects/extension-cpp/cuda/lltm_cuda_kernel.cu'], verbose=True)
help(lltm_cuda)
I get
list index out of range
my configuration
torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio===0.10.2+cu113
Python 6.3
I had also installed latest Microsoft Visual C++ Redistributable
Thanks for any help !!!