tilegym-monkey-patch-kernels-to-transformers
About tilegym-monkey-patch-kernels-to-transformers
A skill for AI agents that integrates TileGym cuTile kernels into Hugging Face Transformers models without editing Transformers source. It also guides agents through creating kernels for uncovered operations and checking correctness and performance.
Key features
- 01Monkey-patches Transformers model components
- 02Integrates existing TileGym kernels
- 03Creates cuTile kernels for uncovered code
- 04Checks correctness and end-to-end throughput
- 05Tracks kernels with Definition and Solution metadata
Use cases
- 01Replace model components with TileGym kernels
- 02Extend kernel coverage for a target model
- 03Evaluate end-to-end correctness and performance
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ nvidia/ skills --skill tilegym-monkey-patch-kernels-to-transformersAfter installing, type/tilegym-monkey-patch-kernels-to-transformersin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
BENCHMARK.mdskill-card.mdskill.oms.sigevals/evals.jsonreferences/auto-kernelize.mdenvironment-setup.mdkernel-integration.mdkernel-inventory-schema.mdDetails
From the project READMEIntegrate and create cuTile kernels into 🤗 Transformers
The main purpose of TileGym project is to provide performant kernels for LLM training and inference. We will integrate proper kernels available in TileGym project to LLM models provided by Hugging Face transformers library to validate end-to-end functional correctness and performance improvements. Instead of modifying transformers source code, we will take a non-intrusive monkey-patch approach: We will replace certain modules/classes/methods in transformers library that implement the Transformer model we would like to integrate, such that at model instantiation, that model's core components will be replaced by TileGym implementations. At runtime the model will actually invoke TileGym kernels under the hood. In addition, we will follow an auto-research-style agent harness loop to create and integrate new cuTile kernels to the target model to improve kernel coverage and end-to-end throughput.
Instructions
This is for human readers: Simply prompt your favorite AI Agent with skill name and target model ID. E.g.,:
Hi, please /monkey-patch-kernels-to-transformers Qwen/Qwen3.5-0.8B.
The Agent might ask you several questions. Make clarifications and give a go confirmation.
Workflow
- Prepare experiment environment. Follow environment-setup.md
- Integrate existing TileGym kernels to the target model. Follow kernel-integration.md
- Autonomously create new cuTile kernels for uncovered PyTorch code. Follow auto-kernelize.md
- Feel free to add new cuTile kernels with constraints in mind
- Do not stop until meet auto-kernelize loop stop conditions
- Summarize and report
Disciplines
This is for AI Agents executing this workflow.
Kernel inventory
Reusable transformer-local kernels must be represented with FlashInfer-Bench-style Definition and Solution metadata. Follow kernel-inventory-schema.md when researching compute requirements, inventorying existing kernels, proposing candidates, or creating new generated kernels.