Skip to content

Commit f8374ed

Browse files
psiddhfacebook-github-bot
authored andcommitted
Playground chat: Gemma 3 1B Instruct replaces Llama 3.2 1B (#24014)
Summary: On GPUs with `shader-f16` (Apple GPUs, most others), Llama 3.2 1B in the playground's On-device Chat fails on its first reply with "linear_q4gsw_bk64_qkv(resize): separate projection dispatch was not restored before the QKV resize hook ran". That is a WebGPU runtime bug in the fused Q/K/V path, which only Llama's shapes take; D126153972 fixes it upstream. Until the fixed runtime ships, the chat offers Qwen 3 0.6B and Gemma 3 1B Instruct. - Gemma 3 1B Instruct is loaded from `executorch-community/Gemma-3-1B-IT-ExecuTorch-WebGPU` on Hugging Face, pinned to commit `91864e51`, with a sha256 check per file. Export: 4-bit groupwise weights, exact sliding-window and global attention, 8,960-token context. Its repo carries the Gemma Terms of Use, the Prohibited Use Policy and the required NOTICE. Legal approved publishing it. - The chat shows Gemma's required notice ("Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms") when Gemma is selected. Llama leaves the chat and the Models page; its Hugging Face repo stays. - `llm.js`: when a model's chat template can't render the conversation, the chat reports it instead of silently falling back to ChatML, which only Qwen understands. - Model cards lay out in one row. `fbcode/executorch/website` and `xplat/executorch/website` stay byte-identical. Differential Revision: D126233262
1 parent c4c10ca commit f8374ed

4 files changed

Lines changed: 53 additions & 2 deletions

File tree

‎website/playground/webgpu/src/config/catalog.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const DEMOS = [
2828
title: 'On-device Chat',
2929
blurb: 'Chat with a real language model running entirely on your GPU. Talk to it, too.',
3030
meta: { label: 'Models', value: 'Qwen 3 0.6B, Llama 3.2 1B' },
31-
models: ['qwen3-0.6b', 'llama-3.2-1b-instruct'],
31+
models: ['qwen3-0.6b', 'gemma-3-1b-it'],
3232
compute: COMPUTE.EXECUTORCH,
3333
view: 'chat',
3434
art: 'chat',

‎website/playground/webgpu/src/config/models.js‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,56 @@ export const MODELS = [
116116
provenance: 'Upstream: Qwen/Qwen3-0.6B.',
117117
},
118118
},
119+
{
120+
id: 'gemma-3-1b-it',
121+
name: 'Gemma 3 1B Instruct',
122+
shortName: 'Gemma 3 1B',
123+
task: 'text-generation',
124+
tagline: 'Larger · by Google DeepMind',
125+
approxBytes: 675e6,
126+
approxBytesIsEstimate: false,
127+
arch: { layers: 26, dModel: 1152, ffn: 6912, heads: 4, kvHeads: 1, vocab: 262144 },
128+
assets: {
129+
"baseUrl": "https://huggingface.co/executorch-community/Gemma-3-1B-IT-ExecuTorch-WebGPU/resolve/91864e518e371b57a6433c180490ce5ab31639ec/", // @lint-ignore (base URL, files resolve under it)
130+
"files": [
131+
"gemma3_1b_it_q4gsw.pte",
132+
"tokenizer/config.json",
133+
"tokenizer/generation_config.json",
134+
"tokenizer/special_tokens_map.json",
135+
"tokenizer/tokenizer.json",
136+
"tokenizer/tokenizer_config.json"
137+
],
138+
"sha256": {
139+
"gemma3_1b_it_q4gsw.pte": "6056492708430182103f2b28cac2cc5d4d43a66a95236f070de3312542f11c25",
140+
"tokenizer/config.json": "19cb5d28c97778271ba2b3c3df47bf76bdd6706724777a2318b3522230afe91e",
141+
"tokenizer/generation_config.json": "fd9324becc53c4be610db39e13a613006f09fd6ef71a95fb6320dc33157490a3",
142+
"tokenizer/special_tokens_map.json": "2f7b0adf4fb469770bb1490e3e35df87b1dc578246c5e7e6fc76ecf33213a397",
143+
"tokenizer/tokenizer.json": "4667f2089529e8e7657cfb6d1c19910ae71ff5f28aa7ab2ff2763330affad795",
144+
"tokenizer/tokenizer_config.json": "bfe25c2735e395407beb78456ea9a6984a1f00d8c16fa04a8b75f2a614cf53e1"
145+
},
146+
"spec": {
147+
"pte": "gemma3_1b_it_q4gsw.pte",
148+
"pteBytes": 640305924,
149+
"tokenizer": "tokenizer",
150+
"chat": "template",
151+
"prefillMax": 512,
152+
"maxCtx": 8960,
153+
"eos": [
154+
1,
155+
106
156+
]
157+
}
158+
},
159+
credit: { by: 'Google DeepMind', url: 'https://huggingface.co/google/gemma-3-1b-it', paper: 'https://arxiv.org/abs/2503.19786' },
160+
attribution: 'Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms',
161+
license: {
162+
status: LICENSE_STATUS.CLEARED,
163+
reviewNote: "Approved for public redistribution (legal/OSS approval confirmed by the project owner, 2026-10-16).",
164+
upstream: 'Gemma Terms of Use + Gemma Prohibited Use Policy',
165+
provenance:
166+
'Upstream: google/gemma-3-1b-it (gated on Hugging Face). Use is subject to the Gemma Terms of Use, including the use restrictions in its Section 3.2. ',
167+
},
168+
},
119169
{
120170
id: 'sam2-hiera-tiny',
121171
name: 'SAM 2.1 Hiera Tiny',

‎website/playground/webgpu/src/runtime/llm.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export class ExecuTorchLLM {
6767
} catch {
6868
ids = null;
6969
}
70+
if (!ids?.length) throw new Error('The chat template could not render this conversation.');
7071
}
7172
if (!ids?.length) {
7273
// ChatML, the format of the Qwen family. "nothink" pre-closes Qwen 3's

‎website/playground/webgpu/styles/app.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ p { margin: 0; }
608608
.preload__glyph--ok { background: var(--live-soft); color: var(--live); box-shadow: none; }
609609
.preload__title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
610610
.preload__sub { color: var(--text-3); font-size: 14px; }
611-
.model-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 440px; }
611+
.model-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; width: 100%; max-width: 600px; }
612612
.model-choice__opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
613613
.model-choice__opt:hover { border-color: var(--border-strong); }
614614
.model-choice__opt[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }

0 commit comments

Comments
 (0)