polygraphy
Polygraphy: A Deep Learning Inference Prototyping and Debugging Toolkit
What it is and what it does
Polygraphy is NVIDIA's toolkit for prototyping and debugging deep learning model inference. It provides both a Python API and command-line interface that let you run models across multiple inference backends (TensorRT, ONNX-Runtime, and others), compare their outputs to detect discrepancies, and convert models between formats with optional quantization. The toolkit also includes utilities to inspect model structure, extract and modify ONNX subgraphs, and isolate problematic TensorRT tactics.
The package has no hard Python dependencies, but functionality is modular: each backend (TensorRT, ONNX, etc.) has its own optional requirements. You can either install dependencies manually per backend or enable automatic installation at runtime via environment variable. This design lets you keep a minimal footprint if you only use a subset of backends, or get everything installed on-demand if you prefer convenience.
Use it for:
- Compare inference results across TensorRT and ONNX-Runtime to verify model conversion correctness
- Convert trained models to TensorRT engines with post-training quantization for deployment optimization
- Debug why a model produces different outputs on different inference backends
- Inspect and extract subgraphs from ONNX models for testing or modification
- Isolate which TensorRT tactic is causing numerical instability in a model
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Polygraphy is a toolkit for running inference across multiple deep learning backends (TensorRT, ONNX-Runtime, etc.), comparing results, converting models to different formats, and debugging model behavior.
Yes. Polygraphy is actively maintained, has no install friction, carries a permissive license, and solves a real problem for anyone working with multiple deep learning inference backends. The modular dependency design means you only pay for what you use. No known vulnerabilities. Install it if you need to prototype, compare, or debug deep learning inference across frameworks.
Install
polygraphy on PyPI
pip
pip install polygraphyuv
uv add polygraphypoetry
poetry add polygraphyInstalling polygraphy
Before you install
Low friction installation as a pure Python wheel with no runtime dependencies. Actively maintained with a release within the past week and 13250 GitHub stars. Optional dependencies are installed on-demand via environment variable configuration.
License in practice
Apache 2.0 is permissive; you can use this in commercial or proprietary projects without restriction, though you must include a copy of the license and state any modifications.
Quickstart
pip install polygraphy
import polygraphy
from polygraphy.backend.trt import TrtRunner
from polygraphy.backend.onnx import OnnxrtRunner
# Compare inference across backends
trt_runner = TrtRunner(engine_path)
onnx_runner = OnnxrtRunner(model_path)
results = {"trt": trt_runner.infer(inputs), "onnx": onnx_runner.infer(inputs)}
Requires Python 3.6 or later. Most functionality requires optional backend-specific dependencies (TensorRT, ONNX-Runtime, etc.) which can be auto-installed via POLYGRAPHY_AUTOINSTALL_DEPS=1 environment variable or installed manually from backend requirements.txt files.
Verify before relying
- Whether the toolkit's CLI commands (convert, inspect, surgeon, debug) are fully functional without manually installing backend dependencies
- Performance overhead of the auto-install mechanism when POLYGRAPHY_AUTOINSTALL_DEPS is enabled
- Compatibility with specific versions of TensorRT, ONNX-Runtime, and other backends beyond the minimum requirements
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 227,487/month — #9,178 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: polygraphy-0.53.4-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
sit4onnxRuns inference tests on ONNX models using…
permissive · top 15,000 on PyPI
inference-modelsLoads and runs computer vision models from…
unclear · top 15,000 on PyPI
tensorrtTensorRT compiles and optimizes deep learning…
unclear · top 15,000 on PyPI
openvinoOpenVINO converts and optimizes deep learning…
permissive · top 5,000 on PyPI
onnx-toolParse, analyze, optimize, and profile ONNX…
permissive · top 15,000 on PyPI
nvidia-modeloptApplies state-of-the-art model optimization…
permissive · top 15,000 on PyPI
tensorrt-cu13-libsProvides NVIDIA TensorRT libraries for…
unclear · top 15,000 on PyPI
onnxslimOnnxSlim reduces the size and operator count of…
permissive · top 5,000 on PyPI
ssi4onnxInfers and fills missing tensor shape…
permissive · top 15,000 on PyPI
tensorrt-cu13Provides Python bindings for NVIDIA TensorRT, a…
unclear · top 15,000 on PyPI