mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1259] [Other] setup: --draft-vocab it - the English/code subset plus the tokens of Italian text #3341
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3341
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1259
Author: @fioruccione
Created: 10/6/2026
Status: 🔄 Open
Base:
main← Head:draft-vocab-it📝 Commits (1)
31c59c4setup: --draft-vocab it - the English/code subset plus the tokens of Italian text📊 Changes
4 files changed (+39 additions, -32 deletions)
View changed files
➕
data/draft_vocab_it.bin(+0 -0)📝
docs/DETAILS.md(+2 -2)📝
setup.py(+9 -6)📝
tools/test_setup_draft_vocab.py(+28 -24)📄 Description
Problem and result
The MTP draft layer can only propose tokens from its subset. With the default
cjksubset, a lot of Italian text (accented words, Italian word pieces) can never be drafted: 24.4% of the token occurrences of an Italian Wikipedia sample are outside the English/code base. So Italian answers get fewer accepted drafts and decode slower than English.This adds
--draft-vocab it, the Italian counterpart offr(#597), built the same way. It is one data file, one entry insetup.py, the tests and the DETAILS.md lines. The default subset (cjk) is unchanged, and nothing changes unless you pass--draft-vocab it.Measured on v0.2.7.1, decode tok/s, median of 6 per cell:
cjk(default)itenIn Italian every
itrun is above everycjkandenrun: +13% to +19% against the default. English and code don't lose anything against the default, and againstenEnglish is 1.7% lower, inside the spread. I've used this exact file (same sha256) in production on my office assistant since early October.Related discussion
This is #1259 again. It was closed in the 0.2.0-beta tracker reset, not rejected. Spanish (#1186) was closed the same way, and a single
latinsubset for accented Latin-script languages (#1963) was withdrawn by its author.If you'd rather have one
latinsubset than one file per language, tell me. I'll build and measure that instead, with Italian, Spanish and French text, before you take either.Approach
data/draft_vocab_it.binisdata/draft_vocab_en.binplus the 14,150 tokens that cover 99% of an Italian Wikipedia sample, 54,675 ids in all. The sample is 3,000 articles ofwikimedia/wikipedia20231101.it(30 blocks of 100 rows at random offsets, seed 42). It was built with the existing tool:On that corpus 0.70% of the occurrences fall outside the new subset (24.38% with
en).DRAFT_VOCAB_MIBgets 179 MiB for IQ3_S, with the same per-id ratio asfr. The two French tests intools/test_setup_draft_vocab.pynow loop overfrandit. The branch is rebuilt by hand on46c152a1(v0.2.7.1), because the old one no longer applied.Validation
Passed:
--spec 4 --spec-min-p 0.5. The only change between arms was--mtp-draft-vocab data/draft_vocab*.bin, and the engine log confirmed each head (draft head over 106299 / 54675 / 40525 tokens). Order cjk it en en it cjk, a fresh server per start, 3 rounds of 4 prompts at T=0 plus 2 at T=0.7, 0 failed requests.python -m unittest tools.test_setup_draft_vocab: 10 tests OK.tools.test_draft_vocab,tools.test_setup_configandtools.test_setup_update: OK.python setup.py --helplists--draft-vocab {cjk,en,cyrillic,fr,it}.Failed:
tests.desktop.test_control_install(3),tools.test_setup_golden(19) andtools.test_setup_unsloth(4) fail on this machine. They fail with the same 26 test names on a clean checkout of46c152a1without this change. They look like machine-dependent golden configs (for example the thread count), so they are not caused by this PR.Not run:
setup.pyinstall from scratch with--draft-vocab it. I only swapped the subset through--mtp-draft-vocab.Limits
One machine, one quant, two Italian prompts, one English prompt and one code prompt. The gain will depend on how much Italian an answer has. The corpus is Wikipedia, so technical or office Italian may cover a little worse.
I did this with an AI coding assistant: it wrote the scripts and helped me read the code. I ran everything on my machine and checked the numbers.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.