Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CONTRIB] TFLite Runtime #4439

Merged
merged 21 commits into from
Dec 4, 2019
Merged

[CONTRIB] TFLite Runtime #4439

merged 21 commits into from
Dec 4, 2019

Conversation

ZihengJiang
Copy link
Contributor

@ZihengJiang ZihengJiang commented Nov 27, 2019

A runtime that can load and execute TFLite models via TVM calling convention, while compiled tflite library linked with tvm runtime. This enables us to do streamline baseline benchmarks of tflite over RPC:

# code snippet shows how to do inference via remote tvm tflite runtime
server = rpc.Server(remote_address)
remote = rpc.connect(server.host, server.port)
ctx = remote.cpu(0)

# create remote tflite runtime
tflite_model_bytes = open('model.tflite', 'rb').open()
runtime = tflite_runtime.create(tflite_model_bytes, ctx)
runtime.allocate_tensors()
runtime.set_input(0, tvm.nd.array(input_data, ctx)))
runtime.invoke()
out = runtime.get_output(0)

@tmoreau89 @tqchen

python/tvm/contrib/tflite_runtime.py Outdated Show resolved Hide resolved
python/tvm/contrib/tflite_runtime.py Outdated Show resolved Hide resolved
@tqchen
Copy link
Member

tqchen commented Nov 28, 2019

Please modify the description to add a bit about motivated usecase. e.g. streamline baseline benchmarks of tflite over RPC

@ZihengJiang ZihengJiang changed the title [WIP] TFLite Runtime TFLite Runtime Nov 28, 2019
cmake/config.cmake Outdated Show resolved Hide resolved
src/runtime/contrib/tflite/tflite_runtime.h Outdated Show resolved Hide resolved
src/runtime/contrib/tflite/tflite_runtime.h Outdated Show resolved Hide resolved
@tqchen tqchen changed the title TFLite Runtime [CONTRIB] TFLite Runtime Nov 28, 2019
Copy link
Contributor

@tmoreau89 tmoreau89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@FrozenGene
Copy link
Member

cc @jackwish maybe you are interested

tests/python/contrib/test_tflite_runtime.py Show resolved Hide resolved
python/tvm/contrib/tflite_runtime.py Outdated Show resolved Hide resolved
@tqchen tqchen merged commit 24713bd into apache:master Dec 4, 2019
@tqchen
Copy link
Member

tqchen commented Dec 4, 2019

Thanks @ZihengJiang @tmoreau89 !

@ZihengJiang ZihengJiang deleted the tflite branch December 4, 2019 18:16
zxy844288792 pushed a commit to zxy844288792/tvm that referenced this pull request Dec 13, 2019
zxy844288792 pushed a commit to neo-ai/tvm that referenced this pull request Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants