Tripy: A Python Programming Model For TensorRT
Project description
Tripy: A Python Programming Model For TensorRT
Quick Start | Installation | Examples | Notebooks | Contributing | Documentation
Tripy is a debuggable, Pythonic frontend for TensorRT, a deep learning inference compiler.
What you can expect:
- High performance by leveraging TensorRT's optimization capabilties.
- An intuitive API that follows conventions of the ecosystem.
- Debuggability with features like eager mode to interactively debug mistakes.
- Excellent error messages that are informative and actionable.
- Friendly documentation that is comprehensive but concise, with code examples.
Quick Start
See the Introduction To Tripy guide for details:
-
Defining a model:
class Model(tp.Module): def __init__(self): self.conv = tp.Conv(in_channels=1, out_channels=1, kernel_dims=[3, 3]) def __call__(self, x): x = self.conv(x) x = tp.relu(x) return x
-
Initializing it:
model = Model() model.load_state_dict( { "conv.weight": tp.ones((1, 1, 3, 3)), "conv.bias": tp.ones((1,)), } ) dummy_input = tp.ones((1, 1, 4, 4))
-
Executing in eager mode:
eager_out = model(dummy_input)
-
Compiling and executing:
compiled_model = tp.compile( model, args=[tp.InputInfo(shape=(1, 1, 4, 4), dtype=tp.float32)], ) compiled_out = compiled_model(dummy_input)
Installation
Installing Prebuilt Wheels
python3 -m pip install nvtripy -f https://nvidia.github.io/TensorRT-Incubator/packages.html
Building Wheels From Source
For the latest changes, build Tripy wheels from source:
-
Install
build
:python3 -m pip install build
-
Build a wheel from the
tripy
root directory:python3 -m build . -w
-
Install the wheel from the
tripy
root directory:python3 -m pip install -f https://nvidia.github.io/TensorRT-Incubator/packages.html dist/nvtripy-*.whl
-
[Optional] Sanity check:
python3 -c "import nvtripy as tp; x = tp.ones((5,), dtype=tp.int32); assert x.tolist() == [1] * 5"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file nvtripy-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: nvtripy-0.0.9-py3-none-any.whl
- Upload date:
- Size: 259.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 629cb61ad3aa0d2c0677e5f2ce3c3309d4425ca267337b10c8ebd7935e4725dd |
|
MD5 | c2c25ef776edc78ff3a133133cdfb93b |
|
BLAKE2b-256 | d6aa3f5f0eeae6e4d6e14d5b83d87734a3c3a1e772c7615a639eda88d6280c5d |
Provenance
The following attestation bundles were made for nvtripy-0.0.9-py3-none-any.whl
:
Publisher:
tripy-release.yml
on NVIDIA/TensorRT-Incubator
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
nvtripy-0.0.9-py3-none-any.whl
- Subject digest:
629cb61ad3aa0d2c0677e5f2ce3c3309d4425ca267337b10c8ebd7935e4725dd
- Sigstore transparency entry: 164616768
- Sigstore integration time:
- Permalink:
NVIDIA/TensorRT-Incubator@9423503b6a28b56ab831580270faee99221d673b
- Branch / Tag:
refs/tags/tripy-v0.0.9
- Owner: https://github.com/NVIDIA
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
tripy-release.yml@9423503b6a28b56ab831580270faee99221d673b
- Trigger Event:
push
- Statement type: