Skip to content

ai-edge-litert: Add version 2.2.0 - #2135

Merged
luhenry merged 2 commits into
mainfrom
ai-edge-litert
Sep 21, 2026
Merged

luhenry merged 2 commits into
mainfrom
ai-edge-litert

Conversation

@luhenry

@luhenry luhenry commented Sep 20, 2026

Copy link
Copy Markdown
Member

Bazel builds the TFLite interpreter, the LiteRT v2 C API (libLiteRt.so) and the pywrap extensions into one per-interpreter wheel. Upstream publishes no riscv64 wheel.

Mirrors upstream's linux_nightly_wheel.yml and ci/build_pip_package_with_bazel.sh.

Differs from upstream

  • bazel 7.5.0 bootstrapped from source instead of upstream's .bazelversion 7.7.0 - no riscv64 release binary exists for either, and 7.7.0 cannot be bootstrapped at all: it is the first 7.x whose MODULE.bazel bumps apple_support to 1.23.1 and so pulls in bazel_features, whose generated globals.bzl re-exports bazel 8's macro(). LiteRT has no MODULE.bazel, builds with --noenable_bzlmod and no versions.check, and the bootstrapped binary is installed directly rather than through bazelisk, so nothing reads .bazelversion
  • TF_NEED_CLANG=0 - the image ships GCC 14, not upstream's clang 18
  • no --config=release_cpu_linux - it is -mavx, x86-only
  • --define=xnn_enable_riscv_fp16_vector=false - binutils 2.41 rejects zvfh
  • HERMETIC_REQUIREMENTS_LOCK pins numpy to our index - the TF lock's numpy has no riscv64 wheel
  • only the wheel target - the vendor-SDK sdists target NPUs riscv64 has none of
  • the prebuilt WebGPU accelerator is absent, as upstream's select already allows; it is dlopened, so the runtime falls back to CPU

Matrix: cp311-cp314; cp310 is dropped because ml_dtypes ships no riscv64 wheel for it.

Testing

  • upstream only imports the package; this also runs an l2-normalization model through both the TFLite Interpreter and the LiteRT v2 CompiledModel, checked against 1/sqrt(768)

License: OK

Patches

  • 0001-ci-map-linux-riscv64-to-a-manylinux-wheel-platform-t.patch - Submitted [https://github.com/google-ai-edge/LiteRT]. Without it get_wheel_platform_name() falls through to the literal none, so the wheel is named ...-cp312-cp312-none.whl. Affects any platform upstream has not listed, not just riscv64.

LiteRT's wheel is the TFLite runtime plus the LiteRT v2 C API, built by
bazel from //ci/tools/python/wheel:litert_wheel, mirroring upstream's
linux_nightly_wheel.yml and ci/build_pip_package_with_bazel.sh narrowed to
riscv64.
luhenry added a commit that referenced this pull request Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-21 07:49 UTC

Upstream's .bazelversion pins 7.7.0, but that version cannot be bootstrapped
from source on riscv64: its MODULE.bazel bumps apple_support to 1.23.1, which
adds a bazel_features dependency, and bazel_features' globals_repo treats the
empty native.bazel_version of the scratch bootstrap binary as a dev build newer
than everything, so the globals.bzl it generates re-exports bazel 8's macro()
and //src:bazel_nojdk fails analysis with "name 'macro' is not defined".

bazel 7.5.0's module graph has no bazel_features at all and pins the same
rules_python 0.33.2 and rules_java 7.6.5, so the bootstrap recipe is unchanged;
it is also what every other bazel port in this repo bootstraps. Nothing gates
the version on the LiteRT side: it has no MODULE.bazel, builds with
--noenable_bzlmod and no versions.check, and the bootstrapped binary is
installed directly rather than through bazelisk, so .bazelversion is never read.
@luhenry
luhenry marked this pull request as ready for review September 21, 2026 00:35
@luhenry
luhenry merged commit a1ab30c into main Sep 21, 2026
13 checks passed
@luhenry
luhenry deleted the ai-edge-litert branch September 21, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant