How nvidia/tensorrt works
Main System Components
• Core Inference Engine Components:
• TensorRT Libraries: Represent the dependency on prebuilt TensorRT GA binaries (the “TRT_LIB_DIR”), which your code extends.
• ONNX Parser: The module (under “parsers”) that converts ONNX models into TensorRT networks.
• Plugin System:
• Python Bindings and Packaging:
• The “python” folder and its packaging subdirectories. These wrap and expose the C++ APIs into Python. Show these as a separate component that communicates with the C++ layers.
• Demo Applications & Samples:
• The “demo”, “quickstart”, and “samples” directories. These are client applications that demonstrate usage of TensorRT capabilities and how to leverage plugins and parsers.
• Build and Configuration Infrastructure:
• The “cmake” directory (with toolchains, modules, etc.) and Docker scripts (“docker” directory) which manage the multi-platform build (including cross-compilation for aarch64) and containerized environment.
• Auxiliary Tools:
• Tools such as “tools/Polygraphy”, “tools/onnx-graphsurgeon”, and additional testing utilities which help in debugging, validating and benchmarking the inference models.
• External Dependencies & System Requirements:
• Dependencies like CUDA, cuDNN, and third-party libraries (cub, protobuf) should be shown as externally provided resources that flow into the build and runtime environments.
Relationships and Data Flow
• That the Python layer interacts with the underlying C++ libraries.
• That demo applications and sample projects “consume” the libraries and plugins to execute inference.
• External systems and dependencies (e.g., CUDA, cuDNN, ONNX, Docker) feeding data into or being required by these modules.
Architectural Patterns and Design Principles
• Modular design: The clear separation between core engine components, plugins, parsers, and language bindings.
• Extensibility: Highlight the plugin architecture that allows new operations to be added without touching the core.
• Cross-platform and portability: Note the use of toolchain files in “cmake/toolchains” and Docker files that encapsulate both native and cross-compiled environments.
• Layered Architecture: At the bottom is the hardware-related libraries (CUDA, cuDNN) and prebuilt libraries, followed by the core inference modules and plugins, then the user-facing Python bindings and demo applications at the top.