A kernel is a small processor program. Kernel tuning selects and optimizes kernels, their order, and execution configuration to minimize runtime on particular hardware and workloads. section 6.1.1
For convolution, competing algorithms are tested against GPU type, input and filter sizes, tensor layout, batch size, and related deployment characteristics. section 6.1.1
Practical implications:
- Optimizing for a specific neural network and platform improves resource use and performance, but requires uncommon hardware and machine-learning expertise. section 6.1.1
- Treat tuning as platform-specific rather than universally optimal: changing shapes, layouts, batch sizes, or GPU targets can change the best kernel. section 6.1.1
Compiling an LLM for a target GPU
A TensorRT workflow traces a GPT-2 model, declares static or dynamic input shapes and tensor data types, and compiles it for GPU execution. section 6.1.1
Figure 6.2 An example of an unoptimized network compared to the same network optimized using graph optimization. CBR is a NVIDIA fused layer kernel that simply stands for Convolution, Bias, and ReLU. See the following NVIDIA blog post for reference: https://mng.bz/PNvw.
Compare an unoptimized network with graph optimization that fuses convolution, bias, and ReLU into a CBR kernel. section 6.1.1
