minitensor: a GPU tensor library with autograd, built from scratch
C++ · CUDA · Python (nanobind) · pytest
I wrote this small deep learning library from scratch to learn how frameworks like PyTorch work underneath. You write ordinary NumPy-style Python (x @ W + b), and it runs on the GPU through CUDA kernels I wrote by hand.
- CUDA kernels written by hand for elementwise ops with broadcasting, shared-memory reductions, tiled matrix multiplication, and a fused softmax + cross-entropy kernel with its own backward kernel
- Reverse-mode autograd that builds the computation graph as ops run, accumulates gradients, and correctly sums gradients for inputs that were broadcast
- A caching GPU memory allocator that reuses freed buffers instead of calling
cudaMallocevery time - About 35 pytest tests that compare outputs against NumPy and check gradients with finite differences
Result: It trains an MNIST MLP to 97.35% test accuracy at 0.2 s per epoch. That’s about 2× faster than NumPy and 3–4× faster than PyTorch on the same model. At this small batch size, the speedup comes from low per-operation overhead, not from beating cuBLAS at matrix multiplication.
Convolutional neural network from scratch
Python · NumPy · SciPy
I built this CNN without following a tutorial, to test whether I understood the fundamentals well enough to design new architectures myself. It follows an earlier project where I built a fully connected MNIST classifier in NumPy.
- Config-driven architecture: a YAML file defines the network, which gets assembled at runtime instead of being hard-coded, using five block types: input, fully connected, convolutional, max pooling, and a fully connected block that links to individual feature maps jonathanlussier.net
- Forward and backward passes written by hand for every block. SciPy’s 2D correlation and convolution functions do the core convolution math inside that backprop code jonathanlussier.net
- A live training dashboard: a threaded web dashboard tracks training while it runs jonathanlussier.net
Result: It classified 9,796 of the 10,000 test images correctly (97.96%). jonathanlussier.net
GitHub · Blog post · Earlier MLP posts
WIEVLE: autonomous underwater vehicle (Naval Postgraduate School)
Mechanical design · Systems engineering · 3D printing
I led the physical design of an autonomous underwater robot. It was my first project owning a whole subsystem, taking it from concept through the full engineering lifecycle. jonathanlussier.net
- Hull and propulsion: a spherical, mostly 3D-printed hull built for extreme depths, with propulsion that uses buoyancy and angled reverse thrust to avoid stirring up sediment jonathanlussier.net
- Exoskeleton-style structure: load-bearing modular plates mount on a floating ring and close over the propulsion core, which leaves the interior free for payload and electronics jonathanlussier.net
- Hull geometry: I based it on a truncated cuboctahedron projected onto a sphere because that shape matched the thruster outlet pattern, and its sections fit the team’s 3D printers jonathanlussier.net
Result: The prototypes worked in underwater tests, the project kept its funding and produced spinoffs, and the work is covered by two US patents (US12032373B2 and US12377944B2), one of which i am named co-inventor on (US12032373B2). jonathanlussier.net