mlboydaisuke commited on
Commit
2ba4d08
·
verified ·
1 Parent(s): fdd8cc9

Update the model card and manifest notes: sentences corrected to the measurement records, Swift sample link

Browse files
Files changed (3) hide show
  1. MEASUREMENTS.md +3 -3
  2. README.md +11 -11
  3. litertlm_manifest.json +10 -10
MEASUREMENTS.md CHANGED
@@ -7,8 +7,8 @@ The model card ([README.md](README.md)) quotes the results. This page has how th
7
  - **This file:** `model.litertlm`, sha256 `1d36c24cd4e8380cf1655ba5d873f36575552e00e4e2a44312b6034a5573a182`, 1,615,527,936 B. **Previous file:** the same name at Hub commit `866529dff55f88adddf792ededa91d291f0c3692`, sha256 `acc9a204d4c75ce4a586767421e446df7d9dc00e00115ac79714cbbe654a10c5`, 1,613,250,560 B.
8
  - The previous file has prefill signatures of 128 and 512 tokens only; this file also has `prefill_1024`.
9
  - **Phones:** Samsung Galaxy S26 (SM-S942Q, SM8850, Adreno 840 GPU, Android 16); Google Pixel 11 Pro (PowerVR GPU, Android 17).
10
- - **Program:** `litert_lm_advanced_main` built for Android arm64 from LiteRT-LM v0.19.0 source (commit `771b06e1`), sha256 `2e0b50979206be39f00d676ec1363546fdfe6ae95eec5d4dff074617448b7937`.
11
- - **Command:** `litert_lm_advanced_main --backend=<gpu|cpu> --model_path=<file> --max_num_tokens=2048 --max_output_tokens=2048 --async=false --benchmark --benchmark_prefill_tokens=1024 --benchmark_decode_tokens=256 --num_iterations=3 --use_session=false --input_prompt_file=<text file>`. No `--sampler_backend`; the CPU uses the runtime's default thread count. The benchmark prompt is text; the vision encoder does not run.
12
  - **Timing runs:** each is a new process. Before it, the runtime's cache files next to the model are deleted. A GPU timing run starts when the phone reports thermal status 0 (Android's thermal status: 0 = none, 1 = light, 2 = moderate), no CPU clock cap and GPU thermal level 0 (the GPU driver's thermal power level, `thermal_pwrlevel` of the phone's `kgsl` GPU driver: 0 = no limit, and each step above 0 lowers the highest clock the GPU may use by one level); the CPU runs are described in their section.
13
  - **Questions and photo:** each is a new process with `--max_output_tokens=256 --benchmark_prefill_tokens=0 --benchmark_decode_tokens=0`, `--max_num_tokens=1024` for a question and `2048` for the photo, and the question as the prompt file; the photo question's prompt file names the photo (`[image:<path>] Describe this picture in one sentence.`). A run starts without waiting for the phone to cool and keeps the runtime's cache files that an earlier run of the same file wrote.
14
  - **When they ran:** the questions and the photo ran after the timing runs. On the Galaxy S26 the 10 runs (8 questions and the photo with the vision encoder on the GPU and on the CPU, this file only) started at thermal status 2; 3 of them had a CPU clock cap (the CPU clock domain policy6, `/sys/devices/system/cpu/cpufreq/policy6`, at 3.65–4.65 of its 4.74 GHz; the first also policy0 at 3.30 of its 3.63 GHz and GPU thermal level 1). On the Pixel 11 Pro every run started at thermal status 1 (2026-11-14); 15 of the 18 runs had a CPU limit (policy6 at 3.57–4.01 of its 4.11 GHz in 11 of them, the phone's thermal utilization clamps in 11, both in 7; the utilization clamps are the cooling devices named `thermal-uclamp-*` in the phone's thermal service, a CPU limit other than the clock cap).
@@ -33,7 +33,7 @@ With this file and the vision encoder on the GPU (`--vision_backend=gpu`), the p
33
 
34
  ### Galaxy S26 CPU (XNNPACK)
35
 
36
- The phone has two CPU clock domains, policy0 and policy6 (`/sys/devices/system/cpu/cpufreq/`), whose highest clocks are 3.63 and 4.74 GHz. Early in a CPU run the phone lowers the clock cap of both (`scaling_max_freq`, read every 2–3 s during the run). The cap of policy6 is lower 2 s in (runs 1, 2 and 4) or 3 s in (run 3), that of policy0 4–6 s in. Both reach 1.56 / 1.50 GHz 20–22 s in and stay there to the end of the run (the runs took 72–73 s). The clock itself (`scaling_cur_freq`, read at the same times) matched the cap from 4–6 s in until the benchmark ended, so iterations 2 and 3 run at a lower clock than iteration 1. All four runs started at thermal status 1 with no CPU clock cap, after 152–153 s of rest (2026-11-15), reached thermal status 2 11–23 s in and stayed there until they ended. Before run 1, one warm-up run of this file was not counted (prefill / decode 191.01 / 18.30, 103.68 / 15.62 and 103.46 / 15.84 tok/s in its three iterations); its caps came down the same way (1.56 / 1.50 GHz at 20 s). The lowest cap seen in each counted run is beside it.
37
 
38
  | Run | File | Iteration 1 | Iteration 2 | Iteration 3 | Lowest cap (policy0 / policy6) |
39
  |---|---|---|---|---|---|
 
7
  - **This file:** `model.litertlm`, sha256 `1d36c24cd4e8380cf1655ba5d873f36575552e00e4e2a44312b6034a5573a182`, 1,615,527,936 B. **Previous file:** the same name at Hub commit `866529dff55f88adddf792ededa91d291f0c3692`, sha256 `acc9a204d4c75ce4a586767421e446df7d9dc00e00115ac79714cbbe654a10c5`, 1,613,250,560 B.
8
  - The previous file has prefill signatures of 128 and 512 tokens only; this file also has `prefill_1024`.
9
  - **Phones:** Samsung Galaxy S26 (SM-S942Q, SM8850, Adreno 840 GPU, Android 16); Google Pixel 11 Pro (PowerVR GPU, Android 17).
