monkey-patch-kernels-to-transformers

Monkey-patch TileGym CUDA kernels into HuggingFace Transformers models.

796|82|Updated Nov 13, 2025
One-click install
npx skills add https://github.com/NVIDIA/TileGym --skill monkey-patch-kernels-to-transformers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: monkey-patch-kernels-to-transformers
Source: https://github.com/NVIDIA/TileGym/tree/main/.claude/skills/monkey-patch-kernels-to-transformers
Command: npx skills add https://github.com/NVIDIA/TileGym --skill monkey-patch-kernels-to-transformers

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Patch and integrate TileGym CUDA tile kernels into HuggingFace Transformers models by monkey-patching selected modules and classes to enable TileGym-powered kernels during inference and training, without modifying core model code.

Core Features & Use Cases

  • Inventory and map TileGym kernels to Transformer operations (attention, feed-forward, normalization) for compatible architectures.
  • Provide non-intrusive monkey-patches that swap core components with TileGym-enabled implementations and verify functional correctness.
  • Use cases include accelerating model inference and training loops on supported GPUs with cuTile backends.

Quick Start

Patch a HuggingFace Transformers model to utilize TileGym kernels by applying the monkey-patch and running a small forward pass to validate improvements.

Frequently Asked Questions about monkey-patch-kernels-to-transformers

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

FAQPage Schema
How do I integrate custom CUDA kernels into HuggingFace Transformers without modifying the core model code?

You can integrate custom CUDA kernels into HuggingFace Transformers by applying non-intrusive monkey-patches to swap selected modules with TileGym-enabled implementations. This allows kernel integration during inference and training without altering the original model codebase.

What transformer operations can I target for kernel acceleration using monkey-patching?

You can target common transformer operations for kernel acceleration, specifically mapping TileGym kernels to attention, feed-forward blocks, and normalization layers. The integration requires a manifest of available monkey-patch functions to map these operations accurately.

Can I use TileGym kernels to accelerate both inference and training loops on supported GPUs?

Yes, you can use TileGym kernels to accelerate both inference and training loops on supported GPUs with cuTile backends. The monkey-patching process swaps core components with TileGym-enabled implementations to speed up these execution loops.

How do I verify functional correctness after applying monkey-patches to transformer models?

To verify functional correctness after monkey-patching transformer models, you should run a small forward pass to validate the integration. The process includes steps to implement, verify, and test patches using the provided environment setup and references.

Does the kernel integration approach support common NLP model architectures that rely on standard attention blocks?

Yes, the kernel integration approach is applicable to common transformer architectures that rely on standard attention, feed-forward blocks, and normalization. It patches selected modules and classes to enable TileGym-powered kernels across these compatible NLP models.