---
title: "Custom Kernels for All from Codex and Claude"
description: "Hugging Face packaged CUDA kernel expertise (GPU architecture guides for H100/A100/T4, diffusers and transformers integration patterns, vectorized kernel templates, benchmark scripts) into an agent skill that lets Claude and Codex generate complete kernel-builder projects with PyTorch bindings."
url: "https://swe.quest/articles/custom-kernels-for-all-from-codex-and-claude-9d652cbc33fa9001"
canonical: "https://huggingface.co/blog/custom-cuda-kernels-agent-skills"
source: "Hugging Face"
published: "2026-02-13"
difficulty: "medium"
kind: "How-to"
reading_minutes: 9
tags: ["ai-coding","performance","inference","hardware","python"]
---

# Custom Kernels for All from Codex and Claude

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2026-02-13, 9 min read, How-to. Original: [https://huggingface.co/blog/custom-cuda-kernels-agent-skills](https://huggingface.co/blog/custom-cuda-kernels-agent-skills)

## Summary

Hugging Face packaged CUDA kernel expertise (GPU architecture guides for H100/A100/T4, diffusers and transformers integration patterns, vectorized kernel templates, benchmark scripts) into an agent skill that lets Claude and Codex generate complete kernel-builder projects with PyTorch bindings. Agent-written RMSNorm kernels averaged 1.88x over PyTorch for LTX-Video and 1.94x for Qwen3-8B on H100 in BF16, with Qwen3 speedups growing from 1.58x at 128 tokens to 2.47x at 8192. End to end, LTX-Video gained only 6% (1.43x with torch.compile), consistent with RMSNorm taking about 5% of compute. The post also walks through building all PyTorch/CUDA variants with Nix and publishing to the Kernel Hub for one-line loading via get\_kernel.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Hardware](https://swe.quest/tags/hardware.md) (Infrastructure)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- CUDA kernel basics ([easy posts on Operating systems](https://swe.quest/tags/operating-systems.md?difficulty=easy))
- PyTorch custom ops
- coding agents ([easy posts on AI agents](https://swe.quest/tags/ai-agents.md?difficulty=easy))

## Keywords

CUDA, Hugging Face Kernel Hub, kernel-builder, Claude Code, Codex, RMSNorm, LTX-Video, Qwen3-8B

## Related posts

- [Learn the Hugging Face Kernel Hub in 5 Minutes](https://swe.quest/articles/learn-the-hugging-face-kernel-hub-in-5-minutes-049114b1e85677a7.md): Hugging Face · 2025-06-12 · Medium · 13 min read · Inference & serving, Performance engineering, Python, Hardware
  Hugging Face's Kernel Hub and \`kernels\` library let PyTorch code download pre-compiled, optimized GPU kernels such as FlashAttention, activations, RMSNorm and quantization kernels with a single \`get\_kernel\` call.
- [From Zero to GPU: A Guide to Building and Scaling Production-Ready CUDA Kernels](https://swe.quest/articles/from-zero-to-gpu-a-guide-to-building-and-scaling-production-ready-cuda-kernels-c01f08e3adeb6b0b.md): Hugging Face · 2025-08-18 · Medium · 16 min read · Hardware, Python, C & C++, Build systems, Machine learning
  Hugging Face's kernel-builder lets developers write a custom CUDA kernel, register it as a native PyTorch operator, build it reproducibly with Nix for every supported PyTorch/CUDA combination, and publish it to the Hub for loading via \`get\_kernel\`.
- [Easily Build and Share ROCm Kernels with Hugging Face](https://swe.quest/articles/easily-build-and-share-rocm-kernels-with-hugging-face-dfc0e1a655e74ace.md): Hugging Face · 2025-11-17 · Medium · 13 min read · Build systems, Hardware, Machine learning, C & C++, Python
  Hugging Face's kernels library and kernel-builder can package a custom ROCm kernel as a native PyTorch operator and share it on the Hub, shown with the prize-winning RadeonFlow FP8 block-wise GEMM kernel for AMD MI300X.
- [We Got Claude to Build CUDA Kernels and teach open models!](https://swe.quest/articles/we-got-claude-to-build-cuda-kernels-and-teach-open-models-729005bab002af9e.md): Hugging Face · 2026-01-28 · Medium · 13 min read · AI agents, AI for coding, Evaluation, LLMs
  upskill is a CLI that uses a strong teacher model (Claude Opus 4.5) to turn an agent trace into a portable Agent Skill (SKILL.md), auto-generates test cases, and measures skill lift on cheaper or local student models with and without the skill.
- [Hugging Face ❤️ TorchTPU: TPUs, Natively](https://swe.quest/articles/hugging-face-torchtpu-tpus-natively-25e58a9bb63cbf24.md): Hugging Face · 2026-10-20 · Medium · 6 min read · Inference & serving, Hardware, Python, Machine learning
  TorchTPU is a native PyTorch backend that makes TPU an ordinary device, replacing the lazy-tensor torch\_xla path and making Optimum TPU unnecessary for running Hugging Face models.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