10
+ - **Program:** `litert_lm_advanced_main` built for Android arm64 from LiteRT-LM v0.19.0 source (commit `771b06e1`; the v0.19.0 tag is on the next commit, which changes only `Package.swift` and `README.md`), sha256 `2e0b50979206be39f00d676ec1363546fdfe6ae95eec5d4dff074617448b7937`.
11
+ - **Command:** `litert_lm_advanced_main --backend=<gpu|cpu> --model_path=<file> --max_num_tokens=2048 --max_output_tokens=2048 --async=false --benchmark --benchmark_prefill_tokens=1024 --benchmark_decode_tokens=256 --num_iterations=3 --use_session=false --input_prompt_file=<text file>`. No `--sampler_backend`; the CPU uses the runtime's default thread count. The prompt file is one sentence, "Explain what on-device AI means in simple terms."; in benchmark mode the runtime puts it in the chat template as a user message and pads the tokens with token id 0 to the 1,024 prefill tokens (`ids.resize` in `runtime/core/session_utils.cc` of v0.19.0). The vision encoder does not run.
12
  - **Timing runs:** each is a new process. Before it, the runtime's cache files next to the model are deleted. A GPU timing run starts when the phone reports thermal status 0 (Android's thermal status: 0 = none, 1 = light, 2 = moderate), no CPU clock cap and GPU thermal level 0 (the GPU driver's thermal power level, `thermal_pwrlevel` of the phone's `kgsl` GPU driver: 0 = no limit, and each step above 0 lowers the highest clock the GPU may use by one level); the CPU runs are described in their section.
13
  - **Questions and photo:** each is a new process with `--max_output_tokens=256 --benchmark_prefill_tokens=0 --benchmark_decode_tokens=0`, `--max_num_tokens=1024` for a question and `2048` for the photo, and the question as the prompt file; the photo question's prompt file names the photo (`[image:<path>] Describe this picture in one sentence.`). A run starts without waiting for the phone to cool and keeps the runtime's cache files that an earlier run of the same file wrote.
14
  - **When they ran:** the questions and the photo ran after the timing runs. On the Galaxy S26 the 10 runs (8 questions and the photo with the vision encoder on the GPU and on the CPU, this file only) started at thermal status 2; 3 of them had a CPU clock cap (the CPU clock domain policy6, `/sys/devices/system/cpu/cpufreq/policy6`, at 3.65–4.65 of its 4.74 GHz; the first also policy0 at 3.30 of its 3.63 GHz and GPU thermal level 1). On the Pixel 11 Pro every run started at thermal status 1 (2026-11-14); 15 of the 18 runs had a CPU limit (policy6 at 3.57–4.01 of its 4.11 GHz in 11 of them, the phone's thermal utilization clamps in 11, both in 7; the utilization clamps are the cooling devices named `thermal-uclamp-*` in the phone's thermal service, a CPU limit other than the clock cap).
 
33
 
34
  ### Galaxy S26 CPU (XNNPACK)
35
 
36
+ The phone has two CPU clock domains, policy0 and policy6 (`/sys/devices/system/cpu/cpufreq/`), whose highest clocks are 3.63 and 4.74 GHz. Early in a CPU run the phone lowers the clock cap of both (`scaling_max_freq`, read every 2–3 s during the run). The cap of policy6 is lower 2 s in (runs 1, 2 and 4) or 3 s in (run 3), that of policy0 4–6 s in. Both reach 1.56 / 1.50 GHz 20–22 s in and stay there to the end of the run (the runs took 72–73 s). The clock itself (`scaling_cur_freq`, read at the same times) matched the cap from 4–6 s in until the benchmark ended, so iterations 2 and 3 run at a lower clock than iteration 1. All four runs started at thermal status 1 with no CPU clock cap, after 152–153 s of rest (2026-11-15), were at thermal status 2 by 11–23 s in (the status is read about every 11 s) and stayed there until they ended. Before run 1, one warm-up run of this file was not counted (prefill / decode 191.01 / 18.30, 103.68 / 15.62 and 103.46 / 15.84 tok/s in its three iterations); its caps came down the same way (1.56 / 1.50 GHz at 20 s). The lowest cap seen in each counted run is beside it.
37
 
38
  | Run | File | Iteration 1 | Iteration 2 | Iteration 3 | Lowest cap (policy0 / policy6) |
39
  |---|---|---|---|---|---|
README.md CHANGED
@@ -19,8 +19,8 @@ base_model_relation: quantized
19
 
