Skip to content

litetune 0.2.0

Choose a tag to compare

@DenisovAV DenisovAV released this 28 Sep 15:57
dfb4544

If you ship a model on litert-lm 0.17.1, re-run verify with 0.2.0. flutter_gemma_litertlm 1.8.0 ships that runtime. Every litetune up to 0.1.9 measured the converted model on litert-lm 0.16.1, and 0.17.1 does not give 0.16.1's answers, so a 0.1.x number describes your bundle on a runtime your app no longer runs. The number was not wrong; it is a number about something else.

Why a runtime bump is a new basis for every number

Measured on Linux x86-64, CPU backend: after each of twelve prompts on three bundles, one fixed sentence was scored with run_text_scoring, which no sampler or detokenizer touches.

Per-token scores identical, of 36 prompt-bundle scorings same runtime 0.16.1 against 0.17.1
same CPU model, another run or machine 36 1
Intel Xeon @ 2.20GHz against AMD EPYC 7B12 0 0

One runtime on one CPU model reproduced every score to the bit — on 0.17.1 on the Intel model with 1, 4, 8, 16 or 32 threads alike. Across runtimes, or across CPU models, it did not. litetune's own driver outputs agree: 152 of 152 identical when 0.16.1 ran twice on one machine, 47 of 152 between the runtimes. So a litert-lm number belongs to a runtime version and a CPU, and the model name alone does not identify a CPU: two machines reporting Intel(R) Xeon(R) CPU @ 2.20GHz differed in AVX-512.

What changes

  • The runtime. verify runs the candidate on litert-lm==0.17.1. convert pins litert-torch-nightly==0.10.0.dev20260926 with litert-lm-builder==0.17.1, and now also the quantizer, LiteRT and converter packages it requires, which up to 0.1.9 floated to whatever was newest the day of the install.
  • Every number says where it came from. A verify manifest records the litert-lm version its candidate ran on and the host's CPU model — on the default CPU backend, the CPU that computed the answers — with its architecture, core count and the instruction-set features XNNPACK chooses kernels by where the driver could read them; its limitations say so when the version or the CPU model could not be read, when the version differs from the pin, or when cores of more than one kind were open to the candidate. bundle carries the runtime and CPU the manifest recorded, with the CPU's features where it has them, into established_against, rather than the pin of whichever litetune packed it.
  • No unconstrained output under a grammar-on label. Where a bundle has no SentencePiece tokenizer, 0.16.1 refused a grammar-on conversation and 0.17.1 logs a warning and decodes without the grammar. The tool path now reads the bundle's tokenizer sections first and refuses that mode itself.
  • Large integers. 0.17.1 returns a tool-call integer that fits in 64 bits as an integer; tune accepts such a call. Scores compare numbers by value, so no score moves.

Re-measured on 0.17.1

Old numbers stay, labelled 0.16.1; the 0.17.1 ones go beside them in MEASUREMENTS.md. The runs differ in runtime, transport and possibly CPU — the 0.16.1 runs did not record theirs — so a difference is not attributed to the runtime.

FunctionGemma through the tool path, the same checkpoint and split: 0.9109 ±0.0221 with the grammar off and on, against 0.9125 ±0.0219 on 0.16.1; conversion cost +0.0141 ±0.0092 on 9 discordant rows, still resolved, against +0.0125 ±0.0087 on 8. A bundle re-converted with the new toolchain scored the same.

The four banking77 eight-bit pairs, the same bundles by SHA-256. Cost of conversion, with discordant rows:

dynamic_wi8_afp32, 0.16.1 0.17.1 weight_only_wi8_afp32, 0.16.1 0.17.1
gemma-3-270m +0.0000 (34) −0.0067 (30) +0.0033 (16) −0.0033 (12)
Qwen3-0.6B +0.0067 (20) +0.0000 (10) +0.0167 (12, resolved) +0.0050 (5)
gemma-3-1b +0.0083 (23) +0.0100 (12) +0.0167 (14, resolved) +0.0000 (4)
Qwen2.5-0.5B +0.0100 (16) +0.0000 (8) +0.0100 (10) −0.0017 (3)

Two costs resolved on 0.16.1 and none does on 0.17.1. That is two runs' verdicts, not a measured change in a cost, and neither run is withdrawn: litetune computes no interval between two runs.

Not yet re-measured: the four-bit recipes, Gemma 4's conversion costs, the headline FunctionGemma text-path runs and the phone runs. The README and MEASUREMENTS.md say so where those numbers appear.