hust-nj / pytorch-cpp-cuda-tutorial

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pytorch-cpp-cuda tutorial

This is the code of tutorial about how to use c++ and cuda to accelerate the code of forward and backward in pytorch from https://pytorch.org/tutorials/advanced/cpp_extension.html

Installation

bash init.sh

Compare the speed

python -m tools.compare

to compare the speed of

  • naive pytorch code
  • c++ pytorch code
  • c++ with cuda kernel pytorch code

About


Languages

Language:Cuda 41.9%Language:Python 33.4%Language:C++ 24.4%Language:Shell 0.3%