davila7 avatar

Optimizing Attention Flash

If you're working with transformer models and hitting memory walls or slow attention computations, this skill gives you the Flash Attention implementation that delivers 2-4x speedup and 10-20x memory reduction through IO-aware tiling. The example code shows PyTorch 2.2+ integration using the native scaled_dot_product_attention function, which automatically uses Flash Attention when available. It's straightforward: drop in your query, key, and value tensors on CUDA with float16, and you're done. The skill has passed security audits from Gen Agent Trust Hub, Socket, and Snyk, and with 27.7K GitHub stars on the parent repo, it's clearly battle-tested. Worth having if you're training or running large language models.

skills.sh installs
332
GitHub stars
33.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add davila7/claude-code-templates --skill optimizing-attention-flash --agent claude-code

Installs into .claude/skills of the current project.

Files

If you're working with transformer models and hitting memory walls or slow attention computations, this skill gives you the Flash Attention implementation that delivers 2-4x speedup and 10-20x memory reduction through IO-aware tiling. The example code shows PyTorch 2.2+ integration using the native scaled_dot_product_attention function, which automatically uses Flash Attention when available. It's straightforward: drop in your query, key, and value tensors on CUDA with float16, and you're done. The skill has passed security audits from Gen Agent Trust Hub, Socket, and Snyk, and with 27.7K GitHub stars on the parent repo, it's clearly battle-tested. Worth having if you're training or running large language models.

Browse the repository on GitHub

Sponsors

Details

Repository
github.com/davila7/claude-code-templates
Category
Data Science & ML
First seen
Jun 3, 2026

More from davila7/claude-code-templates

All 618
1syncfusion avatarsyncfusion-angular-chartsyncfusion/angular-ui-components-skillsImplement Syncfusion Angular Chart component for professional data visualization. Use this when creating or customizing charts such as line, bar, column, area, 332skills.sh installs
2davila7 avatarzapier-workflowsdavila7/claude-code-templatesManage and trigger pre-built Zapier workflows and MCP tool orchestration. Use when user mentions workflows, Zaps, automations, daily digest, research, search, l330skills.sh installs
3octagonai avatarfinancial-analyst-masteroctagonai/skillsComprehensive equity research analyst skill that orchestrates all Octagon financial analysis skills. Use when conducting full company analysis, writing initiati330skills.sh installs
4leonardomso avatarconcept-workflowleonardomso/33-js-conceptsEnd-to-end workflow for creating complete JavaScript concept documentation, orchestrating all skills from research to final review325skills.sh installs
5personamanagmentlayer avatarr-expertpersonamanagmentlayer/pclExpert-level R statistical computing, data analysis, and visualization324skills.sh installs
6agricidaniel avatarwiki-retrieveagricidaniel/claude-obsidianHybrid retrieval primitive for the Compound Vault. Replaces the v1.6 static hot→index→drill read order with contextual-prefix + BM25 + cosine-rerank, modeled on323skills.sh installs