Skip to main content

Common runtime for machine learning models compiled by AWS SageMaker Neo, TVM, or TreeLite.

Project description

DLR

DLR is a compact, common runtime for deep learning models and decision tree models compiled by AWS SageMaker Neo, TVM, or Treelite. DLR uses the TVM runtime, Treelite runtime, NVIDIA TensorRT™, and can include other hardware-specific runtimes. DLR provides unified Python/C++ APIs for loading and running compiled models on various devices. DLR currently supports platforms from Intel, NVIDIA, and ARM, with support for Xilinx, Cadence, and Qualcomm coming soon.

Installation

On x86_64 CPU targets running Linux, you can install latest release of DLR package via

pip install dlr

For installation of DLR on GPU targets, non-x86 edge devices, or building DLR from source, please refer to Installing DLR

Usage

import dlr
import numpy as np

# Load model.
# /path/to/model is a directory containing the compiled model artifacts (.so, .params, .json)
model = dlr.DLRModel('/path/to/model', 'cpu', 0)

# Prepare some input data.
x = np.random.rand(1, 3, 224, 224)

# Run inference.
y = model.run(x)

Release compatibility with different versions of TVM

Each release of DLR is capable of executing models compiled with the same corresponding release of neo-ai/tvm. For example, if you used the release-1.2.0 branch of neo-ai/tvm to compile your model, then you should use the release-1.2.0 branch of neo-ai/neo-ai-dlr to execute the compiled model. Please see DLR Releases for more information.

Documentation

For instructions on using DLR, please refer to Amazon SageMaker Neo – Train Your Machine Learning Models Once, Run Them Anywhere

Also check out the API documentation

Examples

We prepared several examples demonstrating how to use DLR API on different platforms

License

This library is licensed under the Apache License Version 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

dlr-1.3.0-py2.py3-none-manylinux1_x86_64.whl (866.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page