write-tensorrt-plugin-integration-plan

A planning guide for placing a custom CUDA operation inside a TensorRT engine. TensorRT is NVIDIA software that runs trained machine-learning models for inference, meaning using them to produce results.

In plain words
What is it for?
Planning TensorRT plugins for unsupported model operations, custom GPU kernels, production inference, and migrations between plugin APIs.
Why use it?
It helps decide how the custom operation should handle changing input sizes, saved engine data, number formats, memory, and language bindings.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/tensormux/kernel-skills/write-tensorrt-plugin-integration-plan
Any agent
npx skills add tensormux/kernel-skills --skill write-tensorrt-plugin-integration-plan
Clone the repo
git clone --depth 1 https://github.com/tensormux/kernel-skills

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,448 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.04448
Opus 5 $0.00000 $0.02224
Sonnet 5 $0.00000 $0.00890
Haiku 4.5 $0.00000 $0.00445

Measured yesterday against content hash 7ed04c712023, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

write-tensorrt-plugin-integration-plan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/inference/write-tensorrt-plugin-integration-plan/SKILL.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: Write a TensorRT Plugin Integration Plan

Purpose

Guide the agent through planning how a custom CUDA kernel will be wrapped as a TensorRT plugin so it can be invoked from inside a TensorRT engine — covering API choice (IPluginV3 vs IPluginV2DynamicExt), the plugin lifecycle, dynamic shape handling, serialization, mixed precision (FP16/INT8/FP8), workspace management, CUDA graph compatibility, and the C++/Python binding strategy. The output is an integration plan with explicit decisions, not the plugin source code itself.

Use this when

  • A custom CUDA kernel must be deployed inside a TensorRT engine (production inference) and no built-in TRT layer covers it.
  • An ONNX model contains an unsupported op that must be lowered to a custom plugin during ONNX → TRT conversion.
  • A TRT-LLM-style codebase needs a new operator wrapped as a plugin to participate in engine builds.
  • Migrating an existing IPluginV2DynamicExt plugin to IPluginV3 for a TensorRT 9.x or 10.x upgrade.

Do not use this when

  • The operation is already covered by a built-in TRT layer (most GEMMs, conv shapes, softmax, layernorm fused into MHA, common activations) — the built-in path is almost always faster than a plugin because it participates in TRT's graph optimizer and tactic selection.
  • The op can be expressed as a composition of existing TRT layers (e.g. IElementWiseLayer, IMatrixMultiplyLayer, IShuffleLayer) — TRT's optimizer fuses these well; an opaque plugin blocks fusion.
  • The deployment target is not TensorRT. For vLLM use a vLLM custom op; for ONNX Runtime use an ORT custom op; for raw PyTorch use torch.library.
  • The kernel relies on JIT autotuning at runtime (e.g. Triton with Python-side autotune). TRT engines are built ahead of time and cannot host Python or runtime JIT inside enqueue.
  • The kernel allocates host memory or synchronizes inside the launch path — incompatible with CUDA graph capture, which is how production TRT inference servers reach low latency.

Read the full file on GitHub · 150 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 150 lines · 0 tokens per session scan A 7ed04c712023

Subscribe to this mod's changes

write-tensorrt-plugin-integration-plan is a skill published in the GitHub repository tensormux/kernel-skills (70 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,448 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

design-impl-audit

The Design-vs-Implementation Audit Copilot. A universal skill for any project, any language, any design document. Before work starts, it reminds engineers what must be delivered; after code lands, it checks what was actually delivered, what drifted, and what silently went beyond the design. Feed it a design doc plus a…

MagicKidd/Rokid-agentic-workflow · 0 tokens

skill-creator

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

MagicKidd/Rokid-agentic-workflow · 45 tokens

brainstorming

Brainstorming design process. Must be used before any creative work - creating features, building components, adding functionality, or modifying behavior. Transforms ideas into complete designs and specifications through collaborative dialogue. Trigger words: brainstorm, design discussion, requirement analysis…

MagicKidd/Rokid-agentic-workflow · 0 tokens

diagnose

Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this" / "debug this", reports a bug, says something is broken/throwing/failing, or describes a performance regression.

MagicKidd/Rokid-agentic-workflow · 66 tokens

mergeable-feature-dev

For new-module development or cross-module refactors, enforce separation of scaffolding from deliverables so that "locally standalone runnable" and "low-cost mergeable into the trunk" hold simultaneously. Trigger words: mergeable, low-cost handoff, standalone run, scaffolding, deliverable layer, refactor merge.

MagicKidd/Rokid-agentic-workflow · 0 tokens

prompt-engineering

Prompt engineering techniques and patterns. Use when writing agent commands, hooks, skills, subagent prompts, or any LLM interaction: optimizing prompts, improving output reliability, and designing production-grade prompt templates. Trigger words: prompt engineering, prompt, prompt optimization, LLM interaction.

MagicKidd/Rokid-agentic-workflow · 0 tokens