Repository navigation
feat: add LiteRT runtime - #17
Open
leeclemnet wants to merge 2 commits into
Open
leeclemnet wants to merge 2 commits into
leeclemnet wants to merge 2 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
leeclemnet
force-pushed
the
feat/cpu-runtimes
branch
from
September 29, 2026 20:41
29dfcf5 to
d955761
Compare
leeclemnet
force-pushed
the
feat/litert-runtime
branch
from
September 29, 2026 20:42
8a6a616 to
3ae9978
Compare
leeclemnet
force-pushed
the
feat/cpu-runtimes
branch
from
September 29, 2026 21:30
d955761 to
2fd7dbd
Compare
leeclemnet
force-pushed
the
feat/litert-runtime
branch
from
September 29, 2026 21:30
3ae9978 to
f50c15b
Compare
leeclemnet
force-pushed
the
feat/cpu-runtimes
branch
from
September 30, 2026 16:34
2fd7dbd to
65ed1a7
Compare
leeclemnet
force-pushed
the
feat/litert-runtime
branch
from
September 30, 2026 16:34
f50c15b to
20d870c
Compare
leeclemnet
force-pushed
the
feat/cpu-runtimes
branch
from
September 30, 2026 16:53
65ed1a7 to
b40aaf6
Compare
leeclemnet
force-pushed
the
feat/litert-runtime
branch
from
September 30, 2026 16:53
20d870c to
46a3295
Compare
Add LiteRTRuntime on the Runtime contract. It runs .tflite files from both the litert and the tflite exporters with the LiteRT interpreter, and times only Interpreter.invoke(). sab/runtimes/convert.py converts the canonical NCHW float input to the artifact layout and dtype (NHWC, int8 with the artifact's scale and zero-point) before the timed call, and dequantizes outputs after it. No script rows use the runtime yet: LiteRT cannot read ONNX, and the exported .tflite artifacts are not in the bucket. The tests use two tiny .tflite fixtures in tests/data/litert. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…shape Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leeclemnet
force-pushed
the
feat/cpu-runtimes
branch
from
September 30, 2026 19:35
b40aaf6 to
fd3ea3e
Compare
leeclemnet
force-pushed
the
feat/litert-runtime
branch
from
September 30, 2026 19:35
46a3295 to
8d3549e
Compare
leeclemnet
marked this pull request as ready for review
September 30, 2026 19:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
LiteRT runtime
What it does: Adds
LiteRTRuntimeon theRuntimecontract. It runs.tflitefiles from both thelitertand thetfliteexporters, and times onlyInterpreter.invoke(). No script rows use it yet.Why: LiteRT cannot read ONNX, and the exported
.tfliteartifacts are not in the bucket yet. This PR lands the runtime, so the rows are only a config change when the artifacts exist. Stacked on #16.Change map
sab/runtimes/litert.py) —num_threads=os.cpu_count().sab/runtimes/convert.py,tests/test_convert.py) — the canonical NCHW float input becomes the artifact layout and dtype (NHWC, int8 with the artifact's scale and zero-point) before the timed call. Outputs are dequantized after it.tests/test_litert.py,tests/data/litert/) — two tiny.tflitefixtures (float32 and int8, NHWC), checked against a numerical reference.generate.pyrebuilds them (needs TensorFlow).pyproject.toml,uv.lock,.github/workflows/tests.yml,README.md) — extralitert(ai-edge-litert). It is not innvidia, because the NVIDIA host runs no LiteRT rows. CI installs it.Behavior changes
Watch out for
sab/runtimes/convert.py:49— int8 inputs are quantized with round-to-nearest and clipped to the dtype range. A different rounding in the exporter moves int8 accuracy a little.sab/runtimes/litert.py:35— the thread count is fixed to all CPUs. On the Pi 5 that is 4 threads, the same as the ORT CPU rows.Related Issue(s): n/a
Type of Change
Testing
CPU: LiteRT on an Apple M4 Max (on battery). The artifacts are the official exports in
gs://rfdetr/export-2026-09-30:litertcomes from thelitertexporter, andtflitefrom thetfliteexporter. ORT reads the.onnxof the same export. This branch has no macOS throttle monitor, so no row has a throttle verdict.rfdetr-nanorfdetr-smallrfdetr-mediumrfdetr-largerfdetr-xlargerfdetr-2xlargetfliteartifacts run 1.3–2.7× faster than thelitertartifacts. fp16 gives almost no speedup on this CPU. Onlytflitelarge fp16 is faster than fp32, by 8%.Checklist
Additional Context
🤖 Generated with Claude Code