TensorFlow Lite and 16 KB Page Size Support

Issue:

We’re using libtensorflowlite_jni.so (from org.tensorflow:tensorflow-lite:2.17.0) in an Android project.

We’re targeting SDK 35+ on Android devices that require 16 KB page size. But when inspecting the .so using readelf, the memory segments are aligned to 4 KB (0x1000), not 16 KB (0x4000). As a result, we get the error: Only 4 KB page compatible.

Question:

  • Is there an officially supported build of libtensorflowlite_jni.so that supports 16 KB page size?
  • If not, is there a CMake or Bazel flag to compile TensorFlow Lite with 16 KB alignment for Android?

Info:

  • TensorFlow Lite version: 2.17.0
  • Target ABI: arm64-v8a
  • Min SDK: 23
  • NDK: r25+

What we tried:

  • Downloaded AAR from Maven Central
  • Used readelf -l libtensorflowlite_jni.so to check LOAD alignment