Skip to content

fix(tests): gemma4 assistant mtp fixture - #369

Draft
a-ghorbani wants to merge 3 commits into
mybigday:mainfrom
a-ghorbani:fix/gemma4-assistant-mtp-fixture
Draft

a-ghorbani wants to merge 3 commits into
mybigday:mainfrom
a-ghorbani:fix/gemma4-assistant-mtp-fixture

Conversation

@a-ghorbani

Copy link
Copy Markdown
Collaborator

Assistant MTP tests would pass even though the assistant draft gguf was never downloaded, so the test couldn't actually happen (MTP init failure was recorded as a passing "skipped" check).

This PR ensures the test really runs:

  • models/download.sh now fetches ggml-org/gemma-4-E2B-it-GGUF | mtp-gemma-4-E2B-it-Q8_0.gguf.
  • kv_cache_reuse_test now FAILs (exit 1, with a re-download hint) when a model marked mtp=true can't init MTP, instead of skip-marked-as-pass.

…of skip on missing MTP support

The gemma4 fixture entry claimed mtp=true, but download.sh never fetched
the separate gemma4-assistant draft gguf that assistant-type (mem-shared)
MTP requires — the harness only ever exercised that branch on machines
where the file had been placed by hand. Worse, an MTP init failure was
recorded as a passing 'skipped' check, so the suite stayed green while
mem-shared MTP went untested everywhere else.

- download.sh: fetch ggml-org/gemma-4-E2B-it-GGUF mtp-gemma-4-E2B-it-Q8_0.gguf
  as gemma4.assistant.gguf (the name the tests auto-wire). ggml-org's mtp-*
  files are the canonical llama.cpp conversion of Google's safetensors-only
  assistant weights; spec entries can now carry their own repo (repo|file).
- kv_cache_reuse_test: draft-init failure on an mtp=true model is now a
  FAIL with a re-download hint instead of a skip marked as pass.

Verified: 9/9 MTP checks with the pinned draft + bartowski Q4_K_M target
(draft acceptance 0.66-0.89); missing assistant now exits 1.
loadModel unconditionally overwrote the draft's devices with
speculative.draft.devices, which is always empty (not settable from JS).
A CPU-only target override (devices: ['CPU']) was therefore reset to the
default device list for the draft, whose layers (n_gpu_layers default -1)
then landed on the GPU — on the iOS simulator this aborts in the Metal
draft-decode buffer alloc while the target loads clean.

Only override when the draft carries its own device list.
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