Skip to content

fix: restore mtp/nextn spec-type names, --mtp-head, and live draft flags in docs/scripts#44

Merged
worthant merged 8 commits into
devfrom
fix/spec-type-aliases
Jul 23, 2026
Merged

fix: restore mtp/nextn spec-type names, --mtp-head, and live draft flags in docs/scripts#44
worthant merged 8 commits into
devfrom
fix/spec-type-aliases

Conversation

@worthant

@worthant worthant commented Jul 23, 2026

Copy link
Copy Markdown
Member

Fixes #34. Fixes the CLI half of #37 — see the caveat below for the rest.

The b10018 upstream sync replaced the fork's speculative CLI with the upstream framework. The Gemma MTP and Qwen NextN paths both live on as draft-mtp, but the fork's spelling of the flags died while README/MTP.md/NEXTN.md and the helper scripts kept advertising them:

  • --mtp-head → invalid argument (Eval bug: #37)
  • --spec-type mtp / --spec-type nextn → unknown speculative type (Misc. bug: #34)
  • --draft-max / --draft-min → removed-arg stubs, --draft-block-size → gone entirely (every doc example and all six run-*.sh helpers)

Changes

  • common: mtp and nextn are accepted spec-type aliases for draft-mtp (harmless duplicates — selection collapses into a bitmask); --mtp-head is an alias of --spec-draft-model/-md. Canonical names in --help stay upstream.
  • docs: all examples use --spec-draft-n-max/--spec-draft-n-min; block-size prose annotated with the N = B - 1 mapping.
  • scripts: helpers translate DRAFT_BLOCK_SIZE to --spec-draft-n-max B-1; Qwen NextN helper defaults to the documented 2/1.
  • gguf-py: import was crashing with AttributeError: MTP_PRE_PROJECTION (dead tensor-mapping entries left behind by the sync's NEXTN_/MASKED_EMBD_ rename) — every conversion script was broken. Entries dropped.
  • src: loading a pre-sync assistant GGUF now fails with an actionable message instead of unknown model architecture: 'gemma4_assistant'.

⚠️ #37 is only half-fixed here — the published Gemma assistant GGUFs are stale

End-to-end verification on the exact model pair from #37 (gemma-4-E2B-it-UD-Q4_K_XL + AtomicChat/gemma-4-E2B-it-assistant.Q4_K_M) shows the published assistant heads predate the sync and are incompatible at three levels: arch name (gemma4_assistant vs gemma4-assistant), kv namespace (nextn_predict_layers, embedding_length_out missing), and tensor layout (single mtp.* projections vs per-block nextn.* — a genuinely different head architecture). A compat shim in C++ is not possible; the files must be regenerated with conversion/gemma.py (which this PR un-breaks via the gguf-py fix) and re-published to the HF collections.

Verification

  • test-arg-parser: all tests OK; import gguf works again
  • The exact command from Eval bug: #37 parses, loads the target model, and fails only on the stale assistant file — now with a clear re-download/reconvert message
  • --spec-type nextn without -md parses and takes the shared-model path
  • Unknown types are still rejected; bash -n clean on all touched scripts

worthant added 6 commits July 20, 2026 21:32
Stabilization: Vulkan build fix, versioning, dev/staging pipeline
Promote dev: NVFP4 quantize target, linux-x64-cuda-13.3 build, GPU smoke CI, laguna test fix
The b10018 upstream sync replaced the fork's speculative CLI with the
upstream framework: the Gemma MTP and Qwen NextN paths both became
draft-mtp, and --mtp-head disappeared. The docs and helper scripts kept
the old names, so every command from README/MTP.md/NEXTN.md failed with
'invalid argument' (#37) or 'unknown speculative type' (#34).

- map 'mtp' and 'nextn' to COMMON_SPECULATIVE_TYPE_DRAFT_MTP (duplicates
  are safe: type selection collapses into a bitmask)
- add --mtp-head as an alias of --spec-draft-model/-md
--draft-max/--draft-min are removed-arg stubs and --draft-block-size no
longer exists; all examples now use --spec-draft-n-max/--spec-draft-n-min
(per-round chain length N = old block size B - 1).
DRAFT_BLOCK_SIZE keeps working (translated to --spec-draft-n-max B-1);
the legacy DRAFT_MAX cap is no longer forwarded for Gemma helpers, and
the Qwen NextN helper defaults to the documented n-max 2 / n-min 1.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 23, 2026
worthant added 2 commits July 23, 2026 20:42
The b10018 sync renamed the assistant tensors to NEXTN_*/MASKED_EMBD_*
(which have their own mapping entries) but left the old MTP_* references
behind; since MODEL_TENSOR.MTP_PRE_PROJECTION no longer exists, importing
gguf crashed with AttributeError — taking every conversion script down
with it.
The published assistant GGUFs predate the sync: different arch name
('gemma4_assistant'), kv namespace, and a different head architecture at
the tensor level (single mtp.* projections vs per-block nextn.*), so
they cannot be loaded by the upstream gemma4-assistant support. Replace
'unknown model architecture' with an actionable message pointing at
re-download/reconversion.
@worthant
worthant merged commit 8389fc5 into dev Jul 23, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conversion documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant