Tilegym Monkey Patch Kernels To Transformers

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

作者 nvidiacf5224d14250CC-BY-4.0 AND Apache-2.03.5K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫今天更新

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.

AI 產生的概覽

透過非侵入式 monkey-patch 將 TileGym cuTile 核心整合到 Hugging Face transformers 模型,並自動產生新核心。

功能
引導代理將 TileGym 核心整合到目標 Hugging Face transformers 模型中,在實例化前取代子模組並修補類別的 init、forward 與權重載入方法,讓模型在執行時呼叫 TileGym 核心。它也會執行自動研究式迴圈,為尚未涵蓋的 PyTorch 程式碼建立並整合新的 cuTile 核心,最後進行總結與報告。產出包括修補後的模型整合、新核心定義與報告。
適用情境
適用於使用者希望將 TileGym 核心整合到特定 transformers 模型,以驗證端對端正確性與輸送量提升的情境。它面向 transformer 模型的核心整合與核心產生工作,而非一般模型訓練或推論任務。
執行需求
需要 AI 代理環境(已在 Claude Code、CodeX 與 Cursor Agent 模式上驗證),並可存取 TileGym 專案與 Hugging Face transformers。它引用環境設定、核心整合、自動核心化與核心清單結構描述文件,且不附帶指令碼。

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.,:

Claude/CodeX
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.

來源與署名

來源:nvidia/skills位於skills/tilegym-monkey-patch-kernels-to-transformers提交cf5224d

授權條款: CC-BY-4.0 AND Apache-2.0

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架