[PR #1259] [Other] setup: --draft-vocab it - the English/code subset plus the tokens of Italian text #3341

Open
opened 2026-11-07 14:40:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 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)

  • 31c59c4 setup: --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 cjk subset, 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 of fr (#597), built the same way. It is one data file, one entry in setup.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) it en
Italian answer 1 60.0 [59.0-66.6] 71.2 [68.7-76.0] 64.4 [60.6-66.8]
Italian answer 2 51.7 [48.9-53.4] 58.3 [57.6-60.3] 54.0 [52.8-55.2]
English answer 70.6 [66.9-72.1] 73.9 [73.5-76.7] 75.2 [74.2-75.8]
code 74.5 [67.9-77.5] 80.2 [77.6-81.3] 79.5 [71.1-80.1]
drafts accepted, Italian 1 / 2 63% / 53% 71% / 63% 62% / 52%
draft head in VRAM 212.9 MiB 109.5 MiB 81.2 MiB

In Italian every it run is above every cjk and en run: +13% to +19% against the default. English and code don't lose anything against the default, and against en English is 1.7% lower, inside the spread. I've used this exact file (same sha256) in production on my office assistant since early October.

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 latin subset for accented Latin-script languages (#1963) was withdrawn by its author.

If you'd rather have one latin subset 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.bin is data/draft_vocab_en.bin plus the 14,150 tokens that cover 99% of an Italian Wikipedia sample, 54,675 ids in all. The sample is 3,000 articles of wikimedia/wikipedia 20231101.it (30 blocks of 100 rows at random offsets, seed 42). It was built with the existing tool:

python tools/draft_vocab.py --gguf <UD-IQ4_XS shard 1> --base data/draft_vocab_en.bin --corpus itwiki.txt --coverage 0.99 --out data/draft_vocab_it.bin

On that corpus 0.70% of the occurrences fall outside the new subset (24.38% with en). DRAFT_VOCAB_MIB gets 179 MiB for IQ3_S, with the same per-id ratio as fr. The two French tests in tools/test_setup_draft_vocab.py now loop over fr and it. The branch is rebuilt by hand on 46c152a1 (v0.2.7.1), because the old one no longer applied.

Validation

Passed:

  • Speed, as in the table: v0.2.7.1 built here (CUDA 12.6, sm_89), 2x RTX 4060 Ti 16 GB on a layer split, Threadripper PRO 3975WX, UD-IQ4_XS, MTP --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_config and tools.test_setup_update: OK.
  • python setup.py --help lists --draft-vocab {cjk,en,cyrillic,fr,it}.

Failed:

  • tests.desktop.test_control_install (3), tools.test_setup_golden (19) and tools.test_setup_unsloth (4) fail on this machine. They fail with the same 26 test names on a clean checkout of 46c152a1 without this change. They look like machine-dependent golden configs (for example the thread count), so they are not caused by this PR.

Not run:

  • KL or the quality suite. The draft subset only changes which drafts are proposed, and every draft is still verified by the full model.
  • Any other card or quant, and a full setup.py install 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.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1259 **Author:** [@fioruccione](https://github.com/fioruccione) **Created:** 10/6/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `draft-vocab-it` --- ### 📝 Commits (1) - [`31c59c4`](https://github.com/Niko1221/Strata/commit/31c59c4b87d2f60fcbb2f2b6196f4a4189e1d017) setup: --draft-vocab it - the English/code subset plus the tokens of Italian text ### 📊 Changes **4 files changed** (+39 additions, -32 deletions) <details> <summary>View changed files</summary> ➕ `data/draft_vocab_it.bin` (+0 -0) 📝 `docs/DETAILS.md` (+2 -2) 📝 `setup.py` (+9 -6) 📝 `tools/test_setup_draft_vocab.py` (+28 -24) </details> ### 📄 Description ## Problem and result The MTP draft layer can only propose tokens from its subset. With the default `cjk` subset, 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 of `fr` (#597), built the same way. It is one data file, one entry in `setup.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) | `it` | `en` | |---|---|---|---| | Italian answer 1 | 60.0 [59.0-66.6] | **71.2** [68.7-76.0] | 64.4 [60.6-66.8] | | Italian answer 2 | 51.7 [48.9-53.4] | **58.3** [57.6-60.3] | 54.0 [52.8-55.2] | | English answer | 70.6 [66.9-72.1] | 73.9 [73.5-76.7] | 75.2 [74.2-75.8] | | code | 74.5 [67.9-77.5] | 80.2 [77.6-81.3] | 79.5 [71.1-80.1] | | drafts accepted, Italian 1 / 2 | 63% / 53% | **71% / 63%** | 62% / 52% | | draft head in VRAM | 212.9 MiB | 109.5 MiB | 81.2 MiB | In Italian every `it` run is above every `cjk` and `en` run: +13% to +19% against the default. English and code don't lose anything against the default, and against `en` English 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 `latin` subset for accented Latin-script languages (#1963) was withdrawn by its author. If you'd rather have one `latin` subset 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.bin` is `data/draft_vocab_en.bin` plus the 14,150 tokens that cover 99% of an Italian Wikipedia sample, 54,675 ids in all. The sample is 3,000 articles of `wikimedia/wikipedia` `20231101.it` (30 blocks of 100 rows at random offsets, seed 42). It was built with the existing tool: ``` python tools/draft_vocab.py --gguf <UD-IQ4_XS shard 1> --base data/draft_vocab_en.bin --corpus itwiki.txt --coverage 0.99 --out data/draft_vocab_it.bin ``` On that corpus 0.70% of the occurrences fall outside the new subset (24.38% with `en`). `DRAFT_VOCAB_MIB` gets 179 MiB for IQ3_S, with the same per-id ratio as `fr`. The two French tests in `tools/test_setup_draft_vocab.py` now loop over `fr` and `it`. The branch is rebuilt by hand on `46c152a1` (v0.2.7.1), because the old one no longer applied. ## Validation **Passed:** - Speed, as in the table: v0.2.7.1 built here (CUDA 12.6, sm_89), 2x RTX 4060 Ti 16 GB on a layer split, Threadripper PRO 3975WX, UD-IQ4_XS, MTP `--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_config` and `tools.test_setup_update`: OK. - `python setup.py --help` lists `--draft-vocab {cjk,en,cyrillic,fr,it}`. **Failed:** - `tests.desktop.test_control_install` (3), `tools.test_setup_golden` (19) and `tools.test_setup_unsloth` (4) fail on this machine. They fail with the same 26 test names on a clean checkout of `46c152a1` without this change. They look like machine-dependent golden configs (for example the thread count), so they are not caused by this PR. **Not run:** - KL or the quality suite. The draft subset only changes which drafts are proposed, and every draft is still verified by the full model. - Any other card or quant, and a full `setup.py` install 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3341
No description provided.