Skip to content

metal, serve: Qwen3-Coder-30B-A3B's MLX folder runs; a vocabulary that adds no BOS may name none - #886

Merged
midagedev merged 3 commits into
mainfrom
mac-coder
Oct 27, 2026
Merged

midagedev merged 3 commits into
mainfrom
mac-coder

Conversation

@midagedev

Copy link
Copy Markdown
Owner

What

mlx-community/Qwen3-Coder-30B-A3B-Instruct-4bit opens and runs on Metal, through --hf or -m <folder>. Its shapes
are the Qwen3-30B-A3B's we run; its 1,351 tensor names, dtypes and shapes equal the 2507 folder's.

  • Config keys (model-hf qwen3moe): qkv_bias, use_qk_norm and shared_expert_intermediate_size are read only
    at the values the model computes (false, true, 0). Any other value is refused by name. generation_config's
    repetition_penalty is a sampling default, like temperature.
  • No BOS. Coder's folder names no BOS id. unsloth's Coder GGUF has no bos_token_id key either, and
    add_bos_token is false.
    • serve: Tokenizer::bos() is now Option<u32>. bos_to_prepend refuses by name a vocabulary that adds a BOS and
      names none.
    • served_as_hf requires only the EOS id. The tokenizer still refuses add_bos without a BOS.
    • Embeddings: the media filler is the BOS when there is one. With none, a media span is a named refusal, never
      another id.
    • prepare's clause is re-pinned (PIN(2026-10-28)): add_bos true with no BOS is refused; add_bos false with no BOS
      opens, and its split has no bos key.
  • Docs: docs/mac.md and README list the Coder folder. Tool calls are a limit here; a follow-up PR lifts it.

Evidence

  • FAIL-first:
    • each new refusal on the base code (config.json.qkv_bias is not a key this converter reads; serving requires tokenizer.ggml.bos_token_id; generation_config.json.repetition_penalty is not a key this converter reads);
    • three mutants of the BOS refusals, each red on its test.
  • Second M1 Pro [dev]:
    • generate_metal --hf on the Coder folder (the hub cache's hash check passed on all 13 files) gives sensible
      Python;
    • a bloomery-serve-metal chat gives a correct is_prime;
    • just lab-metal-e2e rc 0;
    • serve, embed, hf, model-hf and tokenizer tests rc 0;
    • clippy -D warnings.
  • Box, fixture tier, --round-ledger: the 83 gates tools/recipes.py reach selects for the changed Rust files, red 0
    (2458 s).

AI use: written and checked with Claude Code.

🤖 Generated with Claude Code

midagedev and others added 3 commits October 28, 2026 04:04
…e model computes

qkv_bias false, use_qk_norm true and shared_expert_intermediate_size 0 are
taken; any other value is refused by name. generation_config's
repetition_penalty is a sampling default like temperature. The Coder folder's
config joins the quant-config fixtures; its tensor names, dtypes and shapes
equal the 2507 folder's, so the header fixture is shared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tokenizer::bos() is Option<u32>. bos_to_prepend refuses by name a vocabulary
that adds a BOS and names none; served_as_hf requires only the EOS id, and the
tokenizer keeps refusing add_bos without a BOS. The embeddings' media filler
is the BOS when there is one and a named refusal when there is none, never
another id. Qwen3-Coder's folder and unsloth's GGUF name no BOS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added documentation Improvements or additions to documentation model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja serve The HTTP server: crates/serve labels Oct 27, 2026

@github-actions github-actions Bot 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.

Verdict: CLEAN: I found no failure path, duplicate, unneeded element or unpinned gate; three small non-blocking items follow.

Non-blocking

⚠ A test pins a refusal that another test owns: crates/serve/src/vocab.rs:314. The last lines of a_vocabulary_names_no_bos_only_where_it_adds_none call tokenizer::Tokenizer::from_keys with add_bos true and no BOS. That is the tokenizer crate's refusal (crates/tokenizer/src/vocab.rs:508), and crates/tokenizer/src/lib.rs:1437 already tests it. No serve code runs in those lines. Drop them; the first half still turns red if Vocab::new requires a BOS again.

⚠ The PIN date is later than the review date: crates/model-hf/src/bin/prepare.rs:867 says PIN(2026-10-28), and the review runs on 2026-10-27. If the author's date is the merge day, nothing to do. Otherwise, set it to the day the value changed.

⚠ The evidence row for the new folder is missing: docs/mac.md:57 is a new row, and the same file says each row's evidence is in contrib/mac.md section 1.1. docs/contrib/mac.md has the 2507 row and no Coder row. The M1 Pro run is in the PR body only. Copy it there, with the machine, the commit and the commands.

Checked

  • Duplicates: 9 new items checked (bos_to_prepend, NoBosTokenizer, with_no_bos, the filler refusal, the three config keys, the new tests). Grep finds no existing owner. The dryer reported 0 pairs.
  • Complexity: crapper flagged no function.
  • Silent failure: 7 sites followed. prompt_ids and embeddings::assemble refuse an add_bos vocabulary with no BOS by name (HTTP 500 in the test). A media span with no filler is refused by name. served_as_hf still compares a missing BOS key against the header (a mismatch is an error). bos_text becomes empty only when no BOS exists, which is what the template sees. The three Only keys refuse other values by name. Tokenizer::bos has 7 implementors, all in crates/serve, and all are updated.
  • Tests, mutants: flip bos_to_prepend to Ok(None) for add_bos with no BOS: the api and embeddings tests turn red. Make Vocab::new require a BOS: the vocab test turns red. Drop the filler ok_or_else: the request.rs and embeddings tests turn red. Drop qkv_bias from the map: the refusal loop turns red.
  • Gates: one pin moved, the BOS clause in prepare.rs, with PIN, reason and FAIL-first in the PR body. The config refusals are new, not relaxed.
  • Performance: no hot path. The change is in load, request parsing and docs.
  • Escape catalog: no match (no shell changes).

Notes

/props for the Coder folder returns bos_token as empty text, which fits add_bos_token false. The PR body has no nvidia-smi line (the run is on an M1 Pro), so I record no GPU evidence.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@midagedev
midagedev merged commit e009acd into main Oct 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja serve The HTTP server: crates/serve

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant