add-jit-kernel

Add a lightweight JIT CUDA kernel to the sglang framework.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/rayleizhu/sglang --skill add-jit-kernel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-jit-kernel
Source: https://github.com/rayleizhu/sglang/tree/main/.claude/skills/add-jit-kernel
Command: npx skills add https://github.com/rayleizhu/sglang --skill add-jit-kernel

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 new, lightweight CUDA kernels into the SGLang framework, streamlining the development of custom high-performance operations.

Core Features & Use Cases

  • JIT Kernel Integration: Learn how to implement and register custom CUDA kernels using Just-In-Time (JIT) compilation within SGLang.
  • Abstractions: Utilizes SGLang's provided C++ and CUDA abstractions for safer and more consistent kernel development.
  • Use Case: Developers can add specialized tensor operations, like custom activation functions or element-wise transformations, directly into SGLang for use in their machine learning models.

Quick Start

Follow the tutorial to implement a new JIT kernel by creating the necessary C++ and CUDA files and adding a Python wrapper.

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?

To add custom CUDA kernels to SGLang, you implement the kernel using Just-In-Time (JIT) compilation, create a Python wrapper, tune build flags, and run tests and benchmarks.

How does JIT compilation work for tensor operations in SGLang?

JIT compilation in SGLang allows you to register and execute custom high-performance tensor operations by dynamically compiling CUDA device code during runtime.

Can I use SGLang abstractions for tensor validation and vectorized memory access in my kernel?

Yes, SGLang provides common C++ and CUDA abstractions for host-side utilities, device-side utilities, tensor validation, type traits, and vectorized memory access to ensure safer kernel development.

What is the best way to integrate custom activation functions into SGLang?

The best way to integrate custom activation functions is to follow the structured guide for adding lightweight JIT CUDA kernels, which covers implementation, Python wrapper creation, and build flag tuning.

Do I need to manually configure build flags when developing a JIT kernel in SGLang?

Yes, the process of adding a JIT kernel involves tuning build flags to ensure your custom CUDA kernel compiles and executes correctly within the SGLang framework.

Why use JIT compilation for custom element-wise transformations in SGLang?

Using JIT compilation for custom element-wise transformations streamlines the integration of specialized high-performance operations directly into SGLang, bypassing the need for static framework recompilation.