Individual skill
optimizing-attention-flash
Optimizes transformer attention with Flash Attention for 2-4x speedup and 10-20x memory reduction. Use when training/running transformers with long sequences (>512 tokens), encountering GPU memory issues with attention, or need faster inference. Supports PyTorch native SDPA, flash-attn library, H100 FP8, and sliding window attention.
skills/mlops/training/flash-attention/SKILL.md
Source commit f87633900ae185b8037bf451a914fe7eeae1eb08
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Not checked yet
- Last checked
- Nov 3, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 1,275
- Repository last updated
- Apr 5, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- engineering Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
SKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesSKILL.mdcore · 10,225 bytesreferences/benchmarks.mddoc · 7,129 bytesreferences/transformers-integration.mddoc · 7,427 bytes
Read excerpt
# Flash Attention - Fast Memory-Efficient Attention
## Quick start
Flash Attention provides 2-4x speedup and 10-20x memory reduction for transformer attention through IO-aware tiling and recomputation.
**PyTorch native (easiest, PyTorch 2.2+)**:
```python
import torch
import torch.nn.functional as F
q = torch.randn(2, 8, 512, 64, device='cuda', dtype=torch.float16) # [batch, heads, seq, dim]
k = torch.randn(2, 8, 512, 64, device='cuda', dtype=torch.float16)
v = torch.randn(2, 8, 512, 64, device='cuda', dtype=torch.float16)