Skip to content
OpenSmartRoute
Skillv1.0.0

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 weig

by nvidia(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from nvidia/skills (skills/tilegym-monkey-patch-kernels-to-transformers/SKILL.md) via skills.sh. Install upstream with npx skills add nvidia/skills --skill tilegym-monkey-patch-kernels-to-transformers. Copyright stays with the author (CC-BY-4.0 AND Apache-2.0).

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

  1. Prepare experiment environment. Follow environment-setup.md
  2. Integrate existing TileGym kernels to the target model. Follow kernel-integration.md
  3. 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
  4. 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.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/nvidia-skills-tilegym-monkey-patch-kernels-to-transformers/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

nvidia-skills-tilegym-monkey-patch-kernels-to-transformers.ocm.jsonjson
{
  "ocm": "1",
  "id": "nvidia-skills-tilegym-monkey-patch-kernels-to-transformers",
  "kind": "skill",
  "name": "tilegym-monkey-patch-kernels-to-transformers",
  "description": "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.",
  "publisher": "nvidia",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "tilegym",
      "transformers",
      "integration",
      "kernel",
      "monkey-patch",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "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."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/nvidia/skills",
      "path": "skills/tilegym-monkey-patch-kernels-to-transformers/SKILL.md",
      "ref": "HEAD",
      "url": "https://www.skills.sh/nvidia/skills/tilegym-monkey-patch-kernels-to-transformers",
      "key": "nvidia/skills/skills/tilegym-monkey-patch-kernels-to-transformers/SKILL.md"
    },
    "compatibility": "Verified on Claude Code with Opus-4.6 and onward, CodeX with GPT-5.5 and onward, and Cursor (Agent mode) with GPT-5.3-CodeX and stronger models.",
    "license": "CC-BY-4.0 AND Apache-2.0"
  },
  "instructions": "# Integrate and create cuTile kernels into 🤗 Transformers\nThe 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, s",
  "cost": {
    "context_tokens": 549
  }
}

Fetch it by URL: GET /api/v1/registry/nvidia-skills-tilegym-monkey-patch-kernels-to-transformers/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.