add-sgl-kernel

Implement CUDA/C++ AOT kernels in sgl-kernel with Python and Torch extensions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides an end-to-end blueprint for adding a heavyweight CUDA/C++ AOT kernel to sgl-kernel, covering implementation, integration, testing, and benchmarking to accelerate custom ops.

Core Features & Use Cases

  • End-to-end kernel development workflow: from C++ kernel to Torch extension, Python wrapper, tests, and benchmarks.
  • Full project integration: CMake updates, header declarations, and op registration, with production-grade validation.
  • Use Case: A software-engineering team wants to add a performant custom kernel for elementwise ops in sgl-kernel and verify correctness and performance.

Quick Start

Follow the outlined steps to implement, test, and benchmark a new CUDA/C++ kernel in sgl-kernel.

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 custom CUDA kernel to a torch extension for production use?

Adding a custom CUDA kernel to a torch extension involves implementing the C++ kernel source, updating CMake and headers, registering the op, and exposing Python APIs for end-to-end integration.

What does an end-to-end CUDA C++ kernel development workflow include?

An end-to-end CUDA C++ kernel workflow includes writing the kernel source, updating CMake and headers, registering the op, exposing Python APIs, and adding tests and benchmarks for validation.

Do I need to update CMake and headers when integrating a heavyweight CUDA kernel?

Yes, updating CMake and header declarations is required when integrating a heavyweight CUDA kernel to properly compile the project and register the custom ops through the torch extension.

How do I benchmark a new custom op in sgl-kernel?

You benchmark a new custom op in sgl-kernel by adding benchmarking scripts alongside your tests, allowing you to verify both correctness and performance gains of the CUDA kernel implementation.

Can I expose Python APIs for an AOT CUDA kernel without updating CMake?

No, exposing Python APIs for an AOT CUDA kernel requires updating CMake configurations to compile the torch extension and properly register the custom op for Python accessibility.

What is the best way to verify correctness for a newly added C++ kernel?

The best way to verify correctness for a newly added C++ kernel is to implement dedicated tests within the project structure, ensuring the custom op behaves as expected before benchmarking performance.