Skip to content

ggml-spacemit: track draft-MTP backend correctness and validation #77

Open

Description

@Gingkoleaves

Scope

Track correctness and backend coverage for the existing draft-mtp implementation on SpacemiT, starting with Qwen3.5-0.8B Q8_0. The speculative decoding framework already exists; this work concerns CPY layouts and Q8_0 IME2 execution/readback used by the target and MTP graphs.

Problems covered by the candidate

  1. CPY transpose wrapper extents and overly broad supported-layout claims.
  2. CPY batch-stride validation against the dense plane size, including singleton dimensions.
  3. Q8 IME2 four-row accumulation/scaling order.
  4. Q8 IME2 four-row tail stores.
  5. Canonical Q8_0 readback/copy behavior for repacked tensors.
  6. Keeping scalar Q8_0 inputs in canonical layout and rejecting unsafe packed views.

A six-commit candidate is available on Gingkoleaves/llama.cpp:ospp/mtp-after-scale. These are backend correctness changes, with a host CPY regression test; no new public API or replacement MTP framework is proposed.

Dependencies and related work

Evidence and current limits

  • Public base: e50504b54a4fe5d4b2314ffaf57583ffc4cf9a6b; combined SCALE + six-fix tree: e1cea1c337ea66462cc1a2c0c9e460c7a4b9e9b2. The uploaded trees match the prepared local commits exactly.
  • Fresh host regression: python3 tests/spacemit-review/test_cpy_transpose_bounds.py passes 1,872 shape configurations and 4,096 paired batch-stride configurations; dimension-swap and prior singleton-stride mutations are rejected. This checks production guard/wrapper addresses and bytes, not RVV assembly or full graph execution.
  • Saved K3 short-run evidence for the recomposed e50504b candidate records 6/6 checks and 4/4 synthetic MoE operator checks. The earlier full K1/K3 30/30 evidence belongs to the e0804fe combined candidate, not this newly published commit chain.
  • Full-model 35B testing, full CI, and fresh per-change performance attribution are not complete. Synthetic MoE fixtures do not substitute for a full-model run.

Validation to complete

Use identical model bytes, prompt tokens, sampling settings and generation limits for MTP off, draft maximum 2 and 3; retain token IDs, text, stop conditions, proposals and accepted prefixes. Save exact source trees, toolchains, runtime libraries and backend placement evidence.

The Chinese/English acceptance-rate gap remains under investigation. Compare generic CPU (x86 or RISC-V without the SpacemiT backend) and K3 on multiple frozen prompt sequences and the same prefixes, logging draft/target top-1 and prefix acceptance at each step. A backend precision defect is not established merely by different aggregate acceptance rates.

The candidate will remain a draft pending review and remaining native validation.

AI assistance was used for implementation, test preparation, evidence review, and this report.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions