How nvlabs/gateddeltanet works
This repository implements and trains Gated DeltaNet language models. The main workflow is to launch pretraining with training and validation data, construct the configured GPT model, process batches through its model blocks and gated-delta computations, and save checkpoints while tracking training speed and metrics. The implementation also includes ordinary attention and model-support kernels. README-described performance and FLA-kernel alternatives are represented, but source excerpts do not establish all runtime dispatch details; those links are omitted or marked unverified.
Main entry points: pretrain.py Pretraining Loop · model.py GPT Model · config.py Model Config · gated_delta_net.py Gated DeltaNet
Components 21
Training
- Pretraining Loop
pretrain.py - Packed Dataset
lit_gpt/packed_dataset.py - Speed Monitor
lit_gpt/speed_monitor.py - Checkpoints
Model
- Model Config
lit_gpt/config.py - GPT Model
lit_gpt/model.py - Model Blocks
lit_gpt/model.py - Gated DeltaNet
lit_gpt/gated_delta_net.py - Tokenizer
lit_gpt/tokenizer.py
Delta Kernels
- Chunk Kernels
lit_gpt/gated_delta_rule_ops/chunk.py - WY Kernels
lit_gpt/gated_delta_rule_ops/wy_fast.py - FLA Chunk Kernels
lit_gpt/gated_delta_rule_ops/fla_version/chunk_fla.py - FLA WY Kernels
lit_gpt/gated_delta_rule_ops/fla_version/wy_fast_fla.py
Model Support
- Fused Cross Entropy
lit_gpt/fused_cross_entropy.py - Rotary Embedding
lit_gpt/fused_rotary_embedding.py - Fused RMSNorm
lit_gpt/rmsnorm.py - Rotary Helpers
lit_gpt/rotary.py - Training Utilities
lit_gpt/utils.py
Other components
- Training Operator
- Training Data
- W&B Logger
Connections 16
- Training Operator → Pretraining Loop: launches
README.md - Training Data → Pretraining Loop: provides batches
- Pretraining Loop → Packed Dataset: loads data
pretrain.py - Pretraining Loop → GPT Model: trains
pretrain.py - Pretraining Loop → Speed Monitor: tracks speed
pretrain.py - Pretraining Loop → Checkpoints: saves state
pretrain.py - Pretraining Loop → W&B Logger: logs metrics
pretrain.py - GPT Model → Model Config: uses settings
lit_gpt/model.py - GPT Model → Model Blocks: runs blocks
lit_gpt/model.py - Model Blocks → Gated DeltaNet: selects mixer
lit_gpt/model.py - Gated DeltaNet → Chunk Kernels: uses kernels
lit_gpt/gated_delta_net.py - Chunk Kernels → WY Kernels: prepares WY
lit_gpt/gated_delta_rule_ops/chunk.py - FLA Chunk Kernels → FLA WY Kernels: prepares WY
lit_gpt/gated_delta_rule_ops/fla_version/chunk_fla.py - GPT Model → Rotary Embedding: uses embedding
lit_gpt/model.py - Model Config → Fused RMSNorm: selects norm
lit_gpt/config.py - Model Config → Training Utilities: uses helpers
lit_gpt/config.py