add-sgl-kernel

Add a CUDA/C++ kernel to the SGL ecosystem with PyTorch integration.

9|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/Fridge003/sglang-dev-tools --skill add-sgl-kernel-fridge003
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-sgl-kernel
Source: https://github.com/Fridge003/sglang-dev-tools/tree/main/ai-wheels/.claude/skills/add-sgl-kernel
Command: npx skills add https://github.com/Fridge003/sglang-dev-tools --skill add-sgl-kernel-fridge003

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This material provides a complete, end-to-end guide for adding a heavyweight CUDA/C++ kernel to the sgl-kernel project, including tests, benchmarks, and the required build and Python integration steps.

Core Features & Use Cases

  • End-to-end kernel creation: implement a new operation in C++/CUDA, expose it to PyTorch, and register it in the library.
  • Build, test, and benchmark: wire up CMake, unit tests, and a Triton/Torch-backed benchmark to validate performance and correctness.
  • Real-world use: extend the sgl-kernel with custom operations to accelerate workloads in ML or data processing pipelines.

Quick Start

Follow the provided tutorial to implement and register a new CUDA kernel in the sgl-kernel project.

Frequently Asked Questions about add-sgl-kernel

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

FAQPage Schema
How do I add a new CUDA kernel to the SGL kernel project?

To add a new CUDA kernel, you implement the operation in C++/CUDA, expose it via Python API, register it in the library, and wire up CMake. This ensures your custom op integrates with PyTorch and the AOT workflow.

What is needed for a complete CUDA kernel integration in SGL kernel?

A complete CUDA kernel integration requires C++/CUDA implementation, public declarations, library registration, Python API exposure, unit tests, and benchmarks. This validates both correctness and performance within the ML pipeline.

How do I benchmark a custom PyTorch CUDA kernel?

You benchmark a custom PyTorch CUDA kernel by wiring up a Triton or Torch-backed benchmark alongside the CMake build. This validates the performance and correctness of your new operation within the SGL kernel ecosystem.

Can I use C++ to extend the SGL kernel with custom ops for PyTorch?

Yes, you can extend the SGL kernel by writing a new operation in C++/CUDA and registering it in the library. This exposes the custom op to PyTorch and integrates it into the AOT workflow.

What's the best way to test a new CUDA kernel added to an ML library?

The best way to test a new CUDA kernel is to wire up unit tests and benchmarks using CMake. This validates the correctness and performance of your custom operation within the SGL kernel ecosystem.

Why do I need to register my CUDA kernel in the library?

Registering your CUDA kernel in the library exposes the C++/CUDA implementation to the Python API. This enables PyTorch integration and ensures the custom op functions within the AOT workflow.