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

Optional xnnpack feature relies on weak symbols which are unavailable on Windows #59913

Open
georgthegreat opened this issue Mar 6, 2023 · 3 comments
Assignees
Labels
comp:lite TF Lite related issues comp:lite-xnnpack TensorFlow Lite XNNPack related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.4 for issues related to TF 2.4 type:feature Feature requests

Comments

@georgthegreat
Copy link
Contributor

georgthegreat commented Mar 6, 2023

Issue Type

Build/Install

Have you reproduced the bug with TF nightly?

Yes

Tensorflow Version

2.4

Current Behaviour?

At the time tflite comes with optional xnnpack feature which relies on TFLITE_ATTRIBUTE_WEAK attribute applied to a delegate function.

As there are no weak symbols on Windows, this feature can not be used universally (i. e. independent from target platform).

I suggest switching this feature on / off in configure time (when build with CMake) or via explicit choosing of option (when build with Bazel). This will force every client to explicitly add a dependency on either xnnpack_enabled or xnnpack_disabled library, just in the same way as with other delegates (i. e. nnapi).

What do you think?

@google-ml-butler google-ml-butler bot added the type:build/install Build and install issues label Mar 6, 2023
@tilakrayal tilakrayal added comp:lite TF Lite related issues TF 2.4 for issues related to TF 2.4 comp:lite-xnnpack TensorFlow Lite XNNPack related issues type:feature Feature requests and removed type:build/install Build and install issues labels Mar 7, 2023
@tilakrayal
Copy link
Contributor

@georgthegreat,
Could you please elaborate about your Feature. Also, please specify the Use Cases for this feature. Thank you!

@tilakrayal tilakrayal added the stat:awaiting response Status - Awaiting response from author label Mar 7, 2023
@georgthegreat
Copy link
Contributor Author

We operate a monorepo with single tflite configuration available to the end users (similar to Piper / build system is similar to Bazel).
Certain users would like to use tflite without xnnpack delegate, while other would like to continue using it.
At the time switching xnnpack on and off is available by the means of weak linker symbol which might be overrided during link time.

As weak symbols are not supported on Windows, we can not use current approach in cross-platform software.
I have managed to implement the xnnpack switch by forcing every user of tflite to add explicit dependency on either delegates/xnnpack or (added by myself) delegates/xnnpack_disabled.

I would like to upstream this feature, but I would like to get OK from Google in advance.

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Status - Awaiting response from author label Mar 7, 2023
@sachinprasadhs sachinprasadhs added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Mar 14, 2023
@sirakiin sirakiin assigned alankelly and unassigned sirakiin Mar 15, 2023
@georgthegreat
Copy link
Contributor Author

@alankelly, could you, please, take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:lite TF Lite related issues comp:lite-xnnpack TensorFlow Lite XNNPack related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.4 for issues related to TF 2.4 type:feature Feature requests
Projects
None yet
Development

No branches or pull requests

5 participants