fla-optimization-loop

Optimize Flash Linear Attention kernels across Triton, Gluon, TileLang, and CuTe backends.

5.5k|643|Updated Dec 20, 2023
One-click install
npx skills add https://github.com/fla-org/flash-linear-attention --skill fla-optimization-loop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fla-optimization-loop
Source: https://github.com/fla-org/flash-linear-attention/tree/main/.agents/skills/fla-optimization-loop
Command: npx skills add https://github.com/fla-org/flash-linear-attention --skill fla-optimization-loop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill aids in the optimization of FLA kernels by providing a structured and disciplined optimization loop that ensures correctness while speeding up kernel performance.

Core Features & Use Cases

  • Disciplined Optimization Loop: Offers a step-by-step approach to optimize kernel performance.
  • Correctness Ensured: Uses frozen tests and strict criteria to ensure correctness throughout optimization.
  • Multi-Phase Approach: Provides a phased optimization strategy with clear validation and iteration protocols.
  • Backend Support: Works across different backend languages including Triton, Gluon, TileLang, and CuTe.
  • Use Case: For software engineers working with sequence models, the skill helps to make an existing FLA kernel faster across multiple iterations without breaking correctness.

Quick Start

Start optimizing an FLA kernel by following the instructions outlined in the 'SKILL.md' file. Begin by drafting the task contract, and then proceed with three phases: correct baseline, profile-guided optimization, and shape specialization.

Frequently Asked Questions about fla-optimization-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize Flash Linear Attention kernels without breaking correctness?

You can optimize Flash Linear Attention kernels safely by following a structured multi-phase execution that uses frozen tests to enforce strict correctness criteria throughout the performance enhancement process.

What is profile-guided optimization for sequence model kernels?

Profile-guided optimization for sequence model kernels is a phased strategy that establishes a correct baseline before iteratively applying performance enhancements and shape specialization to achieve reproducible speedups.

Does FLA kernel optimization work with Triton and other backend languages?

Yes, FLA kernel optimization supports backend flexibility across multiple languages including Triton, Gluon, TileLang, and Cuete, enabling hardware-agnostic and platform-independent performance tuning.

How to start speeding up an existing FLA kernel iteratively?

To start speeding up an existing FLA kernel, draft a task contract and proceed through three phases: establishing a correct baseline, applying profile-guided optimization, and executing shape specialization.

Can I use hardware-agnostic optimization for sequence models across different platforms?

Yes, you can achieve hardware-agnostic and platform-independent optimization for sequence models by using backend-flexible execution that ensures deterministic and reproducible performance enhancements across environments.