Skip to content

Nic-Ma/extension-cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/ and cuda/ folders,
  • Build C++ and/or CUDA extensions by going into the cpp/ or cuda/ folder and executing python setup.py install,
  • JIT-compile C++ and/or CUDA extensions by going into the cpp/ or cuda/ folder and calling python 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

Peter Goldsborough

About

C++ extensions in PyTorch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 56.5%
  • Cuda 26.2%
  • C++ 17.3%