Data Science

Video: Introduction to Recurrent Neural Networks in TensorRT

AI-Generated Summary

  • NVIDIA TensorRT optimizes trained deep learning models for low-latency, high-throughput inference and can import models from every major framework.
  • The video demonstrates configuring a character-level language model using RNNv2, MatrixMultiply, ElementWise, and TopK layers with BSE input format.
  • Weights for each gate and layer must be set separately for the RNNv2 layer, and fully connected layers can be implemented with MatrixMultiply and ElementWise layers or the native Fully Connected layer with reshaped weights.
  • Serialized engines can be saved to memory blocks, files, or streams to avoid repeating the optimization step.
  • The same implementation can be achieved in Python using the TensorRT Python API.

Next Steps

  • Download TensorRT to begin building optimized inference engines.
  • Explore the Jupyter Notebook used in the video to follow the RNN configuration example.
  • Review additional TensorRT samples for more implementation patterns.
Powered by NVIDIA Nemotron. AI-generated content may summarize information incompletely. Verify important information. Learn more

NVIDIA TensorRT™ is a high-performance deep learning inference optimizer and runtime that delivers low latency and high-throughput. TensorRT can import trained models from every deep learning framework to easily create highly efficient inference engines that can be incorporated into larger applications and services.

This video demonstrates how to configure a simple Recurrent Neural Network (RNN) based on the character-level language model using NVIDIA TensorRT. (https://github.com/karpathy/char-rnn)

Five Key Things from this video:

  1. TensorRT supports RNNv2, MatrixMultiply, ElementWise, TopK layers.
  2. Weights for each gate and layer need to be set separately for the RNNv2 layer. The input format for RNNv2 is BSE (Batch, Sequence, Embedding).
  3. Fully Connected layer can also be implemented with a MatrixMultiply layer and an Element Wise layer. Alternatively, you can directly use the Fully Connected layer of TensorRT, but it requires a reshape of the weights before they are fed to this layer.
  4. You can Serialize the Engine to a memory block, which you could then serialize to a file or stream. This eliminates the need to perform optimization step again.
  5. Although this sample is built using C++, you can implement the same with Python using TensorRT Python API.

To follow along with this video and get started:

Discuss (1)

Tags