Individual skill
optimization-flash-attention
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.
cli-tool/components/skills/ai-research/optimization-flash-attention/SKILL.md
Source commit ad81bf053f80b626801decf425f501ba49983d98
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Network or broad shell
- Last checked
- Nov 4, 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)
- 33,188
- Repository last updated
- Nov 7, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- anthropic Repository topic
- anthropic-claude Repository topic
- claude Repository topic
- claude-code Repository topic
- agent-skills Repository topic
- ai-agents Repository topic
- claude-code-plugins Repository topic
- cli Repository topic
- mcp Repository topic
- registry Repository topic
- optimization Declared skill tag
- flash-attention Declared skill tag
- attention-optimization Declared skill tag
- memory-efficiency Declared skill tag
- speed-optimization Declared skill tag
- long-context Declared skill tag
- pytorch Declared skill tag
- sdpa Declared skill tag
- h100 Declared skill tag
- fp8 Declared skill tag
- transformers Declared skill tag
- 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,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 bytesSKILL.mdcore · 10,221 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)