← Back to projects

Custom CUDA Library for CNN Pre-Processing

An open-source CUDA library that accelerates CNN preprocessing - matrix multiplication and image convolution - with drop-in Python bindings so existing NumPy pipelines run on the GPU without a rewrite.

Benchmark chart: CPU vs naive CUDA vs tiled CUDA vs cuBLAS across matrix sizes on Tesla T4
Execution time vs. matrix size on Tesla T4 - full benchmarks and source in the GitHub repo.
115x
CPU speedup at N=1024 (Tesla T4)
14x
Faster PyTorch data preprocessing

Why this exists

Most training pipelines preprocess on the CPU - normalization, augmentations, convolutions - then ship tensors to the GPU. That leaves expensive hardware idle while O(n³) matrix work and pixel loops run on a single thread pool. This project ships a reusable library instead of a one-off script: optimized CUDA kernels packaged as Python-callable shared objects.

Repository

The full implementation, notebooks, and reproduction steps live in a public repo:

github.com/ShamikOfficial/CUDA-Accelerated-Python-Library →

Architecture

Results

Impact

Tech

CUDAC/C++cuBLASPythonctypesNumPyGPU ComputingTesla T4

Technical report

Full technical report from the Clean source: Module 1 matrix multiplication (CPU, naive CUDA, tiled shared memory, cuBLAS), analysis Q&A, benchmark charts, Python libmatrix.so bindings, Module 2 image convolution (grayscale, edge/sharpen/Gaussian filters with result images), CUDA port, and libconvo.so Python library.

Download PDF