Skip to content

fix(models): sync Gemma 4 core tokenizer to Google's glitch-token fix - #1108

Open
four1er wants to merge 1 commit into
ROCm:mainfrom
four1er:fix/gemma4-core-tokenizer-1057
Open

four1er wants to merge 1 commit into
ROCm:mainfrom
four1er:fix/gemma4-core-tokenizer-1057

Conversation

@four1er

@four1er four1er commented Nov 23, 2026

Copy link
Copy Markdown

Fixes #1057.

Google remediated glitch tokens in the Gemma 4 tokenizer.json files (E2B #51, E4B #50, 12B #55) by pruning the BPE merges that produce them; vocab size and token IDs are unchanged. gemma4-it-core:e2b/e4b pull tokenizer.json (plus tokenizer_config.json, config.json, chat_template.jinja) straight from google/gemma-4-E2B-it / google/gemma-4-E4B-it at pinned revisions that predate the fix, so this bumps those pins to the fix commits and updates the pinned tokenizer.json size/sha256 in model_info.json:

  • E2B: 3e22461f -> 4adf1574 ("fix: Remediate 233 glitch tokens in tokenizer.json (changed demo link to playlist #51)"); tokenizer.json 32,169,626 -> 32,155,733 bytes, sha256 ab26b2ad...
  • E4B: ee0ef602 -> 4ecc2ba6 ("fix: Remediate 219 glitch tokens in tokenizer.json (add the prompt for the txt file #50)"); tokenizer.json 32,169,626 -> 32,156,428 bytes, sha256 91d9cf86...

Also updated the two size totals in model_list.json (E2B 6,889,739,655 -> 6,889,725,762; E4B 9,771,106,246 -> 9,771,093,048) so they still equal the sum of the model_info.json records.

Verification (CPU, no NPU/GPU here)

  • Downloaded tokenizer.json at both the old and new revisions for E2B and E4B: sha256 matches the HF tree LFS oid in each case, and the old files are byte-identical to the file FLM currently pins (cc8d3a0c...).
  • Diff vs Google's published summaries: E2B merges 514,906 -> 514,639 (-267, 0 added) plus the one vocab rename (U+2127A -> <glitch_pruned_249788>); E4B merges 514,906 -> 514,653 (-253, 0 added), vocab identical. drawingCodehint merge removed in E4B; CYCLONEDB merge removed in E2B. The only files that differ between the old and new Google revisions for these four file_sources entries is tokenizer.json.
  • Both JSONs parse; re-checked the downloader invariant (every listed file has a 64-hex sha256 record and the size sum matches model_list.json): no new violations vs main (113 pre-existing mismatches elsewhere, unchanged).

Scope note

The NPU2 models (gemma4-it:e2b/e4b/12b, gemma4e-flash, nemotron3.5-bolt:e4b) and the OGA/HiPEP packages still ship the pre-fix tokenizer.json from the FastFlowLM / amd HF repos, so their pins cannot move until the patched files are uploaded there by someone with org access; this PR deliberately leaves those pins alone. Same for 12B, which has no core model pulling from Google.

No end-to-end run was possible here (no AMD NPU/GPU); relying on CI.

Google remediated glitch tokens in the Gemma 4 tokenizer.json files
(E2B ROCm#51, E4B ROCm#50, 12B ROCm#55). gemma4-it-core:e2b/e4b pull
tokenizer.json from google/gemma-4-E2B-it / gemma-4-E4B-it at pinned
revisions that predate the fix; bump the pins to the fix commits and
update the pinned size/sha256 in model_info.json.

Fixes ROCm#1057
@four1er

four1er commented Nov 26, 2026

Copy link
Copy Markdown
Author

The three CI workflows for this PR (Build and Test, CPU Tests, Security scan) are stuck at action_required since Nov 23 — they need a maintainer's approval to run on a fork PR. Could a maintainer please approve them so CI can run? Thanks!

This branch has not been deployed

No deployments
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.

Update Gemma tokenizer.json after Google's recent fix

1 participant