---
id: 12862
lang: en
title: "NVIDIA Transformer Engine: Fused Kernels, FP8 and BF16 for Training Transformers"
published_at: "2026-08-03 07:51:00"
source_name: "MarkTechPost"
source_url: "https://www.marktechpost.com/2026/08/01/accelerating-transformer-training-with-nvidia-transformer-engine-fused-kernels-bf16-fp8-and-gpu-benchmarking/"
canonical_url: "https://news.hamidun.com/en/news/12862"
categories: ["hardware"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# NVIDIA Transformer Engine: Fused Kernels, FP8 and BF16 for Training Transformers

> **Краткая суть (BLUF):** NVIDIA Transformer Engine speeds up transformer training through fused GPU kernels, BF16 computation and hardware FP8. The library replaces standard PyTorch layers — te.Linear, te.LayerNorm, te.TransformerLayer — and automatically picks the execution mode based on the GPU type.  On H100 and RTX 40xx cards, FP8 tensor cores are available with the E4M3/E5M2 formats. On older GPUs, the library falls back to plain PyTorch with no code changes.

NVIDIA Transformer Engine is a library for accelerating transformer training on Ampere and newer GPUs. A tutorial published on August 1, 2026 on MarkTechPost shows how to plug TE into a GPT-style model, configure FP8 quantization, and measure the gains in speed and memory.

## What is NVIDIA Transformer Engine

NVIDIA Transformer Engine is the official library for optimizing transformers on Ampere-class and newer GPUs. It provides drop-in replacements for standard PyTorch layers: `te.Linear`, `te.LayerNorm`, `te.LayerNormLinear`, `te.LayerNormMLP` and the full `te.TransformerLayer` block. All components use BF16 by default; on cards with compute capability ≥ 8.9, FP8 tensor cores are available.

Key components of the library:

* `te.Linear` — a linear layer with FP8 tensor core support
* `te.LayerNormLinear` — combines LayerNorm and the projection in a single kernel
* `te.LayerNormMLP` — a fused MLP block with normalization
* `te.TransformerLayer` — a full transformer block: attention, FFN, normalization
* Automatic fallback to plain PyTorch on GPUs without TE support

## How FP8 and DelayedScaling work

FP8 mode is enabled through the `DelayedScaling` recipe from `transformer_engine.common.recipe`. The recipe controls the tensor max-value history (`amax_history_len=16`), the computation algorithm (`amax_compute_algo="max"`) and the hybrid E4M3/E5M2 format. The first format provides precision for activations; the second provides extended dynamic range for gradients.

The key feature of delayed scaling is that it accumulates statistics over 16 iterations before updating a tensor's scale. This stabilizes training in the early steps, when the activation distribution has not yet settled.

> "Transformer Engine combines fused kernels, FP8 scaling and Ampere-optimized execution paths, which makes it a practical choice for training large models," the official NVIDIA documentation says.

In the tutorial, the authors build a compact GPT-style model, `MiniGPT_TE`: four `te.TransformerLayer` blocks, a hidden dimension of 768, 12 attention heads, a vocabulary of 96 tokens and a sequence length of 256. The model trains on deterministic synthetic data. The measurements show that FP8 mode on an H100-class GPU lowers peak VRAM consumption and per-step time compared with BF16, while accuracy stays comparable. The authors check this through autoregressive generation after training.

## GPU requirements

Transformer Engine works only on GPUs with compute capability ≥ 8.0 (Ampere architecture). FP8 tensor cores are available starting at CC ≥ 8.9: Ada Lovelace (RTX 40xx) and Hopper (H100/H200). On T4 cards and older, the library falls back to plain PyTorch without fused kernels.

* **Minimum for TE kernels**: Ampere, CC ≥ 8.0 — A10, A100, RTX 30xx
* **Minimum for FP8**: Ada Lovelace / Hopper, CC ≥ 8.9
* **Installation**: `pip install transformer_engine[pytorch]`
* **Dependencies**: CUDA 11.8+, PyTorch 2.0+

According to the tutorial's authors, an A100 or L4 GPU in Google Colab is enough to reproduce everything in full; on a T4, only the fallback mode without fused kernels is available.

## What this means

NVIDIA Transformer Engine lowers the barrier to low-precision training: instead of implementing FP8 quantization by hand, you only need to swap standard PyTorch layers for their TE counterparts. For teams training large models on GPU clusters, it is a practical way to cut memory use and iteration time without reworking the architecture.

## Frequently asked questions

### Do I need an H100 to use Transformer Engine?

No. NVIDIA Transformer Engine works on any GPU with compute capability ≥ 8.0, including the A100 and RTX 3090. FP8 tensor cores are available only with CC ≥ 8.9 — on the H100 and RTX 4090; on other cards, the library automatically switches to BF16.

### How do I install Transformer Engine?

Install it with pip: `pip install transformer_engine[pytorch]`. It requires CUDA 11.8 or higher and PyTorch 2.0+.

---
- **Первоисточник:** [MarkTechPost](https://www.marktechpost.com/2026/08/01/accelerating-transformer-training-with-nvidia-transformer-engine-fused-kernels-bf16-fp8-and-gpu-benchmarking/)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/12862
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
