This project demonstrates how to implement a simple linear regression model using a custom CUDA kernel and integrate it with PyTorch's autograd system via torch.autograd.Function.
This project uses pyproject.toml to manage dependencies.
Clone the repository:
git clone git@github.com:sh1027/pytorch-custom-cuda-tutorial.git
cd pytorch-custom-cuda-tutorialInstall Python dependencies using uv:
# Make sure you have uv installed. Check (https://docs.astral.sh/uv/#installation) for the details
uv syncOr, with pip:
pip install .- CUDA Toolkit
- ffmpeg (for saving videos)