extract-kernel-definitions

Extract kernel schemas from SGLang model implementations into Definition JSONs.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Rockyeast/flashinfer-trace-dev --skill extract-kernel-definitions-rockyeast
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extract-kernel-definitions
Source: https://github.com/Rockyeast/flashinfer-trace-dev/tree/main/.claude/skills/extract-kernel-definitions
Command: npx skills add https://github.com/Rockyeast/flashinfer-trace-dev --skill extract-kernel-definitions-rockyeast

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill extracts kernel schemas and definitions from SGLang model implementations with deduplication, enabling fast generation of FlashInfer-compatible JSON definitions.

Core Features & Use Cases

  • Analyzes SGLang model implementations to identify kernel types (MLA, MOE, GQA, RMSNorm, GEMM) and parameters.
  • Uses serving configurations from sgl-cookbook to generate multiple TP/EP variants and deduplicate across models.
  • Outputs definition JSON files into flashinfer_trace/definitions with naming conventions and, when available, reference implementations for validation.

Quick Start

Run the extraction tool with a model name to generate and save the kernel definitions to flashinfer_trace/definitions.

Frequently Asked Questions about extract-kernel-definitions

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

FAQPage Schema
How do I extract kernel definitions from SGLang model implementations?

Extract kernel definitions from SGLang models by running the extraction tool with a model name. It identifies kernel types and parameters, then saves the output as FlashInfer-compatible JSON files into the flashinfer_trace/definitions directory.

What types of kernels can I generate FlashInfer definition JSONs for?

You can generate FlashInfer definition JSONs for MLA, GQA, RMSNorm, GEMM, and MoE kernels. The tool parses model configs to identify these kernel schemas and aligns parameters using sgl-cookbook serving configurations.

How do I avoid duplicate kernel definitions across different SGLang models?

To avoid duplicate kernel definitions across SGLang models, the extraction skill uses sgl-cookbook serving configurations to align parameters and automatically deduplicates schemas across multiple TP and EP configurations during generation.

Can I generate kernel definitions for multiple TP and EP configurations in SGLang?

Yes, you can generate kernel definitions for multiple TP and EP configurations in SGLang. The tool creates multiple variants from serving configurations and deduplicates the extracted schemas across different models automatically.

What do I need to parse from a model config to generate SGLang kernel schemas?

You need to parse the model config to extract kernel parameters and types. The tool uses sgl-cookbook serving configurations to align these parameters, ensuring accurate schemas and avoiding duplicates when outputting the definition JSONs.

Why are my FlashInfer kernel definitions missing reference implementations?

FlashInfer kernel definitions may lack reference implementations if they are unavailable during extraction. The tool saves definition JSON files with naming conventions and includes reference implementations for validation only when they are available in the source model.