Commit Graph

16 Commits

Author SHA1 Message Date
Peter Goldsborough
75ccfb321b Fix cpp_extensins.py (#6722) 2018-04-18 22:43:12 -04:00
Peter Goldsborough
c14b62fca2 Create FileBaton to synchronize distributed JIT C++ extension builds (#6684)
* Create FileBaton to synchronize distributed JIT C++ extension builds

* Move FileBaton to its own file

* Autoformat code

* Respect verbose flag in cpp_extension._prepare_ldflags
2018-04-18 18:07:03 -04:00
ngimel
96e2140ffb Check for g++ also in check_compiler_ABI (#6711)
Otherwise a spurious warning is generated. @goldsborough
2018-04-18 20:30:52 +01:00
Peter Goldsborough
ae592b4999
Louder warning for C++ extensions (#6435) 2018-04-10 12:47:39 -07:00
Kento NOZAWA
3b58b859b2 Fix typos in docs (#6389) 2018-04-07 12:41:15 -04:00
peterjc123
63af898d46 Fix extension test on Windows (#5548)
* Change cpp_extensions.py to make it work on Windows

* Fix linting

* Show python paths

* Debug

* Debug 1

* set PYTHONPATH

* Add ATen into library

* expose essential libs and functions, and copy _C.lib

* Specify dir in header

* Update check_abi for MSVC

* Activate cl environment to compile cpp extensions

* change version string

* Redirect stderr to stdout

* Add monkey patch for windows

* Remove unnecessary self

* Fix various issues

* Append necessary flags

* add /MD flag to cuda

* Install ninja

* Use THP_API instead of THP_CLASS

* Beautify the paths

* Revert "Use THP_API instead of THP_CLASS"

This reverts commit dd7e74c44db48e4c5f85bb8e3c698ff9de71ba2d.

* Use THP_API instead of THP_CLASS(new)
2018-04-02 13:53:25 -04:00
Peter Goldsborough
792daeb422 Enable documentation for C++ extensions on the website (#5597) 2018-03-07 14:07:26 +01:00
Peter Goldsborough
b10fcca5f0 Install cuda headers in ATen build (#5474) 2018-02-28 19:36:41 -08:00
Peter Goldsborough
008ba18c5b Improve CUDA extension support (#5324)
* Also pass torch includes to nvcc build

* Export ATen/cuda headers with install

* Refactor flags common to C++ and CUDA

* Improve tests for C++/CUDA extensions

* Export .cuh files under THC

* Refactor and clean cpp_extension.py slightly

* Include ATen in cuda extension test

* Clarifying comment in cuda_extension.cu

* Replace cuda_extension.cu with cuda_extension_kernel.cu in setup.py

* Copy compile args in C++ extension and add second kernel

* Conditionally add -std=c++11 to cuda_flags

* Also export cuDNN headers

* Add comment about deepcopy
2018-02-23 10:15:30 -05:00
Peter Goldsborough
22fe542b8e Use TORCH_EXTENSION_NAME macro to avoid mismatched module/extension name (#5277)
* Warn users about mismatched module/extension name

* Define TORCH_EXTENSION_NAME macro
2018-02-16 22:31:04 -05:00
Peter Goldsborough
fe72037c68 Add CUDA support for JIT-compiling C++ extensions (#5226) 2018-02-15 15:50:01 -05:00
Peter Goldsborough
1b71e78d13 CUDA support for C++ extensions with setuptools (#5207)
This PR adds support for convenient CUDA integration in our C++ extension mechanism. This mainly involved figuring out how to get setuptools to use nvcc for CUDA files and the regular C++ compiler for C++ files. I've added a mixed C++/CUDA test case which works great.

I've also added a CUDAExtension and CppExtension function that constructs a setuptools.Extension with "usually the right" arguments, which reduces the required boilerplate to write an extension even more. Especially for CUDA, where library_dir (CUDA_HOME/lib64) and libraries (cudart) have to be specified as well.

Next step is to enable this with our "JIT" mechanism.

NOTE: I've had to write a small find_cuda_home function to find the CUDA install directory. This logic is kind of a duplicate of tools/setup_helpers/cuda.py, but that's not available in the shipped PyTorch distribution. The function is also fairly short. Let me know if it's fine to duplicate this logic.

* CUDA support for C++ extensions with setuptools

* Remove printf in CUDA test kernel

* Remove -arch flag in test/cpp_extensions/setup.py

* Put wrap_compile into BuildExtension

* Add guesses for CUDA_HOME directory

* export PATH to CUDA location in test.sh

* On Python2, sys.platform has the linux version number
2018-02-13 15:02:50 -08:00
Peter Goldsborough
390d542db2 Modify .jenkins/test.sh to install ninja 2018-02-01 22:42:07 -08:00
Peter Goldsborough
733ce9529e [cpp-extensions] Implement torch.utils.cpp_extensions.load() 2018-02-01 22:42:07 -08:00
Peter Goldsborough
9e36f979c9 Add ABI compatibility check to cpp_extensions.py 2018-02-01 16:19:03 -08:00
Peter Goldsborough
1262fba8e7 [cpp extensions] Create torch.h and update setup.py 2018-02-01 16:19:03 -08:00