bindings of sonos/tract rust NN inference enging for python
Project description
tract-python
Tract inference engine bindings in Python via FFI.
Why
Tract Cli is very feature-full but reloading a model each time you wish to do an inference is computationaly costy and slow.
Install
Install using pip:
pip install tract_python
Usage
import tract_python
tract_model = tract_python.TractModel.load_plan_from_nnef_dir(
'./test_simple_nnef/'
)
results = tm.run(input_0=np.arange(6).reshape(1, 2, 3).astype(np.float32))
print(results)
#{'output_0': array([[[ 0., 2., 4.],
# [ 6., 8., 10.]]], dtype=float32)}
Status
This project is in alpha state.
Scope
My personnal usecase is to be able to run benchmarks (+10M inferences) with 'tract' engine.
Ideally I would like to support most of the tract-cli
features:
- load NNEF dir and .tgz
- run simple plan
- load all supported formats: ONNX, TF, from HTTP
- expose computations of model informations:
- number of parameters
- size on disk
- profiling infos
That said I do not have the bandwith to do it up-front. I welcome any contributor that would wish to add more features.
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 Distribution
tract_python-0.2.1.tar.gz
(8.0 kB
view hashes)
Built Distribution
Close
Hashes for tract_python-0.2.1-py3-none-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7725bc9615449c79c10602061f333e7bcb99fb44e36c22104c93a9b591e22efd |
|
MD5 | a9eb87ed375ae10d0a0c9f3bcbc021e5 |
|
BLAKE2b-256 | d48af836238026f74832baa8a2ea34d3e11232a4c68b702cdb1638c69556f2f9 |