pytorch / Extension Cpp
C++ extensions in PyTorch
Stars: ✭ 638
Programming Languages
python
139335 projects - #7 most used programming language
C++/CUDA Extensions in PyTorch
An example of writing a C++ extension for PyTorch. See here for the accompanying tutorial.
There are a few "sights" you can metaphorically visit in this repository:
- Inspect the C++ and CUDA extensions in the
cpp/
andcuda/
folders, - Build C++ and/or CUDA extensions by going into the
cpp/
orcuda/
folder and executingpython setup.py install
, - JIT-compile C++ and/or CUDA extensions by going into the
cpp/
orcuda/
folder and callingpython jit.py
, which will JIT-compile the extension and load it, - Benchmark Python vs. C++ vs. CUDA by running
python benchmark.py {py, cpp, cuda} [--cuda]
, - Run gradient checks on the code by running
python grad_check.py {py, cpp, cuda} [--cuda]
. - Run output checks on the code by running
python check.py {forward, backward} [--cuda]
.
Authors
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].