add add-flashinfer-solution skill for e2e Solution authoring workflow

#7

Summary

Adds a new agent skill add-flashinfer-solution under .claude/skills/
covering the Solution authoring side of the flashinfer-bench workflow:

pick a Definition → wrap a kernel → write Solution JSON → run benchmark
→ inspect traces → visualize

The existing skill suite covers the Definition / Workload / model side
(extract-kernel-definitions, collect-workloads, onboard-model,
add-reference-tests, track-models, clone-repos,
collect-workloads-bench). Solution authoring had no skill-level
documentation; this PR fills that gap.

Motivation

Three reference Solutions were authored end-to-end against the public
flashinfer-trace dataset during this work:

Solution Definition Verified on
sdpa_paged_decode_v1 gqa_paged_decode_h32_kv8_d128_ps1 H100 PCIe
fla_gdn_decode_v1 gdn_decode_qk4_v8_d128_k_last H100 PCIe
sglang_mla_decode_v1 mla_paged_decode_h16_ckv512_kpe64_ps1 H100 PCIe + B200

Recurring patterns surfaced — paged KV layout conversion, LSE base-2 vs
base-e, GQA H_kv → H_q expansion, FLA's transpose_state_layout flag,
vendored Triton sys.path, FlashInfer-GDN CuTe DSL ABI on NGC PyTorch
24.10 — were costly to re-derive each time. This skill captures them as
a reusable playbook.

What's added

.claude/skills/add-flashinfer-solution/
├── SKILL.md 7-step workflow + env setup (sqsh + fallback) + sqsh build recipe
├── reference/
│ ├── definition_schema.md Definition JSON full schema
│ ├── solution_schema.md Solution JSON full schema
│ ├── wrapper_gotchas.md 17+ failure modes with diagnostics
│ └── visualization.md Local web UI / public site / SSH forwarding
└── templates/
├── dense_baseline_main.py + .json PyTorch SDPA-style baseline
├── linear_attention_main.py + .json External lib wrapper (FLA)
└── vendored_kernel_main.py + .json Vendored Triton kernel (SGLang-style)

Verified environment

Pinned stack (SKILL.md Section 3.4):

pip install --target /tmp/pip-pkgs --no-cache-dir \
    flashinfer-python==0.6.9 \
    flashinfer-bench \
    flash-linear-attention \
    "nvidia-cutlass-dsl[cu13]" \
    cuda-python safetensors huggingface-hub

Versions resolved during verification:
- flashinfer-python 0.6.9 (pinned for CuTe DSL GDN kernel ABI)
- flashinfer-bench 0.1.2
- flash-linear-attention 0.5.0 (fla-core 0.5.0)
- nvidia-cutlass-dsl 4.5.0[cu13]
- cuda-python 13.2.0 
- torch 2.12.0+cu130 (upgrade triggered by fla-core)

Two environment paths documented

┌───────────────────┬──────────────────────────────────────────────────────────────────┬────────────────────┐
│      Section      │                               Path                               │    Per-run cost    │
├───────────────────┼──────────────────────────────────────────────────────────────────┼────────────────────┤
│ 3.3 (recommended) │ Pre-built .sqsh baked with the pin set above                     │ 0 (no pip install) │
├───────────────────┼──────────────────────────────────────────────────────────────────┼────────────────────┤
│ 3.4 (fallback)    │ crun -img nvcr.io/nvidia/pytorch:24.10-py3 + per-run pip install │ ~5 min per crun    │
├───────────────────┼──────────────────────────────────────────────────────────────────┼────────────────────┤
│ 3.5               │ Recipe to build the .sqsh once (~30 min, on a GPU compute node)  │ one-time setup     │
└───────────────────┴──────────────────────────────────────────────────────────────────┴────────────────────┘

The frontend cannot run enroot start because of VS Code SSH session
cgroup namespace constraints; Section 3.5 documents the workaround
(submit via srun to any single-GPU partition for a host shell).

Layout note for reviewers

Existing skills are single-file SKILL.md. This one uses subdirectories
(reference/, templates/) because:

1. Schema reference docs (~200 lines each) are more useful as standalone
linkable artifacts than as inline sections of a longer SKILL.md
2. Wrapper templates need to be runnable as .py / .json for the
"copy → modify" use case, not as inline code blocks

Total content is ~1500 lines distributed across 11 purposeful files.
Happy to flatten into a single SKILL.md if maintainers prefer.

How to test

1. Skill metadata sanity:
head -4 .claude/skills/add-flashinfer-solution/SKILL.md
# Expect valid YAML frontmatter with name + description
2. End-to-end Solution run on a computelab GPU node: follow SKILL.md
Section 3.3 (or 3.4 if no pre-built sqsh) + Step 5.1a to author a
trivial Solution against any existing Definition (e.g.
gqa_paged_decode_h32_kv8_d128_ps1) and confirm flashinfer-bench run
produces PASSED traces.
3. Lint / format: no code changes; only markdown + Python + JSON
templates.

Checklist

- PR title follows <type>: <description> convention
- Skill metadata (name, description) follows existing skill pattern
- No changes to flashinfer_bench/ Python package
- No changes to existing skills (additive only)
- No CI / build system changes required
- CONTRIBUTING.md workflow followed (fork → branch → PR)
- Reviewers comfortable with subdir layout (else willing to flatten)
MengYuNV changed pull request status to merged

Sign up or log in to comment