AI Developers Lounge archive

Member 0bcf5a

7 messages, Nov 15, 2026 to Nov 19, 2026. Search their messages

Links posted

Messages

Member 0bcf5a Nov 19, 2026, 5:19 PM
Member 0bcf5a
I've published kael.cpp, a deep learning framework written from scratch in C++20.
It implements the main layers of a framework like PyTorch without relying on any other library: strided tensors with zero-copy views, reverse-mode automatic differentiation, a CPU backend optimized with SIMD and multithreading, a CUDA backend, Python bindings, and a transformer that loads GPT-2's original weights and generates text. Its behavior is validated against PyTorch.
On an Apple M5 Pro, it trains an MLP on MNIST to 97.4% accuracy, reaches 557 GFLOP/s on f32 matrix multiplication, and runs GPT-2 small at 15 tokens per second.
The goal is didactic. Alongside the code, I wrote a 14-chapter book that rebuilds the framework one layer at a time and documents every design decision, from memory layout to kernel optimization.

Code and book are open source under Apache-2.0. Feedback from anyone working on ML infrastructure or high-performance computing is very welcome.

Would be great if you leave a star. Thanks!

Code: github.com/JetBerri/kael.cpp
↑ go to message
.