Metadata-Version: 2.4
Name: torq-runtime
Version: 2.2.1
Summary: Torq runtime python bindings
Home-page: https://github.com/synaptics-torq/torq-compiler
Author: synaptics-astra
Author-email: zSvcastrateam@synaptics.com
License: Apache-2.0 WITH LLVM-exception
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: numpy>2.0.0b1
Requires-Dist: PyYAML>=5.4.1
Requires-Dist: ml-dtypes>=0.4.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Synaptics Torq Runtime

The `torq-runtime` Python package provides bindings for loading and running compiled `.vmfb` models on a Torq device directly from Python. It bundles the Torq runtime alongside the IREE runtime Python bindings into a single wheel with both namespaces, together with the `torq-run-module` and IREE CLI tools.

## Installation

```bash
pip install torq-runtime
```

## Quick Start

#### Inference from Python:

```python
import numpy as np
from torq.runtime import VMFBInferenceRunner

# Load the compiled model
runner = VMFBInferenceRunner("mobilenetv2.vmfb", device_uri="torq")

# Prepare input data
input_data = np.random.randint(0, 255, size=(1, 224, 224, 3), dtype=np.int8)

# Run inference
outputs = runner.infer([input_data])
print(f"Inference took {runner.infer_time_ms:.2f} ms")
```

#### Inference via CLI

```bash
torq-run-module --module="mobilenetv2.vmfb" --device="torq" --input=1x224x224x3xsi8
```

## Documentation

The full API reference and usage examples are available in the [Torq Runtime user guide](https://synaptics-torq.github.io/torq-compiler/v/latest/user-manual/torq_runtime.html).
