add-jit-kernel

Add custom CUDA kernels to the SGLang JIT kernel module.

105|9|Updated Feb 10, 2026
One-click install
npx skills add https://github.com/guqiong96/Lsglang --skill add-jit-kernel-guqiong96
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-jit-kernel
Source: https://github.com/guqiong96/Lsglang/tree/main/.claude/skills/add-jit-kernel
Command: npx skills add https://github.com/guqiong96/Lsglang --skill add-jit-kernel-guqiong96

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides a structured, step-by-step guide to integrate custom CUDA kernels into the SGLang framework, enhancing its computational capabilities for specific AI model inference tasks.

Core Features & Use Cases

  • JIT Kernel Integration: Learn how to add lightweight, Just-In-Time compiled CUDA kernels.
  • Abstractions: Utilize provided C++ and CUDA abstractions for safety, readability, and consistency.
  • Workflow Guidance: Follow a complete process from kernel implementation to Python wrapping and testing.
  • Use Case: Enhance an AI model's inference speed by adding a custom kernel for a novel activation function or a specialized tensor operation not supported by default.

Quick Start

Follow the tutorial to implement a new JIT kernel in the elementwise/scale.cuh file.

Frequently Asked Questions about add-jit-kernel

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

FAQPage Schema
How do I add custom CUDA kernels to SGLang for inference optimization?

Adding custom CUDA kernels to SGLang involves integrating them into the JIT kernel module using provided C++ and CUDA abstractions for tensor validation, memory access, and kernel launching.

What is the process for wrapping a custom CUDA kernel in Python within SGLang?

Wrapping a custom CUDA kernel in Python within SGLang is part of a complete workflow that follows kernel implementation, utilizing provided abstractions to ensure safety and consistency before testing.

When should I use JIT compiled kernels for AI model inference in SGLang?

You should use JIT compiled kernels in SGLang when you need to enhance inference speed by adding a custom kernel for a novel activation function or specialized tensor operation not supported by default.

Does SGLang provide abstractions for tensor validation and memory access when adding kernels?

Yes, SGLang provides specific C++ and CUDA abstractions for tensor validation, memory access, and kernel launching to ensure safety, readability, and consistency when adding custom kernels.

How do I test and benchmark custom CUDA kernels added to the SGLang framework?

Testing and benchmarking custom CUDA kernels in SGLang are the final steps in the workflow, following the implementation and Python wrapping phases, to verify and measure the kernel's performance.