--- id: polygraphy version: "0.53.4" license: Apache 2.0 license_treatment: permissive maintenance: active --- # polygraphy — Polygraphy: A Deep Learning Inference Prototyping and Debugging Toolkit License: permissive · Maintenance: active · Downloads: 227.5K/mo ## 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 above — 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 pip install polygraphy uv add polygraphy 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_current - Install friction: low - Maintenance: active - Downloads: 227.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags tensorrt inference debugging, deep learning model comparison, onnx model conversion, neural network quantization, model format conversion toolkit, inference backend testing, tensorrt engine optimization, deep-learning-inference, model-debugging, tensorrt [View on SkillFed](https://skillfed.io/packages/polygraphy) · [View on PyPI](https://pypi.org/project/polygraphy/)