AI Hardware & Software Stack
Why can inference runtimes such as TensorRT or ONNX Runtime run faster than using the training framework directly for inference?
- AThey optimize the graph for inference only, applying fusion, quantization and hardware-specific kernel selection
- BThey skip computation and give approximate answers
- CThey increase the number of model weights
Show answer and explanation
Answer: A. They optimize the graph for inference only, applying fusion, quantization and hardware-specific kernel selection
Training frameworks prioritize flexibility and recording for backpropagation, which is wasteful for inference alone. After loading a model, an inference runtime strips parts unneeded for inference, fuses operations, converts weights and activations to lower precision where appropriate and selects the fastest kernels for the target GPU or NPU. This greatly reduces latency and memory for the same model.
- A. Correct. Backpropagation machinery is no longer needed.
- B. They do not skip computation.
- C. The number of weights does not increase.