-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Description
Hi everyone!
I’d like to share an idea that might help others who are running into issues with the recent 16KB memory page policy.
I experimented with rebuilding libtensorflowlite.so for arm64-v8a devices so that it aligns with a 16KB memory page size.
If you’d like to try it out, you can replace the following files in your project with the rebuilt versions:
cpp/tf-lite-api/generated-libs/arm64-v8a/libtensorflowlite.solibtensorflowlite.zipcpp/tf-lite-api/tensorflow_src/tensorflow/tensorflow.zip
🔧 Build Details
- TensorFlow version: 2.12.0
I couldn’t determine the exact TensorFlow version used in the original project, so I explored compatibility withTFLiteEngineand found that 2.12.0 worked. - OS: Ubuntu 20.04
- Build tool: Bazel 5.3.0 (compatible with TF 2.12.0)
- NDK version: 21.4.7075529
- Build command:
$ bazel build -c opt \ --config=android_arm64 \ --linkopt='-Wl,-z,max-page-size=0x4000' \ //tensorflow/lite:libtensorflowlite.so - Build Result:
If you see0x4000in the alignment field, it means that the build successfully applied the 16KB memory page size:$ readelf -lW bazel-bin/tensorflow/lite/libtensorflowlite.so | grep LOAD LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x462ffc 0x462ffc R E 0x4000 LOAD 0x4632c8 0x00000000004672c8 0x00000000004672c8 0x00eb28 0x0160a8 RW 0x4000
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels