Skip to content
VibekollenBETAVibekollen
VideoAI Engineer

Weight Folding, CUDA Streams, and the Bug That Made My Model Speak Backwards — Filip Makraduli

Filip Makraduli presents FlashNorm, an optimization that speeds up the RMS norm layer in transformer models by 33–35 percent.

The trick is to fold the norm's weights into the projection weights before execution, defer the division so the GPU's different units work in parallel, and remove redundant normalization in newer architectures. When he implemented this in CUDA code, he discovered a subtle bug: the model began repeating old outputs with a one-step lag. The problem was a race condition between two parallel GPU streams — one had not finished before the other read from the buffer. The solution was to explicitly mark the end of each stream and make the division step wait on both before proceeding.

Open on YouTube →

Vibekollen prepared this summary with AI from the original publication. The content belongs to AI Engineer.

More to read