项目作者: chrischoy

项目描述 :
How and why you want to make your pytorch CUDA/CPP extension with a Makefile
高级语言: Makefile
项目地址: git://github.com/chrischoy/MakePytorchPlusPlus.git
创建时间: 2018-12-21T13:14:44Z
项目社区:https://github.com/chrischoy/MakePytorchPlusPlus

开源协议:

下载


Developing a Pytorch CPP/CUDA Extension with a Makefile

Pytorch cpp extensions provides a good way to augment pytorch with custom functions. The cpp-extension uses the setuptool to compile files. However, as it is mainly used for deployment rather than debugging and development, using the setuptool for development can be slow and cumbersome.

In this repository, I provide an alternative way to compile and debug your custom extension with a makefile.
The associated tutorial can be found at the blog post.

Installation

You must have torch installed in your current (virtual environment) python.

  1. git clone https://github.com/chrischoy/MakePytorchPlusPlus
  2. cd MakePytorchPlusPlus
  3. python setup.py install

It automatically selects the maximum number of CPU for parallel compilation.

Running the example

  1. python example.py