Writing Skills
writing-skills
效率与协作技能,来自 obra/superpowers,查看原文获取完整用途和操作说明。
torch-tensorrt【部署与运维】Use this skill for Torch-TensorRT tasks: compiling PyTorch models with TensorRT, dynamic-shape/export workflows, runtime optimization, Triton/C++/distributed deployment, debugging unsupported ops, and maintaining source builds.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Torch-TensorRT accelerates PyTorch inference on NVIDIA GPUs by compiling supported graph regions into TensorRT engines while keeping PyTorch integration for the rest of the workflow. Use this root as a router first; load sub-skills for detailed procedures.
Use this skill when the request mentions any of these signals:
torch_tensorrt, torch-tensorrt, torch-tensorrt-rtx, TensorRT-RTX, backend="torch_tensorrt", ir="dynamo", or torchtrtrun.torch.export plus TensorRT, TensorRT engine serialization, .ep, .ts, .pt2, .engine, or .pte artifacts.Input(...), Device(...), precision settings, unsupported-op fallback, dryrun, custom converters, TensorRT plugins, or QDP kernels.Do not use this skill for generic PyTorch training, generic TensorRT C++ applications with no PyTorch/Torch-TensorRT layer, or unrelated model-serving frameworks unless Torch-TensorRT artifacts are part of the task.
Confirm the user has, or is willing to prepare, an NVIDIA GPU runtime with compatible CUDA, PyTorch, TensorRT or TensorRT-RTX, and torch_tensorrt installed.
If the package is missing, start with a matching public install command and then narrow the environment from there:
python -m pip install torch torch-tensorrt tensorrt
# or, for the RTX variant
python -m pip install torch torch-tensorrt-rtx
Adjust CUDA/PyTorch versions to the user's platform before promising success.
Run the bundled environment probe when install state is uncertain:
python scripts/check_torch_tensorrt_env.py --no-cuda-smoke
The script is safe: it imports packages, prints versions/features, and only allocates a tiny CUDA tensor when CUDA is visible.
Read references/installation-and-features.md before giving install advice, choosing standard TensorRT versus TensorRT-RTX, diagnosing optional features, or interpreting ENABLED_FEATURES.
Read references/api-surface-map.md when the user names an API but it is unclear which sub-skill owns it.
Read references/troubleshooting.md when the first visible symptom is an import, CUDA, TensorRT wheel, serialization, quantization, or unsupported-op error.
| User goal | Load this sub-skill |
|---|---|
Compile a model through torch.compile, torch_tensorrt.compile, torch.export, dynamic shapes, precision/settings, save/load, raw engine extraction, or Windows cross-compile API choices | sub-skills/compilation-and-export/SKILL.md |
| Optimize a compiled module at runtime: CUDA Graphs, output allocator, preallocated outputs, weight streaming, engine/timing/runtime caches, TensorRT-RTX runtime settings, mutable modules, refit, benchmarking, memory triage | sub-skills/runtime-optimization/SKILL.md |
Deploy compiled artifacts to Python, C++, AOTInductor, Triton, ExecuTorch, DLA/Jetson, Windows/ARM64, TensorRT-RTX, or distributed inference with torchtrtrun | sub-skills/deployment-and-distributed/SKILL.md |
Debug or extend compiler behavior: dryrun, Debugger, capture/replay, unsupported ops, converter/lowering/plugin authoring, QDP kernels, ModelOpt/quantization warnings, issue-quality repros | sub-skills/extensibility-and-debugging/SKILL.md |
| Build or test Torch-TensorRT from source, choose package variants, inspect CI/test lanes, or maintain repository code | sub-skills/build-and-maintenance/SKILL.md |
torch.compile(..., backend="torch_tensorrt"), torch_tensorrt.compile(..., ir="dynamo"), or torch.export.export(...) followed by torch_tensorrt.dynamo.compile(...)..ts, C++/libtorch, DLA, or source builds.dryrun, torch_executed_ops, min_block_size, or model rewrites before recommending custom converter/plugin work.references/repo-provenance.md.references/repo-routing-metadata.json.