CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

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.

72

Quality

90%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Quality

Content

92%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

A well-engineered skill body: three checklist-driven workflows with built-in verification steps, fully executable code, an error-recovery troubleshooting section, and clean one-level-deep offloading of benchmark and Transformers-integration detail to real reference files. The only weakness is mild repetition (the flash-attn install command recurring four times) that slightly inflates token cost.

Suggestions

State the flash-attn install command ('pip install flash-attn --no-build-isolation') once and reference it from the ImportError section, Workflow 2, and Workflow 3 instead of repeating it four times.

Merge the Quick start flash-attn snippet with Workflow 2's Step 2, since both demonstrate the same flash_attn_func call shape.

DimensionReasoningScore

Conciseness

The body is mostly lean — code, checklists, and troubleshooting with almost no prose explaining concepts Claude already knows — but has minor repetition that could be trimmed: 'pip install flash-attn --no-build-isolation' appears four times (Quick start, Workflow 2, Workflow 3, Common issues), and Workflow 3's install step restates the same command. This matches 'efficient; minor instances of over-explanation that could be trimmed' (4); it is well above the 'mostly efficient but some unnecessary explanation' anchor (3) and short of 'every token earns its place' (5).

4 / 5

Actionability

Every workflow step is copy-paste executable: the SDPA one-liner, the sdp_kernel backend forcing, the benchmark/accuracy-comparison scripts, the flash-attn transposition and window examples, and the FP8 conversion. The Common issues section pairs each error symptom with a concrete diagnostic command (e.g. torch.cuda.get_device_capability()), fully matching the 'fully executable; copy-paste ready; covers common cases' anchor (5).

5 / 5

Workflow Clarity

All three workflows use explicit copyable checklists with four numbered steps, and validation checkpoints are built in: Workflow 1 includes 'Verify speedup with profiling' and 'Test accuracy matches baseline' with expected thresholds (2-4x speedup, diff <1e-3), and Workflows 2 and 3 each end with a benchmark step. The Common issues section provides error-recovery feedback loops. This matches the anchor for clear sequence with explicit validation and checklists (5); the operations are non-destructive, so no cap applies.

5 / 5

Progressive Disclosure

The body is an overview with quick-start and core workflows inline, while detail-heavy material is clearly offloaded one level deep to two real, relevant files ('See [references/transformers-integration.md]', 'See [references/benchmarks.md]'), both of which exist in the bundle and contain the promised content. This matches 'clear overview with well-signaled one-level-deep references; content appropriately split' (5); there is no nesting and no orphaned reference.

5 / 5

Total

19

/

20

Passed

Description

87%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong description: third-person, quantified, with an explicit multi-trigger 'Use when...' clause and a concrete support matrix. The only gaps are a few missing natural synonym phrases (e.g. 'OOM', 'context length') and the fact that it describes one optimized action rather than a suite of distinct capabilities.

Suggestions

Add common natural trigger variations such as 'OOM' / 'out of memory' and 'long context' to the 'Use when' clause to broaden trigger-term coverage.

Consider naming one or two additional concrete actions (e.g. 'enable in HuggingFace Transformers models') to move specificity from a single action plus support matrix toward comprehensive multi-action coverage.

DimensionReasoningScore

Specificity

The description names a concrete action ('Optimizes transformer attention with Flash Attention for 2-4x speedup and 10-20x memory reduction') with quantified outcomes and an explicit capability list ('Supports PyTorch native SDPA, flash-attn library, H100 FP8, and sliding window attention'). It is a single core action with a support matrix rather than multiple distinct actions, so it fits the 'several specific actions; minor gaps' anchor (4) rather than the fully comprehensive multi-action anchor (5).

4 / 5

Completeness

It clearly answers both 'what' (optimizes transformer attention with Flash Attention, with quantified speedup/memory numbers) and 'when' via an explicit 'Use when training/running transformers with long sequences (>512 tokens), encountering GPU memory issues with attention, or need faster inference' clause with three concrete triggers — matching the anchor for a complete what+when description. Voice is third person, so no specificity penalty applies.

5 / 5

Trigger Term Quality

Natural phrases users would say are present ('long sequences (>512 tokens)', 'GPU memory issues', 'faster inference') alongside technical terms (Flash Attention, PyTorch, SDPA, flash-attn, H100, FP8). A few common variations are missing (e.g. 'OOM' / 'out of memory', 'context length', 'seq len'), which keeps it at 'good keyword coverage; a few natural terms missing' (4) rather than comprehensive synonym coverage (5).

4 / 5

Distinctiveness Conflict Risk

It occupies a clear niche (Flash Attention specifically, with named implementations and hardware) and its triggers (long sequences, GPU memory issues with attention) point uniquely to this skill. Overlap with a generic transformer-training or GPU-optimization skill is minimal, fitting the 'clear niche with distinct triggers; minimal conflict risk' anchor (5) rather than 'minor overlap risk' (4).

5 / 5

Total

18

/

20

Passed

Validation

87%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 14 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

metadata_version

'metadata.version' is missing

Warning

frontmatter_unknown_keys

Unknown frontmatter key(s) found; consider removing or moving to metadata

Warning

Total

14

/

16

Passed

Repository

synthetic-sciences/openscience

Path

backend/cli/skills/ml-training/flash-attention/SKILL.md

Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.