You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Tokenizer**: M0.1 is closed. The vendored GB10 BPE artifact and special-token contract exist for vocab=65536 with id7=<CODE_START>, id45=<FIM_INSTRUCTION>, id46=<SPACE>, id47=<NL>. Encode normalizes whitespace runs ([\r\n]+-><NL>, [ \t]+-><SPACE>); decode is plain token concat with sentinel substitution. Same wrapper deployed on Mac and gb10/CUDA side.
46
-
-**Inference / generation**: temperature/top-k/top-p sampling, eager no-KV full-prefix generation, contiguous KV-cache generation/streaming, paged KV scheduler metadata with fail-closed model-integration guard, contiguous prompt-cache reuse, fail-closed standard MTP/draft-output guard, and prompt-only FIM/iFIM infilling constructionexist locally. Still open: model-integrated paged attention/API serving, sliding-window/SSM prompt-cache safety, integrated FIM decode/postprocess loop, speculative/self-spec decode, q4 path, and KV-q4 path.
-**Quantization**: bf16 only; no mx.quantize integration, no q4 inference path.
48
48
-**Structural parity anchors, not CUDA tensor parity**: existing tests/test_cppmega_parity_anchors.py checks NAM56R route/layer constants, DSA/MLA layer derivation, vocab/MoE anchors, fail-closed parity wording, and optional sibling cppmega source-anchor presence when that checkout exists. The source-file existence check is only one guard; the test is broader than file-presence coverage, but it still does not compare CUDA golden tensors or prove numerical agreement.
- Speculative decoding references: vanilla acceptance-rejection and MTP self-spec now have scoped eager MLX loops; EAGLE-2 remains pattern-only/gated until simpler paths underperform.
72
72
- Tokenizer/FIM intent is a source reference only: live local/GB10 artifacts use the deployed M0.1 contract documented below (id7=<CODE_START>, id45=<FIM_INSTRUCTION>, id46=<SPACE>, id47=<NL>), and M0.1 decode parity is covered by the explicit <SPACE>/<NL> token redesign rather than HF reversible round-trip decode.
@@ -884,7 +884,7 @@ Excluded as Hopper-only dead-end on Metal: cppmega/megatron/cute_dsl_mimo/ (sm_9
884
884
166.**SCOPED DONE**: add prompt-only FIM-aware infilling in cppmega_mlx/inference/infilling.py (PSM/SPM token routing plus iFIM id45 prefix). This constructs inference prompts ending at <FIM_MIDDLE> only; it does not append the target middle/EOT, run generation, post-process the generated span, or add a KV/paged decode loop.
885
885
167.**SCOPED DONE**: add `generate_tokens_speculative(...)` in `cppmega_mlx/inference/generation.py`, exported from `cppmega_mlx.inference`. The eager batch=1 loop lets a draft model propose a bounded token window, verifies with one target-model full-prefix forward over K+1 logits, and applies the existing Leviathan-style acceptance-rejection helper before appending accepted tokens plus target fallback/tail. This is greenfield MLX work because cppmega CUDA does not implement speculative decoding. It is not KV-cache/paged speculative serving, EAGLE-2, MTP self-speculation, throughput/quality benchmarking, or GB10/CUDA parity.
886
886
168. Add EAGLE-2-style draft head (separate small draft model, GQA-aware) referencing nanochat/experiments/sota_impl/eagle2/. Gated; defer if MTP self-speculation already meets the throughput target.
887
-
169.Add self-speculative decoding via MTP (FastMTP-aligned: same model emits draft tokens via its MTP heads, target verifies in one extra forward) referencing nanochat/mtp_draft.py. Cheapest of the three since MTP head already lands in Stream H; benchmark first.
887
+
169.**SCOPED DONE**: add `generate_tokens_mtp_self_speculative(...)` in `cppmega_mlx/inference/generation.py`, exported from `cppmega_mlx.inference`. The eager batch=1 loop uses the model-owned `mtp_head` to draft a bounded K-token window from the last verified hidden state, verifies the candidate prefix with one normal target forward over K+1 logits, and reuses the Leviathan-style acceptance-rejection helper. It supports the real `MinimalMTPHead` fallback plus explicit `mtp_head.draft(...)` adapters, and fails closed when no trained MTP head is attached or the requested draft window exceeds `mtp_head.config.depth`. This is not KV-cache/paged self-speculative serving, EAGLE-2, token recycling, throughput/quality benchmarking, or GB10/CUDA parity.
888
888
170.**SCOPED DONE (local streaming slice)**: add `GenerationChunk` and `stream_generate_tokens(...)` in `cppmega_mlx/inference/generation.py`, exported from `cppmega_mlx.inference`. Covered eager full-prefix and contiguous-KV token streaming, batched rows, all-rows EOS stopping, optional per-token text decode, zero-new-token no-op, package export boundary, quantized-KV fail-closed behavior, and paged-attention non-integration guard. This is not full mlx-lm registry export, model-integrated paged attention, prompt cache, q4/KV-q4, speculative/self-spec decoding, OpenAI serving, throughput/quality/long-context benching, or GB10/CUDA parity.
889
889
171.**SCOPED DONE (contiguous prompt-cache reuse)**: add PromptCacheEntry, clone_contiguous_kv_cache(...), build_prompt_cache(...), and generate_tokens_with_prompt_cache(...) for repeated-prefix reuse on the Mac-local contiguous KV path. Covered build/reuse, suffix decode, prefix mismatch fail-closed behavior, zero-new-token no-op, package exports, independent cache cloning, and real HybridTinyLM prompt-cache-vs-full-KV parity. This is not paged attention, OpenAI serving, sliding-window/SSM safety, q4/KV-q4, speculative decode, or CUDA/H200 parity.
890
890
172. Validate prompt-cache safety with sliding-window/SSM against the installed mlx-lm prompt-cache APIs; do not assume a generic KV cache is safe for every route.
0 commit comments