Tag Archives: CFFI

Build PyTorch Extensions with CUDA and CFFI

Deprecated warning: PyTorch 1.0+ uses to Aten as its tensor library. So the article is no longer applicable in PyTorch 1.0+. Please refer to this GitHub repository for more information. 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…

Continue Reading
Contact Us
  • Nanyang Technological University, Singapore
  • root [at] haozhexie [dot] com