20
  [OpenGVLab/InternVL3_5-2B](https://huggingface.co/OpenGVLab/InternVL3_5-2B) converted to the
21
  **LiteRT-LM** (`.litertlm`) format for **on-device image+text** inference with Google's
22
- [LiteRT-LM](https://github.com/google-ai-edge/litert-lm) runtime (the engine behind the official
23
- `litert-community/*` models, and the same runtime that runs `litert-community/FastVLM-0.5B`). On 2026-11-15 `model.litertlm` was replaced with a file whose prefill/decode graph is rewritten for the GPU, with every weight unchanged. Outside the dated entries under Conversion notes, "this file" means that file and "the previous file" the one it replaced. On a Galaxy S26 GPU this file decodes 40.2 tokens/s and reads a 1,024-token text prompt at 537 tokens/s (LiteRT-LM v0.19.0).
24
 
25
  InternVL3.5-2B is a compact **vision-language model**: an **InternViT** vision encoder + pixel-shuffle +
26
  MLP projector feeding a **Qwen3-1.7B** language decoder (the newer Qwen3 backbone is what distinguishes
@@ -61,7 +61,7 @@ Two tabby cats are sleeping on a pink couch next to two remote controls.
61
 
62
  This answer came from litert-lm 0.19.2 on a Mac (2026-11-15), with the file given by its path (the copy that was uploaded to this repo, with the same sha256). Two runs of this file with the flags above gave this answer and "Two tabby cats are sleeping on a pink couch next to two remotes."; one run of the previous file (downloaded from this repo and given by its path) gave "Two tabby cats are sleeping on a pink couch next to remote controls." A third run of this file, with the command exactly as above (it downloaded the file from this repo), gave that last sentence too. With `--backend cpu --vision-backend cpu --cpu-thread-count 1 --cache no --max-num-tokens 2048` added, litert-lm 0.19.0, 0.19.1 and 0.19.2 gave the answer above with both files (2026-11-14).
63
 
64
- Leave `--vision-backend` unset, as above (the CLI then uses the bundle's own setting). With `--backend gpu` added and `--vision-backend` still unset, this file answers the picture (on a Mac with litert-lm 0.19.2: "Two tabby cats are sleeping on a pink couch, with remote controls placed beside them."). With `--backend gpu --vision-backend gpu`, neither this file nor the previous file answers a picture on a Mac (litert-lm 0.19.0 to 0.19.2; the reply is `An error occurred`); with litert-lm 0.19.2 the error log names two op types of the vision encoder that the GPU delegate does not take, BROADCAST_TO and GATHER_ND, and the runtime does not run the encoder split between the GPU and the CPU. On a Galaxy S26 and a Pixel 11 Pro (LiteRT-LM v0.19.0), `litert_lm_advanced_main` with the vision encoder on the GPU stops too (see the Galaxy S26 section).
65
 
66
  If `run` stops right after the download with no error message from the CLI (a bus error; exit status 138 on a Mac) or with an error log that contains `too large for file size`, the downloaded file may be incomplete. The litert-lm CLI (0.14.0 to 0.19.2, and litert-lm-nightly 0.20.0.dev20261112) can keep an incomplete download in `~/.litert-lm/cache/huggingface/litert-community/InternVL3_5-2B/` and uses it again on later runs without checking its size. Delete that file and run the command again.
67
 
@@ -92,7 +92,7 @@ through a forested valley").
92
 
93
  ## Galaxy S26 — GPU and CPU
94
 
95
- Each run reads a 1,024-token text prompt and generates 256 tokens, three times (three iterations); iteration 1 is the first pass after the engine starts. The GPU row is the median of iterations 2–3 over two runs, so it leaves iteration 1 out; on the GPU, iteration 1 read the prompt faster and decoded more slowly than iterations 2 and 3 (this file's iteration 1: prefill 580–591 tok/s, decode 39.0–39.3 tok/s). On the CPU the median prefill and decode speeds drop after iteration 1, so each iteration has its own row: the median of that iteration over two runs.
96
 
97
  | Backend | Prefill, 1,024 tokens | Decode | Time to first token | Peak memory |
98
  |---|---:|---:|---:|---:|
@@ -101,17 +101,17 @@ Each run reads a 1,024-token text prompt and generates 256 tokens, three times (
101
  | CPU (XNNPACK for most nodes), iteration 2 | 104 tok/s | 16.0 tok/s | 9.93 s | 2.34 GB |
102
  | CPU (XNNPACK for most nodes), iteration 3 | 104 tok/s | 16.0 tok/s | 9.94 s | 2.34 GB |
103
 
104
- Samsung Galaxy S26 (SM-S942Q / SM8850, Android 16), `litert_lm_advanced_main` built from LiteRT-LM v0.19.0 (commit `771b06e1`), `--benchmark` with a 1,024-token text prefill and 256 decode tokens, context 2,048, 2026-11-15. Each run is a new process. The rows cover the text path. The GPU runs started at Android's thermal status 0 (none) and each ended at thermal status 1 or 2 (light or moderate), with the GPU's highest allowed clock one or two steps down; in every GPU run the prefill slowed from one iteration to the next. The CPU runs started at thermal status 1 and reached thermal status 2 (moderate) 11–23 s in, where they stayed until they ended.
105
 
106
  In each of the four counted CPU runs (two per file, after one warm-up run that is not counted), the phone lowers the clock caps of its two CPU clock domains from 2–6 s in, to 1.56 / 1.50 GHz by 20–22 s in. Iteration 1 runs while the caps come down, iterations 2 and 3 at the lowered caps.
107
 
108
- Peak memory is per run, so the three CPU rows share one value. It is the process's `VmHWM`: on the CPU 2.33–2.34 GB in this file's two counted runs (2.36 GB in the warm-up run) and 2.16 GB in each of the previous file's two. `VmHWM` does not count memory the GPU driver holds, so the GPU cell adds the rise of the phone's GPU allocation counter (`kgsl_page_alloc`) during each of this file's GPU runs (2.47 GB; 1.85 GB in each of the previous file's). In the CPU runs that counter rose by less than 1 MB (0.44 MB in one of the five runs, not at all in the other four).
109
 
110
  With the vision encoder on the GPU (`--vision_backend=gpu`), `litert_lm_advanced_main` stops with exit status 13 before it reads the picture: with this file on this phone, and with this file and the previous one on a Pixel 11 Pro. Its log names two op types of the encoder that the GPU delegate does not take, BROADCAST_TO and GATHER_ND (on this phone, 13 of the encoder's 1,320 nodes). With the vision encoder on the CPU (`--vision_backend=cpu`) and the decoder on the GPU, this phone answered "Describe this picture in one sentence." about the photo under How to use with "Two tabby cats are sleeping on a pink couch, with remote controls placed beside them." (one run).
111
 
112
  On the GPU this file decodes about 37 % faster than the previous file. Four runs went previous, this, this, previous (each run's mean of iterations 2–3): prefill 558, 537, 542 and 539 tok/s, decode 29.4, 40.2, 40.3 and 29.4 tok/s; from the previous file to this one, decode ×1.366 and prefill ×0.962 in the first two runs, decode ×1.371 and prefill ×1.005 in the last two, while the previous file's own two runs differ by 3.6 % in prefill. On the CPU, this file's medians in iteration 1 were 1.6 % below the previous file's in prefill and 2.6 % above in decode, and in iterations 2 and 3 between 0.3 % and 0.9 % above; two counted runs of the same file differed by up to 1.6 %. The runs behind each number, and the S26 section this card carried for an earlier file: [MEASUREMENTS.md](MEASUREMENTS.md).
113
 
114
- On the Galaxy S26 the GPU decodes 2.1× as fast as the CPU's iteration 1 and 2.5× as fast as its iterations 2 and 3, and reads the prompt 2.5× and 5.2× as fast, so this repo's `litertlm_manifest.json` recommends `gpu` for flagship-class Android. That recommendation rests on the Galaxy S26 alone.
115
 
116
  GPU wiring, including the Gallery import toggle: [GPU guide](https://github.com/john-rocky/hf-to-litertlm/blob/main/docs/android-gpu.md).
117
 
@@ -129,8 +129,8 @@ issue**: on the **CPU backend, multi-image works**. The same GPU truncation repr
129
 
130
  ## Run on iPhone / macOS
131
 
132
- Use the LiteRT-LM Swift runtime ([swift-litert-lm](https://github.com/google-ai-edge/litert-lm) /
133
- the `LiteRTDemo` sample). Load `model.litertlm` with the **image (vision) tower enabled**
134
  (modalities `[.vision]`), attach a photo, and ask a question.
135
 
136
  > Note for app integrators: this is a **vision-only** bundle (no audio tower). Bring up the engine with
@@ -169,9 +169,9 @@ The bundle's `LlmMetadata start_token` held the literal string `"None"`. This to
169
 
170
  ### 2026-08-30 — tokenizer section replaced (weights unchanged)
171
 
172
- The tokenizer in `model.litertlm` was a SentencePiece conversion of the model's BPE tokenizer, and the conversion lost the byte-level semantics: a standalone accented letter or symbol (`é`, `ñ`, `ü`, `°`, `·`, …) was encoded to the id of a single-byte token instead of the token the upstream tokenizer uses, and any character without a whole-character vocabulary entry (emoji, most of Latin Extended-A) became the token the conversion had reused as UNK — the end-of-text token for this vocabulary. `model.litertlm` now embeds the upstream `tokenizer.json` (the same HF tokenizer path most bundles in this collection use).
173
 
174
- **Tokenizer-only change**: every section of the bundle except the tokenizer is byte-identical to the previous file (verified by sha256 per section), so the weights, the graph and the chat template are unchanged and the speed and memory numbers on this card still describe this file per token — only the file's own sha256 differs. Verified on the LiteRT-LM runtime: the default turn, 7 probe strings, the 223 standalone characters U+00A1–U+017F and every special token now tokenize identically to the upstream tokenizer, and the four ASCII-only test questions answer byte-identically to the previous file (same ids in, same tokens out). Prompts containing accented letters, symbols or emoji reach the model differently from before, so individual answers to such prompts can change. Unless a row says otherwise, the accuracy figures on this card were measured on the previous file, and any on-device rows were measured on the previous file too — the on-device check has not been re-run on this one (the runtime's tokenizer code is the same on macOS and on device; the weights and graph are byte-identical). If you downloaded before 2026-08-30, re-download.
175
 
176
  ### 2026-08-31 — chat template fix: history turns with role 'assistant' (metadata-only, weights unchanged)
177
 
 
19
 
20
  [OpenGVLab/InternVL3_5-2B](https://huggingface.co/OpenGVLab/InternVL3_5-2B) converted to the
21
  **LiteRT-LM** (`.litertlm`) format for **on-device image+text** inference with Google's
22
+ [LiteRT-LM](https://github.com/google-ai-edge/litert-lm) runtime
23
+ (the same runtime that runs `litert-community/FastVLM-0.5B`). On 2026-11-15 `model.litertlm` was replaced with a file whose prefill/decode graph is rewritten for the GPU, with every weight unchanged. Outside the dated entries under Conversion notes, "this file" means that file and "the previous file" the one it replaced. On a Galaxy S26 GPU this file decodes 40.2 tokens/s and prefills 1,024 tokens at 537 tokens/s (LiteRT-LM v0.19.0).
24
 
25
  InternVL3.5-2B is a compact **vision-language model**: an **InternViT** vision encoder + pixel-shuffle +
26
  MLP projector feeding a **Qwen3-1.7B** language decoder (the newer Qwen3 backbone is what distinguishes
 
61
 
62
  This answer came from litert-lm 0.19.2 on a Mac (2026-11-15), with the file given by its path (the copy that was uploaded to this repo, with the same sha256). Two runs of this file with the flags above gave this answer and "Two tabby cats are sleeping on a pink couch next to two remotes."; one run of the previous file (downloaded from this repo and given by its path) gave "Two tabby cats are sleeping on a pink couch next to remote controls." A third run of this file, with the command exactly as above (it downloaded the file from this repo), gave that last sentence too. With `--backend cpu --vision-backend cpu --cpu-thread-count 1 --cache no --max-num-tokens 2048` added, litert-lm 0.19.0, 0.19.1 and 0.19.2 gave the answer above with both files (2026-11-14).
63
 
64
+ Leave `--vision-backend` unset, as above: this file, like the previous one, sets no default backend, so with `--backend` and `--vision-backend` both unset, litert-lm 0.19.0 to 0.19.2 run the decoder and the vision encoder on the CPU (unless a backend is set for the model in the CLI's config). With `--backend gpu` added and `--vision-backend` still unset, this file answered the picture in one run (on a Mac with litert-lm 0.19.2: "Two tabby cats are sleeping on a pink couch, with remote controls placed beside them."). With `--backend gpu --vision-backend gpu`, neither this file nor the previous file answers a picture on a Mac (litert-lm 0.19.0 to 0.19.2; the reply is `An error occurred`); with litert-lm 0.19.2 the error log names two op types of the vision encoder that the GPU delegate does not take, BROADCAST_TO and GATHER_ND, and the runtime does not run the encoder split between the GPU and the CPU. On a Galaxy S26 and a Pixel 11 Pro (LiteRT-LM v0.19.0), `litert_lm_advanced_main` with the vision encoder on the GPU stops too (see the Galaxy S26 section).
65
 
66
  If `run` stops right after the download with no error message from the CLI (a bus error; exit status 138 on a Mac) or with an error log that contains `too large for file size`, the downloaded file may be incomplete. The litert-lm CLI (0.14.0 to 0.19.2, and litert-lm-nightly 0.20.0.dev20261112) can keep an incomplete download in `~/.litert-lm/cache/huggingface/litert-community/InternVL3_5-2B/` and uses it again on later runs without checking its size. Delete that file and run the command again.
67
 
 
92
 
93
  ## Galaxy S26 — GPU and CPU
94
 
95
+ Each run prefills 1,024 tokens and generates 256 tokens, three times (three iterations): the runtime's benchmark mode puts the prompt file's one sentence ("Explain what on-device AI means in simple terms.") in the chat template as a user message and pads the tokens to 1,024 with token id 0. Iteration 1 is the first pass after the engine starts. The GPU row is the median of iterations 2–3 over two runs, so it leaves iteration 1 out; on the GPU, this file's iteration 1 prefilled faster and decoded more slowly than its iterations 2 and 3 (iteration 1: prefill 580–591 tok/s, decode 39.0–39.3 tok/s). On the CPU the median prefill and decode speeds drop after iteration 1, so each iteration has its own row: the median of that iteration over two runs.
96
 
97
  | Backend | Prefill, 1,024 tokens | Decode | Time to first token | Peak memory |
98
  |---|---:|---:|---:|---:|
 
101
  | CPU (XNNPACK for most nodes), iteration 2 | 104 tok/s | 16.0 tok/s | 9.93 s | 2.34 GB |
102
  | CPU (XNNPACK for most nodes), iteration 3 | 104 tok/s | 16.0 tok/s | 9.94 s | 2.34 GB |
103
 
104
+ Samsung Galaxy S26 (SM-S942Q / SM8850, Android 16), `litert_lm_advanced_main` built from the LiteRT-LM v0.19.0 source (commit `771b06e1`; the v0.19.0 tag is on the next commit, which changes only `Package.swift` and `README.md`), `--benchmark` with 1,024 prefill tokens and 256 decode tokens, context 2,048, 2026-11-15. Each run is a new process. The rows cover the text path. The GPU runs started at Android's thermal status 0 (none) and each ended at thermal status 1 or 2 (light or moderate), with the GPU's highest allowed clock one or two steps down; in every GPU run the prefill slowed from one iteration to the next. The CPU runs started at thermal status 1 and were at thermal status 2 (moderate) by 11–23 s in (the status is read about every 11 s), where they stayed until they ended.
105
 
106
  In each of the four counted CPU runs (two per file, after one warm-up run that is not counted), the phone lowers the clock caps of its two CPU clock domains from 2–6 s in, to 1.56 / 1.50 GHz by 20–22 s in. Iteration 1 runs while the caps come down, iterations 2 and 3 at the lowered caps.
107
 
108
+ Peak memory is per run, so the three CPU rows share one value. It is the process's `VmHWM`: on the CPU 2.33–2.34 GB in this file's two counted runs (2.36 GB in the warm-up run) and 2.16 GB in each of the previous file's two. `VmHWM` does not count memory the GPU driver holds, so the GPU row adds the rise of the phone's GPU allocation counter (`kgsl_page_alloc`) during each of this file's GPU runs (2.47 GB; 1.85 GB in each of the previous file's). In the CPU runs that counter rose by less than 1 MB (0.44 MB in one of the five runs, not at all in the other four).
109
 
110
  With the vision encoder on the GPU (`--vision_backend=gpu`), `litert_lm_advanced_main` stops with exit status 13 before it reads the picture: with this file on this phone, and with this file and the previous one on a Pixel 11 Pro. Its log names two op types of the encoder that the GPU delegate does not take, BROADCAST_TO and GATHER_ND (on this phone, 13 of the encoder's 1,320 nodes). With the vision encoder on the CPU (`--vision_backend=cpu`) and the decoder on the GPU, this phone answered "Describe this picture in one sentence." about the photo under How to use with "Two tabby cats are sleeping on a pink couch, with remote controls placed beside them." (one run).
111
 
112
  On the GPU this file decodes about 37 % faster than the previous file. Four runs went previous, this, this, previous (each run's mean of iterations 2–3): prefill 558, 537, 542 and 539 tok/s, decode 29.4, 40.2, 40.3 and 29.4 tok/s; from the previous file to this one, decode ×1.366 and prefill ×0.962 in the first two runs, decode ×1.371 and prefill ×1.005 in the last two, while the previous file's own two runs differ by 3.6 % in prefill. On the CPU, this file's medians in iteration 1 were 1.6 % below the previous file's in prefill and 2.6 % above in decode, and in iterations 2 and 3 between 0.3 % and 0.9 % above; two counted runs of the same file differed by up to 1.6 %. The runs behind each number, and the S26 section this card carried for an earlier file: [MEASUREMENTS.md](MEASUREMENTS.md).
113
 
114
+ On the Galaxy S26 the GPU decodes 2.1× as fast as the CPU's iteration 1 and 2.5× as fast as its iterations 2 and 3, and prefills 2.5× and 5.2× as fast, so this repo's `litertlm_manifest.json` recommends `gpu` for flagship-class Android. That recommendation rests on the Galaxy S26 alone.
115
 
116
  GPU wiring, including the Gallery import toggle: [GPU guide](https://github.com/john-rocky/hf-to-litertlm/blob/main/docs/android-gpu.md).
117
 
 
129
 
130
  ## Run on iPhone / macOS
131
 
132
+ Use [swift-litert-lm](https://github.com/john-rocky/swift-litert-lm), a community Swift package over the LiteRT-LM runtime,
133
+ and its `LiteRTDemo` sample. Load `model.litertlm` with the **image (vision) tower enabled**
134
  (modalities `[.vision]`), attach a photo, and ask a question.
135
 
136
  > Note for app integrators: this is a **vision-only** bundle (no audio tower). Bring up the engine with
 
169
 
170
  ### 2026-08-30 — tokenizer section replaced (weights unchanged)
171
 
172
+ The tokenizer in `model.litertlm` was a SentencePiece conversion of the model's BPE tokenizer, and the conversion lost the byte-level semantics: a standalone accented letter or symbol (`é`, `ñ`, `ü`, `°`, `·`, …) was encoded to the id of a single-byte token instead of the token the upstream tokenizer uses, and 36 of the 223 standalone characters U+00A1–U+017F in the checks (`¡`, `Ā` to `ġ`, and `Ų`) became the token the conversion had reused as UNK — the end-of-text token for this vocabulary. `model.litertlm` now embeds the upstream `tokenizer.json` (the same HF tokenizer path most bundles in this collection use).
173
 
174
+ **Tokenizer-only change**: every section of the bundle except the tokenizer is byte-identical to the previous file (verified by sha256 per section), so the weights, the graph and the chat template are unchanged and the speed and memory numbers on this card still describe this file per token — only the file's own sha256 differs. Verified on the LiteRT-LM runtime: one user message ("What is the capital of France?") as the chat template renders it, 7 test strings, the 223 standalone characters U+00A1–U+017F and every special token now tokenize identically to the upstream tokenizer, and the four ASCII-only test questions gave byte-identical answers to the previous file within the check's limit of 48 output tokens (same ids in, same tokens out). In the checks, text with accented letters, symbols or non-Latin scripts and a short Python snippet reach the model differently from before (digits, plain English text and the test emoji do not), so individual answers to such prompts can change. Unless a row says otherwise, the accuracy figures on this card were measured on the previous file, and any on-device rows were measured on the previous file too — the on-device check has not been re-run on this one (the runtime's tokenizer code is the same on macOS and on device; the weights and graph are byte-identical). If you downloaded before 2026-08-30, re-download.
175
 
176
  ### 2026-08-31 — chat template fix: history turns with role 'assistant' (metadata-only, weights unchanged)
177
 
litertlm_manifest.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "manifest_schema": "0.1.3",
3
  "repo": "litert-community/InternVL3_5-2B",
4
- "generated": "2026-11-15",
5
  "generator": "make_manifest.py",
6
  "model": {
7
  "display_name": "InternVL3.5-2B",
@@ -85,7 +85,7 @@
85
  "platform": "android",
86
  "device_class": "flagship",
87
  "backend": "gpu",
88
- "reason": "measured on one Galaxy S26 with one binary (litert_lm_advanced_main, LiteRT-LM v0.19.0 source build 771b06e1; 1,024-token prefill, 256 decode tokens; 2026-11-15): GPU 40.215 tok/s decode / 536.945 prefill, the median of iterations 2-3 over 2 runs, peak 871,672 kB VmHWM plus a 2.47 GB rise of the GPU driver's allocation counter (kgsl_page_alloc), against CPU 19.29 decode / 210.91 prefill in iteration 1 and 15.99 / 103.74 in iteration 3 (the median of each over 2 runs; in each counted run the phone lowers the clock caps of its two CPU clock domains from 2-6 s in to 1.56 / 1.50 GHz by 20-22 s in), peak 2,288,820 kB VmHWM in the 2 counted runs, with a rise of that counter below 1 MB. The GPU decodes 2.1x as fast as the CPU's iteration 1 and 2.5x as fast as its iteration 3, and prefills 2.5x and 5.2x as fast. On a Pixel 11 Pro only the GPU was measured, so whether the GPU is the faster backend there is not known"
89
  }
90
  ],
91
  "requirements": {
@@ -93,8 +93,8 @@
93
  "Vision-only bundle (no audio tower): bring up the engine with the vision modality only (Modality.textImage / [.vision]); requesting the audio tower (.all) fails at session creation.",
94
  "Earlier file (Galaxy S26 GPU check, 2026-08-25): its prompt carried no image, so it covered engine creation and the text path only.",
95
  "Galaxy S26 GPU: XNNPACK additionally takes 1 of the 4 nodes in `main` (the earlier file's 2026-08-25 check and this file's 2026-11-15 runs); the runtime accepts that split.",
96
- "2026-08-28 start_token fix (metadata-only, weights unchanged): the literal start token \"None\" was removed. The card's accuracy figures were measured on the file before 2026-08-28 and not re-measured.",
97
- "2026-08-30 tokenizer section replaced with the upstream tokenizer.json (weights unchanged): answers to prompts with accented letters/symbols/emoji can change; the card's accuracy figures and its on-device rows of that time were measured on earlier files, and the on-device check was not re-run on the 2026-08-30 file.",
98
  "2026-08-31 chat template fix (metadata-only, weights unchanged): history turns with role 'assistant' are now accepted; single-turn renders, token ids, prefill counts and greedy answers are unchanged, so the card's numbers of that time also described the 2026-08-31 file.",
99
  "2026-11-15 GPU graph (weights unchanged): the prefill/decode graph has the GPU composite form (odml.cache_update writes the KV cache, odml.runtime_bmm runs the attention products) and a 1,024-token prefill signature copied from prefill_512; every weight and every section outside that graph is byte-identical to the previous file (Hub 866529df). This file was tested on litert-lm 0.19.0-0.19.2 (macOS) and litert_lm_advanced_main v0.19.0 (Galaxy S26, Pixel 11 Pro)."
100
  ]
@@ -147,7 +147,7 @@
147
  "device": "Galaxy S26 (SM-S942Q, Qualcomm SM8850, Adreno)",
148
  "os": "Android",
149
  "backend": "gpu",
150
- "runtime": "litert_lm_advanced_main v0.19.0 (source build 771b06e1), LiteRT GPU (LITERT_CL)",
151
  "prompt_tokens": 1024,
152
  "decode_tokens": 256,
153
  "prefill_tps": 536.945,
@@ -159,13 +159,13 @@
159
  "cache": "no",
160
  "runs": 2,
161
  "date": "2026-11-15",
162
- "source": "--benchmark, text prompt, 3 iterations per run, the median of iterations 2-3 over 2 runs; every run started at thermal status 0 after 108-152 s of rest and ended at thermal status 1-2 with the GPU driver's thermal power level 1-2 (0 = no limit); every node of the prefill and decode graphs delegated; the previous file measured back to back (previous, new, new, previous): 547.065 prefill / 29.39 decode; per run (mean of iterations 2-3) this file prefilled 0.962 and 1.005 times as fast as the previous file in the two pairs and decoded 1.366 and 1.371 times as fast, while the previous file's own two runs differ by 3.6 % in prefill; in every run the prefill slowed from one iteration to the next; peak_memory_mb is the process's VmHWM and leaves out GPU driver memory (the phone's kgsl_page_alloc counter rose by 2.47 GB during each of this file's GPU runs and 1.85 GB during each of the previous file's)"
163
  },
164
  {
165
  "device": "Galaxy S26 (SM-S942Q, Qualcomm SM8850, Adreno)",
166
  "os": "Android",
167
  "backend": "cpu",
168
- "runtime": "litert_lm_advanced_main v0.19.0 (source build 771b06e1), XNNPACK for most nodes, the default thread count (4)",
169
  "prompt_tokens": 1024,
170
  "decode_tokens": 256,
171
  "prefill_tps": "103.74-210.91",
@@ -177,13 +177,13 @@
177
  "cache": "no",
178
  "runs": 2,
179
  "date": "2026-11-15",
180
- "source": "--benchmark, text prompt, 3 iterations per run; the high end is iteration 1 and the low end iteration 3, the median of each over 2 runs (iteration 2: 103.86 / 15.995); one warm-up run of this file before the 2 counted runs, not counted; every run started at thermal status 1 (Android's light level) with no CPU clock cap and reached thermal status 2 (moderate) 11-23 s in, where it stayed until it ended, the counted runs after 152-153 s of rest and the warm-up run after 127 s; in each of the 4 counted runs (2 per file) the phone lowers the clock caps of both CPU clock domains from 2-6 s into the run to 1.56 / 1.50 GHz by 20-22 s in (the runs took 72-73 s), so iteration 1 runs while the caps come down and iterations 2 and 3 at the lowered caps; peak_memory_mb is the highest VmHWM of the 2 counted runs (2,288,820 kB; 2,306,284 kB in the warm-up run), and the phone's GPU allocation counter (kgsl_page_alloc) rose by 0.44 MB in one CPU run and not at all in the other four; the previous file measured back to back: 214.325 / 18.81 (iteration 1), 102.915 / 15.895 (iteration 2) and 103.04 / 15.94 (iteration 3), peak 2,112,628 kB; in iteration 1 this file's prefill median is 1.6 % below the previous file's and its decode median 2.6 % above, in iterations 2 and 3 both are 0.3-0.9 % above, and two counted runs of the same file differ by up to 1.6 %"
181
  },
182
  {
183
  "device": "Pixel 11 Pro",
184
  "os": "Android",
185
  "backend": "gpu",
186
- "runtime": "litert_lm_advanced_main v0.19.0 (source build 771b06e1), LiteRT GPU",
187
  "prompt_tokens": 1024,
188
  "decode_tokens": 256,
189
  "prefill_tps": 533.48,
@@ -195,7 +195,7 @@
195
  "cache": "no",
196
  "runs": 2,
197
  "date": "2026-11-14",
198
- "source": "--benchmark, text prompt, 3 iterations per run, the median of iterations 2-3 over 2 runs; every run started at thermal status 0 after 130-174 s of rest; the previous file measured back to back (previous, new, new, previous): 509.74 prefill / 13.365 decode; peak_memory_mb is the process's VmHWM, and the memory the GPU driver holds was not read on this phone; the Pixel 11 Pro CPU was not measured"
199
  }
200
  ],
201
  "known_issues": [
 
1
  {
2
  "manifest_schema": "0.1.3",
3
  "repo": "litert-community/InternVL3_5-2B",
4
+ "generated": "2026-11-17",
5
  "generator": "make_manifest.py",
6
  "model": {
7
  "display_name": "InternVL3.5-2B",
 
85
  "platform": "android",
86
  "device_class": "flagship",
87
  "backend": "gpu",
88
+ "reason": "measured on one Galaxy S26 with one binary (litert_lm_advanced_main, built from the LiteRT-LM v0.19.0 source, commit 771b06e1; 1,024-token prefill, 256 decode tokens; 2026-11-15): GPU 40.215 tok/s decode / 536.945 prefill, the median of iterations 2-3 over 2 runs, peak 871,672 kB VmHWM plus a 2.47 GB rise of the GPU driver's allocation counter (kgsl_page_alloc), against CPU 19.29 decode / 210.91 prefill in iteration 1 and 15.99 / 103.74 in iteration 3 (the median of each over 2 runs; in each counted run the phone lowers the clock caps of its two CPU clock domains from 2-6 s in to 1.56 / 1.50 GHz by 20-22 s in), peak 2,288,820 kB VmHWM in the 2 counted runs, with a rise of that counter below 1 MB. The GPU decodes 2.1x as fast as the CPU's iteration 1 and 2.5x as fast as its iteration 3, and prefills 2.5x and 5.2x as fast. On a Pixel 11 Pro only the GPU was measured, so whether the GPU is the faster backend there is not known"
89
  }
90
  ],
91
  "requirements": {
 
93
  "Vision-only bundle (no audio tower): bring up the engine with the vision modality only (Modality.textImage / [.vision]); requesting the audio tower (.all) fails at session creation.",
94
  "Earlier file (Galaxy S26 GPU check, 2026-08-25): its prompt carried no image, so it covered engine creation and the text path only.",
95
  "Galaxy S26 GPU: XNNPACK additionally takes 1 of the 4 nodes in `main` (the earlier file's 2026-08-25 check and this file's 2026-11-15 runs); the runtime accepts that split.",
96
+ "2026-08-28 start_token fix (metadata-only, weights unchanged): the literal start token \"None\" was removed. The card's accuracy figures of that time were measured on the file before 2026-08-28 and not re-measured then.",
97
+ "2026-08-30 tokenizer section replaced with the upstream tokenizer.json (weights unchanged): in the checks, text with accented letters, symbols or non-Latin scripts and a short Python snippet reached the model differently from before (digits, plain English text and the test emoji did not), so answers to such prompts can change; the card's accuracy figures and its on-device rows of that time were measured on earlier files, and the on-device check was not re-run on the 2026-08-30 file.",
98
  "2026-08-31 chat template fix (metadata-only, weights unchanged): history turns with role 'assistant' are now accepted; single-turn renders, token ids, prefill counts and greedy answers are unchanged, so the card's numbers of that time also described the 2026-08-31 file.",
99
  "2026-11-15 GPU graph (weights unchanged): the prefill/decode graph has the GPU composite form (odml.cache_update writes the KV cache, odml.runtime_bmm runs the attention products) and a 1,024-token prefill signature copied from prefill_512; every weight and every section outside that graph is byte-identical to the previous file (Hub 866529df). This file was tested on litert-lm 0.19.0-0.19.2 (macOS) and litert_lm_advanced_main v0.19.0 (Galaxy S26, Pixel 11 Pro)."
100
  ]
 
147
  "device": "Galaxy S26 (SM-S942Q, Qualcomm SM8850, Adreno)",
148
  "os": "Android",
149
  "backend": "gpu",
150
+ "runtime": "litert_lm_advanced_main v0.19.0 source (commit 771b06e1, the parent of the v0.19.0 tag commit), LiteRT GPU (LITERT_CL)",
151
  "prompt_tokens": 1024,
152
  "decode_tokens": 256,
153
  "prefill_tps": 536.945,
 
159
  "cache": "no",
160
  "runs": 2,
161
  "date": "2026-11-15",
162
+ "source": "--benchmark (the prompt file's one sentence in the chat template, padded with token id 0 to 1,024 prefill tokens), 3 iterations per run, the median of iterations 2-3 over 2 runs; this file's two runs started at thermal status 0 after 152 s of rest each and ended at thermal status 2, one with the GPU driver's thermal power level 2 and one with level 1 (0 = no limit); every node of the prefill and decode graphs delegated; the previous file measured back to back (previous, new, new, previous): 547.065 prefill / 29.39 decode; per run (mean of iterations 2-3) this file prefilled 0.962 and 1.005 times as fast as the previous file in the two pairs and decoded 1.366 and 1.371 times as fast, while the previous file's own two runs differ by 3.6 % in prefill; in every run the prefill slowed from one iteration to the next; peak_memory_mb is the process's VmHWM and leaves out GPU driver memory (the phone's kgsl_page_alloc counter rose by 2.47 GB during each of this file's GPU runs and 1.85 GB during each of the previous file's)"
163
  },
164
  {
165
  "device": "Galaxy S26 (SM-S942Q, Qualcomm SM8850, Adreno)",
166
  "os": "Android",
167
  "backend": "cpu",
168
+ "runtime": "litert_lm_advanced_main v0.19.0 source (commit 771b06e1, the parent of the v0.19.0 tag commit), XNNPACK for most nodes, the default thread count (4)",
169
  "prompt_tokens": 1024,
170
  "decode_tokens": 256,
171
  "prefill_tps": "103.74-210.91",
 
177
  "cache": "no",
178
  "runs": 2,
179
  "date": "2026-11-15",
180
+ "source": "--benchmark (the prompt file's one sentence in the chat template, padded with token id 0 to 1,024 prefill tokens), 3 iterations per run; the high end is iteration 1 and the low end iteration 3, the median of each over 2 runs (iteration 2: 103.86 / 15.995); one warm-up run of this file before the 2 counted runs, not counted; every run started at thermal status 1 (Android's light level) with no CPU clock cap and was at thermal status 2 (moderate) by 11-23 s in (the status is read about every 11 s), where it stayed until it ended, the counted runs after 152-153 s of rest and the warm-up run after 127 s; in each of the 4 counted runs (2 per file) the phone lowers the clock caps of both CPU clock domains from 2-6 s into the run to 1.56 / 1.50 GHz by 20-22 s in (the runs took 72-73 s), so iteration 1 runs while the caps come down and iterations 2 and 3 at the lowered caps; load_s is the median engine init of the 2 counted runs (2.64 and 2.63 s); peak_memory_mb is the highest VmHWM of the 2 counted runs (2,288,820 kB; 2,306,284 kB in the warm-up run), and the phone's GPU allocation counter (kgsl_page_alloc) rose by 0.44 MB in one CPU run and not at all in the other four; the previous file measured back to back: 214.325 / 18.81 (iteration 1), 102.915 / 15.895 (iteration 2) and 103.04 / 15.94 (iteration 3), peak 2,112,628 kB; in iteration 1 this file's prefill median is 1.6 % below the previous file's and its decode median 2.6 % above, in iterations 2 and 3 both are 0.3-0.9 % above, and two counted runs of the same file differ by up to 1.6 %"
181
  },
182
  {
183
  "device": "Pixel 11 Pro",
184
  "os": "Android",
185
  "backend": "gpu",
186
+ "runtime": "litert_lm_advanced_main v0.19.0 source (commit 771b06e1, the parent of the v0.19.0 tag commit), LiteRT GPU",
187
  "prompt_tokens": 1024,
188
  "decode_tokens": 256,
189
  "prefill_tps": 533.48,
 
195
  "cache": "no",
196
  "runs": 2,
197
  "date": "2026-11-14",
198
+ "source": "--benchmark (the prompt file's one sentence in the chat template, padded with token id 0 to 1,024 prefill tokens), 3 iterations per run, the median of iterations 2-3 over 2 runs; this file's two runs started at thermal status 0 after 165 and 154 s of rest; the previous file measured back to back (previous, new, new, previous): 509.74 prefill / 13.365 decode; peak_memory_mb is the process's VmHWM, and the memory the GPU driver holds was not read on this phone; the Pixel 11 Pro CPU was not measured"
199
  }
200
  ],
201
  "known_issues": [