skillfed

polygraphy

Polygraphy: A Deep Learning Inference Prototyping and Debugging Toolkit

polygraphy v0.53.4 227.5K downloads/30d#9,178 on PyPI13,250
Permissive license Apache 2.0 Active released

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 polygraphy

uv

uv add polygraphy

poetry

poetry add polygraphy

Installing 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

Intended Audience :: DevelopersProgramming Language :: Python :: 3

Tags

tensorrt inference debuggingdeep learning model comparisononnx model conversionneural network quantizationmodel format conversion toolkitinference backend testingtensorrt engine optimization
deep-learning-inferencemodel-debuggingtensorrt

More Artificial Intelligence packages