Tag Archives: PyTorch

Build PyTorch Extensions with CUDA and CFFI

Python is one of the most popular programming languages today for deep learning applications. However, as an interpreted language, it has been considered too slow for high-performance computing. Therefore, I incorporated CUDA into Python to build my own extension that accelerates the computation. In this tutorial, I give an example of CUDA extension for data augmentation in deep learning. Create Build Scripts First of all, we need to create a script for building FFI extension named build.py. Create CUDA Interface Then, we need to create an interface for CUDA which can be invoked by Python. In this tutorial, we name this file augmentation_cuda.c. Also, we need to create a header file augmentation.h and declare the corresponding prototype of the function…

Continue Reading
Contact Us
  • Room 614, Zonghe Building, Harbin Institute of Technology
  • cshzxie [at] gmail.com