Skip to content

feat(engine): add BPE tokenizer and offline asset tooling - #197

Merged
chamsechan merged 2 commits into
mainfrom
feat/bpe-tokenizer
Oct 14, 2026
Merged

chamsechan merged 2 commits into
mainfrom
feat/bpe-tokenizer

Conversation

@chamsechan

@chamsechan chamsechan commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Adds a shared BPE tokenizer and deterministic .eftok asset tooling for the supported Qwen2.5 and Gemma3 tokenizer pipelines. Tokenization remains an internal Model Execution helper, with immutable mapped assets, Unicode normalization, byte-level pretokenization, added-token handling, and HF-compatible decoding.

The compiler preserves merge ranks, or uses compact score data only when it verifies an equivalent total merge order. It rejects unsupported components and incomplete base-vocabulary byte fallback. Differential verification rejects missing output, and loading tests isolate temporary files for parallel execution.

This delivers S1 only. The plan records the later tensor-graph LLM work; that Model and its end-to-end configurations are not introduced here. The documented NFC complexity matches the implementation's O(n log n) sorting.

Validation:

  • Canonical local gate: 429 registered tests, 426 passed and 3 optional-asset skips; rerun by the delivery script before committing.
  • Focused BPE tests with real assets: 28/28 passed; ASan/UBSan parallel run: 28/28 passed.
  • HF differential: 1,866 encoding cases per model, plus 3,800 Qwen and 6,800 Gemma decoding cases, all matching.
  • Regenerated both tokenizer assets and confirmed their bytes and SHA-256 values match the manifest.
  • Independent review confirmed the score-order check, output completeness, byte fallback, test isolation, and long NFC input fixes.

The two BPE tests skipped by the default gate were run with real assets in the focused and sanitizer checks. The optional real GGUF test remains skipped because its asset was not supplied.

chamsechan and others added 2 commits October 14, 2026 14:52
Plan a generic BPE tokenizer organized by algorithm components rather than
by model, with per-model .eftok files choosing rank or score merge priority,
and a tensor_graph text-generation Model that needs no new Backend.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chamsechan
chamsechan merged commit c8ac8f2 into main Oct 14, 2026
6 checks passed
@chamsechan
chamsechan deleted the feat/bpe-tokenizer branch October 14, 2026 10:14
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.

1 participant