<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/towards-free-normalization-fusing-normalization-into-gemm-and-attention-kernels-pytorch-bbthlqigt" -->

---
title: Towards Free Normalization: Fusing Normalization into...
description: Novel GPU kernel fusion techniques are presented for LayerNorm and RMSNorm operations, which typically consume 10-20% of training latency in LLMs and...
canonical: https://daily.dev/posts/towards-free-normalization-fusing-normalization-into-gemm-and-attention-kernels-pytorch-bbthlqigt
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Towards Free Normalization: Fusing Normalization into GEMM and Attention Kernels – PyTorch | daily.dev
og:description: Novel GPU kernel fusion techniques are presented for LayerNorm and RMSNorm operations, which typically consume 10-20% of training latency in LLMs and...
og:url: https://daily.dev/posts/towards-free-normalization-fusing-normalization-into-gemm-and-attention-kernels-pytorch-bbthlqigt
og:image: https://api.daily.dev/og/posts/bBtHlQigt.png
og:image:alt: Towards Free Normalization: Fusing Normalization into GEMM and Attention Kernels – PyTorch
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Towards Free Normalization: Fusing Normalization into GEMM and Attention Kernels – PyTorch

**[PyTorch](https://daily.dev/sources/pytorch)** · 25 min read · 1 upvotes · 1 comments

## Summary

Novel GPU kernel fusion techniques are presented for LayerNorm and RMSNorm operations, which typically consume 10-20% of training latency in LLMs and recommendation models. Three main contributions are covered: (1) naive epilogue fusion for small N dimensions yielding 17-32% latency savings; (2) Lazy Pre-Norm, a prologue fusion technique that exploits the commutativity of row-wise multiplication to delay RMSNorm's elementwise step until after the GEMM k-loop, hiding most norm computation behind TensorCore ops; (3) Multi-CTA Norm Fusion using CTA clusters and Distributed Shared Memory to collaboratively compute reductions across CTAs, enabling epilogue fusion for larger N. A 'fusion regrouping' trick ensures backward passes also achieve epilogue fusion by fusing norms with different linear layers than in forward. Finally, FlashNormAttention fuses both a pre-LayerNorm and post-RMSNorm into a GDPA attention kernel, achieving up to 35% kernel speedup, with detailed optimizations for memory pressure (SMEM/TMEM reuse, register subtiling) and pipeline stalls (warp specialization, register pre-loading). Benchmarks are on NVIDIA B200 GPUs using bfloat16.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://pytorch.org/blog/towards-free-normalization-fusing-normalization-into-gemm-and-attention-kernels>

## Community discussion

Top comments from developers on daily.dev.

**@nngg53** · 0 upvotes

> Awesome. Looks a lot like FlashNorm
> [https://arxiv.org/abs/2407.09577](https://arxiv.org/abs/2407.09577)

## Similar posts on daily.dev

- [Kernel Fusion in NVIDIA CUDA: Optimizing Memory Traffic and Launch Overhead](https://daily.dev/posts/kernel-fusion-in-nvidia-cuda-optimizing-memory-traffic-and-launch-overhead-vyzarvdyg) · NVIDIA Developer · 0 upvotes · 0 comments
- [Generalized Dot-Product Attention: Tackling Real-World Challenges in GPU Training Kernels – PyTorch](https://daily.dev/posts/generalized-dot-product-attention-tackling-real-world-challenges-in-gpu-training-kernels-pytorch-phuahr4yf) · PyTorch · 0 upvotes · 0 comments
- [Custom Kernels for All from Codex and Claude](https://daily.dev/posts/custom-kernels-for-all-from-codex-and-claude-78oornvdz) · Hugging Face · 21 upvotes · 2 comments

---

Tags: [#gpu](https://daily.dev/tags/gpu), [#pytorch](https://daily.dev/tags/pytorch)

[View this post on daily.dev](https://daily.dev/posts/towards-free-normalization-fusing-normalization-into-gemm-and-attention-kernels-pytorch-bbthlqigt)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Towards Free Normalization: Fusing Normalization into GEMM and Attention Kernels – PyTorch","url":"https://daily.dev/posts/towards-free-normalization-fusing-normalization-into-gemm-and-attention-kernels-pytorch-bbthlqigt","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/towards-free-normalization-fusing-normalization-into-gemm-and-attention-kernels-pytorch-bbthlqigt"},"datePublished":"2026-07-10T14:38:58.265Z","dateModified":"2026-07-10T14:39:27.611Z","description":"Novel GPU kernel fusion techniques are presented for LayerNorm and RMSNorm operations, which typically consume 10-20% of training latency in LLMs and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6c6e8ee318693c4de6f5f85f45160b68?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6c6e8ee318693c4de6f5f85f45160b68?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"PyTorch","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"PyTorch","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/5fdab3d75a834a97a52d433d9c7e5ff9","url":"https://daily.dev/sources/pytorch"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/towards-free-normalization-fusing-normalization-into-gemm-and-attention-kernels-pytorch-bbthlqigt","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"gpu,pytorch","timeRequired":"PT25M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"PyTorch","item":"https://daily.dev/sources/pytorch"},{"@type":"ListItem","position":3,"name":"Towards Free Normalization: Fusing Normalization into GEMM and Attention Kernels – PyTorch"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/towards-free-normalization-fusing-normalization-into-gemm-and-attention-kernels-pytorch-bbthlqigt","comment":[{"@type":"Comment","text":"Awesome. Looks a lot like FlashNorm\nhttps://arxiv.org/abs/2407.09577","datePublished":"2026-10-07T23:49:43.422Z","url":"https://daily.dev/posts/bBtHlQigt#c-gOMDkhENC","author":{"@type":"Person","name":"NN GG","url":"https://daily.dev/nngg53"}}]}
```

