-
Notifications
You must be signed in to change notification settings - Fork 35
Auto-generate the TFLite Python schema. #546
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
Conversation
d5ca3ab
to
e3264f0
Compare
d590d57
to
15248ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, having to checkin this file has annoyed me for quite a while!
The @org_tensorflow//tensorflow/lite/python:schema_py
used to generate broken imports, glad that this has been fixed in the latest version now.
Do we need to add python/tflite_schema.py
to .gitignore
or is it only included in the bazel
exec_dir?
Does this work correctly when building the pip
packages? I think it should, but not 100% sure.
I don't think this should be necessary, it's only in the bazel outputs.
Yes I agree we need to check that. Once CI passes here I'm going to trigger a nightly release build and see what happens. |
Good and bad news:
|
Sounds good, thanks for testing! Maybe ac3afd2#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34R158 broke the build or we need an newer Docker image. In any case let's merge, I can take a look at the failure next week. TF or TFA might run into a similar issue so we can take a lot at their build config. |
What do these changes do?
This PR uses a Bazel genrule to generate the Python TFLite schema file and copy it into the correct place during compilation, which means we can remove the checked-in file.
I'm not 100% sure it works because the end2end test takes ages to compile on my local machine, but running
bazel build -c opt //larq_compute_engine/mlir:tflite_schema_py
locally does generate the correct file asbazel-bin/larq_compute_engine/mlir/python/tflite_schema.py
, so hopefully it works! Let's see what CI thinks.This is a draft, and is based on #545.How Has This Been Tested?
CI.
Benchmark Results
N/A.
Related issue number
N/A.