Overview of custom kernel integration paths in TensorRT-LLM
mainTensorRT-LLM allows you to integrate custom GPU kernels into the PyTorch backend. A custom kernel is wrapped as a PyTorch custom op (accessible via torch.ops.trtllm.<name>). There are three primary integration paths depending on your source language and build requirements:
| Flavor | Source language | Build Timing | Location |
|---|---|---|---|
| CUDA C++ | .cu / .h | At wheel build time (via CMake/nvcc) | cpp/tensorrt_llm/kernels/ |
| CuTe DSL | Python (cutlass.cute) | JIT, on first call (cached in-process) | tensorrt_llm/_torch/cute_dsl_kernels/ |
| cuTile | Python (cuda.tile) | JIT, on first call (cached in-process) | |
tensorrt_llm/_torch/cuda_tile_kernels/ |
Note: The trtllm-gen path (using pre-built CUBINs) is not covered in this guide.