Skip to content

Add Qwen and Gemma models to LiteRT - #1192

Open
farook-edev wants to merge 7 commits into
litertfrom
litert-qwen
Open

farook-edev wants to merge 7 commits into
litertfrom
litert-qwen

Conversation

@farook-edev

Copy link
Copy Markdown
Contributor

This PR aims to keep Qwen work separate from LiteRT work, it includes all the changes to the pipeline and datasets to allow qwen models (tested only 0.8b) to run on LiteRT backend.

@farook-edev
farook-edev requested review from a team and anhappdev as code owners October 26, 2026 21:32
@github-actions

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@farook-edev farook-edev changed the title Litert qwen Add Qwen models to LiteRT Oct 26, 2026
@freedomtan

Copy link
Copy Markdown
Contributor
  1. it doesn't built
  2. please share model.

@farook-edev

Copy link
Copy Markdown
Contributor Author

0.8B Qwen model available here (Converted with GPU patch)

@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

AhmedTElthakeb and others added 3 commits November 10, 2026 03:30
## Problem
`ends_with` / `starts_with` (used by `startend:end_checker` and
`combination:repeat_prompt`) and `ConstrainedResponse` allow 3 extra
characters around the expected text, but measure them with
`std::string::size()`, which counts **bytes**. The Python reference uses
`len()`, which counts **characters**. Any non-ASCII character in that
window makes the C++ check fail where Python passes.

Example: `"My answer is no. ⁇ "` is 19 characters (limit 16 + 3, passes
in Python) but 21 bytes (fails in C++).

## Proposed Fix
Add `utf8_len` (character count) and `utf8_offset` (byte offset of the
n-th character) to `common.h`, and use them to size the comparison
window in `ends_with` / `starts_with` and the length check in
`ConstrainedResponse`. The window is clamped to the string length. ASCII
input behaves as before.
@freedomtan

Copy link
Copy Markdown
Contributor

@anhappdev please help put those models to https://mobile.mlcommons-storage.org/app-resources/models/.

@farook-edev farook-edev changed the title Add Qwen models to LiteRT Add Qwen and Gemma models to LiteRT Nov 10, 2026
@farook-edev

Copy link
Copy Markdown
Contributor Author
Model TinyMMLU IFEval
Gemma E4B 47.0000% 65.9209%
Qwen 3.5 4B 52.0000% 86.2216%
Model Dataset TTFT (sec) TPS (tok/sec)
Gemma E4B TinyMMLU 14.14 5.67
Gemma E4B IFEval 9.99 8.63
Qwen 3.5 4B TinyMMLU 39.04 6.68
Qwen 3.5 4B IFEval 27.32 6.80

@anhappdev

Copy link
Copy Markdown
Collaborator

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.

4 participants