Autograd.c
A tiny ML framework built from scratch
Get picks like this daily. Today's launch numbers, the top launches, AI and tech news, and a daily opportunity pick, straight to your inbox.
Want to reach these readers? Sponsor an issue.
built a tiny pytorch clone in c after going through prof. vijay janapa reddi's mlsys book: mlsysbook.ai/tinytorch/perfect for learning how ml frameworks work under the hood :)
HN · launched Dec 16, 2025 · 85 upvotes (top 12%) · 0 views
Niche: deep learning frameworks · 48 launches, 0 in the last 7 days · Explore this niche →
Category and tags
- Horizontal
- Dev tools
- Developer
- AI-native
- Hobby / open-source project
Visit website ↗ Source listing ↗
More like this: all 48 launches in deep learning frameworks →
Could you build this?
No Writing a tensor autograd framework from scratch in C demands deep mathematical mastery of reverse-mode automatic differentiation, tensor stride manipulation, and low-level memory management.
What it would actually take: A pure C implementation requires custom memory allocators for dynamically sized n-dimensional tensors, a computational directed acyclic graph (DAG) engine supporting tape-based backpropagation, and optimized BLAS-like numerical kernels. Deep expertise in computer systems, linear algebra, memory alignment, and compiler-friendly SIMD vectorization is required.
Discussion
13 comments analyzed.
Competitors mentioned: Enzyme (LLVM IR level autograd), JAX (architecture/design reference), Theano (compiler-autograd method), MLIR/IREE (heap-free implementation direction)
Concerns raised: Compilation cost O(n) times per forward/reverse pass, Finding ideal forward vs reverse mode combination is NP-hard, Stack pressure and memory issues with higher-order operators, Forward mode alone doubles stack pressure; reverse mode needs 2x stack, Diminishes C's performance advantages with indirection overhead
Feature requests: In-place gradient accumulation instead of creating new tensors, Heap-free implementation for memory efficiency, Recompile per iteration when weights updated at batch/distributed intervals
Competitors
Other products that read as similar to this one : 176 launches clear the similarity bar, closest 8 shown.
Attention rank: #20 of 177 (itself plus its competitors, highest first, normalized so YC and Product Hunt are compared fairly).
Launched 48 days after the earliest competitor.
- Deep-Learning-with-PyTorch · github · 2026-11-03 · 22 upvotes · similarity 0.50
- TrenTorch · ph · 2026-09-20 · 2 upvotes · similarity 0.49
- Reimplementing PyTorch from scratch (MLP, CNN) to learn the internals · hn · 2026-02-03 · 5 upvotes · similarity 0.47
- Flow Matching model inference in C · hn · 2026-07-23 · 5 upvotes · similarity 0.46
- Microcrad · hn · 2026-06-17 · 79 upvotes · similarity 0.45
- who-ate-my-flops · github · 2026-09-27 · 32 upvotes · similarity 0.44
- CJIT, a single-binary C compiler that can self host · hn · 2026-04-13 · 7 upvotes · similarity 0.44
- Minimal DL library in C · hn · 2025-12-17 · 13 upvotes · similarity 0.40
The niche, labels, vibe code rating and competitor comparison on this page are analysis by Nicheloom. If you use them, please credit nicheloom.com. How you may use our data.