add-jit-kernel

Add a CUDA kernel to Sling's jit_kernel module for element-wise ops.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/Nabilhassan12345/voice-ai-workspace --skill add-jit-kernel-nabilhassan12345
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-jit-kernel
Source: https://github.com/Nabilhassan12345/voice-ai-workspace/tree/main/sglang/.claude/skills/add-jit-kernel
Command: npx skills add https://github.com/Nabilhassan12345/voice-ai-workspace --skill add-jit-kernel-nabilhassan12345

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The tutorial enables developers to prototype and integrate small CUDA kernels quickly inside SGLang by providing a clear workflow, abstractions, and tooling.

Core Features & Use Cases

  • Step-by-step guidance to implement a simple element-wise kernel (scale) using JIT compilation for rapid iteration.
  • Demonstrates how to wire CUDA kernels with Python wrappers, tensor validation via TensorMatcher, and a deterministic launcher through LaunchKernel.
  • Suitable for building lightweight GPU primitives and experimenting with FP16, BF16, and FP32 data types in a production-like workflow.

Quick Start

Create a new element-wise scale kernel under jit_kernel and wire it through the Python wrapper to run on CUDA.

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 a custom CUDA kernel to SGLang for rapid prototyping?

To add a custom CUDA kernel to SGLang, you implement a simple element-wise operation, validate it with TensorMatcher, ensure vectorized memory access via AlignedVector, and wrap it in a Python module that compiles and caches the JIT kernel.

What is the best way to test element-wise GPU operations across different data types?

Testing element-wise GPU operations across data types is done by using a Python wrapper that compiles and executes JIT kernels, applying runtime safety checks and deterministic launchers to validate FP16, BF16, and FP32 tensor operations.

Can I use JIT compilation for simple CUDA ops without writing complex C++ wrappers?

Yes, you can use JIT compilation for simple CUDA ops by leveraging a Python wrapper that handles compilation, caching, and execution, allowing you to rapidly prototype element-wise operations like scale without complex C++ wrappers.

How do I ensure vectorized memory access and runtime safety when developing a CUDA kernel?

To ensure vectorized memory access and runtime safety when developing a CUDA kernel, you apply TensorMatcher for validation and use AlignedVector for memory access, wrapping the execution through a LaunchKernel wrapper.

Does the SGLang jit_kernel module support BF16 and FP16 data types for GPU acceleration?

Yes, the SGLang jit_kernel module supports BF16 and FP16 data types for GPU acceleration, allowing developers to implement and test simple element-wise CUDA operations across FP16, BF16, and FP32 formats.