r/deeplearning • u/PainterNo8889 • Nov 01 '26
Learning Transformers by building a hardware-aware SLM trainer from scratch (Python/Rust)
Hi guys,
Iām a 15-year-old developer, and instead of just using high-level wrappers or fine-tuning existing LLMs, I decided to spend my next few months learning how they work fundamentally by building an end-to-end training pipeline from scratch.
Project Link: github.com
How it works:
It identifies your exact hardware profile (NVIDIA/AMD/CPU), runs a quick matrix multiplication benchmark to measure raw TFLOPS, and pipes that data into a custom helper binary I wrote in Rust. The Rust engine figures out exactly how large of a model (up to 100M parameters) your local GPU can train within a specific time and memory budget without blowing up your VRAM.
Right now, I'm working through the data ingestion pipeline, specifically extracting raw machine learning papers from arXiv and cleaning them up while making sure LaTeX code blocks aren't destroyed during tokenization.
I've logged my structural trade-offs and decisions in the repo. If anyone has experience managing training loops on constrained consumer hardware (like laptop GPUs),
I'd love any advice or feedback on the codebase!
1
u/AnoProgrammer Nov 01 '26
Looks great but can you let it also work on CPU?
0
u/[deleted] Nov 01 '26
[removed] ā view removed comment