Skip to main content

TorchPipe

PyPI version License Documentation Benchmark

TorchPipe is an alternative choice for Triton Inference Server, mainly featuring similar functionalities such as Shared-momory, Ensemble, and BLS mechanism.

For serving scenarios, TorchPipe is designed to support multi-instance deployment, pipeline parallelism, adaptive batching, GPU-accelerated operators, and reduced head-of-line (HOL) blocking.It acts as a bridge between lower-level acceleration libraries (e.g., TensorRT, OpenCV, CVCUDA) and RPC frameworks (e.g., Thrift). At its core, it is an engine that enables programmable scheduling.

News

  • [2026-01-23] 📦 Available on PyPI: pip install torchpipe
  • [2026-01-04] 🔧 We switched to tvm_ffi to provide clearer C++-Python interaction.

Usage

Below are some usage examples, for more check out the examples.

Initialize and Prepare Pipeline

from torchpipe import pipe
import torch

from torchvision.models.resnet import resnet101

# create some regular pytorch model...
model = resnet101(pretrained=True).eval().cuda()

# create example model
model_path = f"./resnet101.onnx"
x = torch.ones((1, 3, 224, 224)).cuda()
torch.onnx.export(model, x, model_path, opset_version=17,
                    input_names=['input'], output_names=['output'], 
                    dynamic_axes={'input': {0: 'batch_size'},
                                'output': {0: 'batch_size'}})

thread_safe_pipe = pipe({
    "preprocessor": {
        "backend": "S[DecodeTensor,ResizeTensor,CvtColorTensor,SyncTensor]",
        # "backend": "S[DecodeMat,ResizeMat,CvtColorMat,Mat2Tensor,SyncTensor]",
        'instance_num': 2,
        'color': 'rgb',
        'resize_h': '224',
        'resize_w': '224',
        'next': 'model',
    },
    "model": {
        "backend": "SyncTensor[TensorrtTensor]",
        "model": model_path,
        "model::cache": model_path.replace(".onnx", ".trt"),
        "max": '4',
        'batching_timeout': 4,  # ms, timeout for batching
        'instance_num': 2,
        'mean': "123.675, 116.28, 103.53",
        'std': "58.395, 57.120, 57.375",  # merged into trt
    }}
)

Execute

We can execute the returned thread_safe_pipe just like the original PyTorch model, but in a thread-safe manner.

data = {'data': open('/path/to/img.jpg', 'rb').read()}
thread_safe_pipe(data) # <-- this is thread-safe
result = data['result']

Installation

  • NGC Docker containers (recommended):

test on 25.05, 25.06, 24.05, 23.05

img_name=nvcr.io/nvidia/pytorch:25.05-py3

docker run --rm --gpus all -it --network host \
    -v $(pwd):/workspace/ --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 \
    -w /workspace/ \
    $img_name \
    bash

pip install torchpipe
python -c "import torchpipe"

The backends it introduces will be JIT-compiled and cached.

There are one core backend group(torchpipe_core) and three optional groups (torchpipe_opencv, torchpipe_nvjpeg, and torchpipe_tensorrt) with different dependencies. For details, see here.

Dependencies such as OpenCV and TensorRT can also be provided in the following ways:

  • providing environment variables:
    Users can specify paths via the following environment variables:
    OPENCV_INCLUDE, OPENCV_LIB, TENSORRT_INCLUDE, TENSORRT_LIB.

Other installation options

How does it work?

See Basic Usage.

How to add (or override) a backend

WIP

Metadata

Release files for omniback 0.2.24

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omniback 0.2.24
File Size Uploaded Provenance
omniback-0.2.24.tar.gz 1.2 MB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for omniback 0.2.24
File
omniback-0.2.24-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
omniback-0.2.24-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details
omniback-0.2.24-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
omniback-0.2.24-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details

Total release size: 16.4 MB

Release files / omniback-0.2.24.tar.gz

Download URL omniback-0.2.24.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
8e347cbec95ea69d833f0c25171df5bd3d51328da167af2ad2d230b6ce0bd44b
BLAKE2b-256 checksum
How to use checksums
c4abbfc58c506815629d13cad635c99f94ad2c6aef5609e967fbeb8c7ae5d851
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / omniback-0.2.24-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL omniback-0.2.24-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 4.1 MB
Tags Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
e945485d8ed1d3c945dda25d2a7d80d79501ab49e3ac088c50cc90cec94df6d9
BLAKE2b-256 checksum
How to use checksums
8990a589edac65ee6e52cb740584e8c9d35a6439ba73323c6cd0481c8a852795
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / omniback-0.2.24-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL omniback-0.2.24-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 3.8 MB
Tags Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
f38bc0f4efcddb4a0a695fcb7108d5b0389ebccc8bf083944714de31658f6c04
BLAKE2b-256 checksum
How to use checksums
d3b89c00fe950df24d36170afa4f064cbd7962ce1c7fcbf42d4911a0b6cfb2f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / omniback-0.2.24-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL omniback-0.2.24-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 3.8 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
78bc47d78482f7d499d41d08d808ebfc455c8e79dbe3753c9611add0072bb4fb
BLAKE2b-256 checksum
How to use checksums
5d989a1d020bec130e43a2c80dec47e086971e569ead50baf93461c3248fad6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / omniback-0.2.24-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL omniback-0.2.24-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 3.6 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
f91d76b2208676e66c4cb78f25a67c4cd58cd5fd7b1ae0f88c2343374be87522
BLAKE2b-256 checksum
How to use checksums
55e6912f3f5215be7175b6555eb28295b5ae11c6979bbf91ee6d595c8cd5dbd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for omniback 0.2.24

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page