mcpbeat

Tilegym Monkey Patch Kernels To Transformers

nvidia/tilegym-monkey-patch-kernels-to-transformers

Integrate TileGym kernels into Hugging Face `transformers` models by replacing the library's submodule(s) and certain class(es)' implementations, and patching certain class(es)' init/forward/load weight methods prior to instantiating models. Used when the user requires integrating TileGym kernels into `transformers` models.

291k tokens
context cost
the whole folder, loaded on every use
10
files
instructions only
0
copies elsewhere
how many repositories repackaged it
789
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/NVIDIA/TileGym --skill tilegym-monkey-patch-kernels-to-transformers

What comes with it

1 161 535 bytes besides the instruction
BENCHMARK.md
evals/evals.json
references/auto-kernelize.md
references/environment-setup.md
references/kernel-integration.md
references/kernel-inventory-schema.md
references/workflow-diagram.png
skill-card.md
skill.oms.sig

The instruction itself

5 sections, as written by the author

Integrate 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.

How to use it

Copy the folder

Take nvidia/tilegym-monkey-patch-kernels-to-transformers from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.