Skip to content

Update tokenizers submodule to the linear-time HF encode path#20472

Merged
digantdesai merged 2 commits into
mainfrom
tokenizer_nlon_pin_bump
Jun 24, 2026
Merged

Update tokenizers submodule to the linear-time HF encode path#20472
digantdesai merged 2 commits into
mainfrom
tokenizer_nlon_pin_bump

Conversation

@digantdesai

Copy link
Copy Markdown
Contributor

Bump extension/llm/tokenizers, picking up the linear-time HFTokenizer encode work (merge_all O(n log n), ReplaceNormalizer::normalize O(N) single forward pass) plus a targeted encode-latency benchmark. This cuts long-prompt prefill tokenization time in the gemma4 / eagle3 runners; token ids and greedy output are unchanged, verified e2e on the gemma4-31B target (identical 18-token encode + decode after the bump).

Copilot AI review requested due to automatic review settings June 24, 2026 02:50
@pytorch-bot

pytorch-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20472

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 24, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the extension/llm/tokenizers submodule to pick up a new linear-time HuggingFace tokenizer encode path, along with an encode-latency benchmark, to reduce long-prompt prefill tokenization time in the Gemma/Eagle runners while preserving tokenization outputs.

Changes:

  • Bump extension/llm/tokenizers submodule revision to include the new linear-time HFTokenizer::encode implementation.
  • Pick up tokenizer-side performance improvements (notably around merge/normalization paths) and an encode-latency benchmark.
  • Intended to improve prefill tokenization latency without changing token IDs or greedy outputs (per PR description).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mergennachin

mergennachin commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Can you also include this commit too?

meta-pytorch/tokenizers@c17438e

Just merged now

Bump extension/llm/tokenizers, picking up the linear-time
HFTokenizer encode work (merge_all O(n log n), ReplaceNormalizer::normalize
O(N) single forward pass) plus a targeted encode-latency benchmark. This cuts
long-prompt prefill tokenization time in the gemma4 / eagle3 runners; token ids
and greedy output are unchanged, verified e2e on the gemma4-31B target
(identical 18-token encode + decode after the bump).

ghstack-source-id: 525dc35
ghstack-comment-id: 4734208425
Pull-Request: #20349
@digantdesai digantdesai merged commit 46c784f into main Jun 24, 2026
461 of 482 checks passed
@digantdesai digantdesai deleted the tokenizer_nlon_pin_bump branch June 24, 2026 20:43
digantdesai added a commit that referenced this pull request Jun 25, 2026
The tokenizers submodule bump (#20472) moved the
fbsource//third-party/nlohmann-json dependency onto the tokenizers :headers
target, which is reachable from the OSS buck2 CI build (multimodal_runner_lib
-> text_token_generator -> tokenizers:headers). Since fbsource aliases to
shim_et, this requires a shim_et//third-party/nlohmann-json package, which did
not exist (only re2 had one).

Add the shim, mirroring shim_et//third-party/re2, aliasing nlohmann-json to the
header-only nlohmann_json target added to the tokenizers submodule
(meta-pytorch/tokenizers#201), and bump the submodule pin to include it. Also
wire the nlohmann_json external dep in env_interface.bzl to the same target so
hf_tokenizer/tekken resolve under OSS buck instead of dropping the dep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants