-
Notifications
You must be signed in to change notification settings - Fork 26
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
use tensorflow 2.8.0 and bazel 5.0.0 #268
Conversation
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
the error messages of failed to build iOS Flutter app provide a good example how how the
|
Are we going to completely drop support for older bazel versions? |
TensorFlow is somewhat bazel version sensitive. When a major bazel version is used by TensorFlow, it may break building with older bazel. |
There are two issues,
|
08ab532
to
1f6828b
Compare
I fixed the two issues. |
For samsung backend, matching performance numbers are seen using tensorflow 2.8.0 and bazel 5.0.0 |
This PR also closes #145 |
@freedomtan to rebase this to resolve conflicts. |
Update tensorflow to 2.8.0 and specify bazel version in `.bazelverion` so that if wrong bazel version is used and there is no right version in the system, bazel will show instructions
it doesn't work with bazel 5.0.0 on windows
use the script to cp the framework to a fixed place
d12ff5f
to
00cace8
Compare
I rebased the patch and added the memory leak patch for Core ML delegate. |
if sdk_home: | ||
sdk_rule = """ | ||
native.android_sdk_repository( | ||
name="androidsdk", | ||
path="{}", | ||
build_tools_version="30.0.3", | ||
) | ||
""".format(_escape_for_windows(sdk_home)) |
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.
Currently Android SDK is not needed for bazel builds in our repo.
Bazel builds only the .so
files which only require NDK.
SDK is required for APK build but that can be done on a separate machine.
I personally build Android libraries for the app in a Docker container or in WSL and I don't install Android SDK there.
But with this patch I get an error because SDK is missing.
I think it would be better to comment these lines or just disable the condition using something like if sdk_home and False
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.
sounds right. will do it.
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.
@d-uzlov are you sure that on windows this doesn't work? I added this to get around the Android SDK problem in bazel you mentioned on macOS. I met the Android SDK missing problem when I tried to build this on macOS. It should work on Windows also. I mean if $ANDROID_HOME
is not, sdk_home
should not be set.
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 are no issues building supported targets on Windows.
I don't have android-related environment variables defined on Windows, and bazel doesn't try to load them.
The issue is in the WSL virtual machine.
ANDROID_HOME
is defined there because some of the Android tools are installed, also NDK is installed there, but the there is no actual SDK because it's not needed.
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.
argh, got it, thanks. let me check how to handle this on Linux
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.
@d-uzlov Could elaborate more on why we need ANDROID_HOME
. I was able to build and run flutter app for Android devices on Ubuntu without ANDROID_HOME
set.
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.
We don't need it to build native libraries. And Android SDK is not required.
But if ANDROID_HOME
is defined for whatever reason then Android SDK becomes required, even though it's not used by bazel.
I don't think requiring users not to have ANDROID_HOME
is reasonable.
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.
Let's merge it and I remove unused dependencies in a separate PR.
To build with TensorFlow 2.9.x, we need
I'll create another branch for 2.9.x. |
A TensorFlow 2.9.1 branch based on this 2.8.0 one, https://github.com/mlcommons/mobile_app_open/tree/use_tensorflow_291. And comparing with 2.8.0, #334 |
App built with XCode 13.4 run all benchmarks successfully on iPhone XS. Great work @freedomtan 👍. |
Update tensorflow to 2.8.0 and specify bazel version in
.bazelverion
so that if wrong bazel version is used and thereis no right version in the system, bazel will show instructions.
We should make sure all the vendor backends get matching performance numbers (#231) before we upgrade TensorFlow
bazelbuild/bazel#145 bazelbuild/bazel#241