← All projects

Building PyTorch from Source

Summary

Notes and scripts for building PyTorch from source with CUDA support, primarily targeting a WSL2 development environment.

Motivation

Working on PyTorch internals — custom kernels, autograd tweaks, profiling — means you can’t rely on the prebuilt wheels. A fast, reproducible source build loop is essential.

Technical Details

See the related notes on WSL2 setup and CUDA debugging.

Results

Cold build and warm incremental build times are tracked locally; ccache turns a 40-minute rebuild into seconds for header-only changes.

Lessons Learned

PyTorchCUDABuild systems