Metal GLM MTP batch verification updates hotness without advancing its decay clock

Aperta
#1,271 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
c, machine-learning
Ambito
ai, backend

Direzione di ricerca

Read ds4_gpu_stream_expert_cache_prepare_selected_batch() and ds4_gpu_stream_expert_cache_note_token() in the Metal GLM verifier on main (ee7e840). Trace where batched selections update hotness without advancing g_stream_expert_cache_decode_tokens. Done means a scoped accounting API that ticks the decay clock for verified target rows, with tests for scalar, rejected and prefill cases.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

In Metal SSD streaming, successful two-row GLM MTP verification updates expert route frequency without advancing g_stream_expert_cache_decode_tokens for those target rows. The route-hotness decay clock therefore can remain nearly stationary through a long MTP response.

I reproduced this in an isolated local engine derived from 5379c1c; the relevant call structure is still present in current main (ee7e840). ds4_gpu_stream_expert_cache_note_token() is called from scalar expert paths, while ds4_gpu_stream_expert_cache_prepare_selected_batch() records the batched selections' hotness without a matching target-row tick. This report concerns the Metal GLM verifier, not every speculative backend.

Observed on M4 Max, 128 GiB, Metal SSD streaming, 32K context and a fixed 64 GiB expert cache:

Two complete greedy responses Unmodified accounting Experimental accounting
Output tokens 352 352
Target work clock after the responses 3 377
Additional target rows accounted 0 374
Last decay position effectively stalled 369

The experiment counted completed target-verifier rows, including rejected proposal positions; it subtracted scalar rows already counted inside the same verifier scope. It ended the scope before draft evaluation and rejection replay. Short-path accounting also matched the independently logged verification-row count. Corresponding greedy output, hidden-state and logits digests remained identical.

This is not an established speedup. Two-response generation time was 141.617 s for the original MTP and 145.263 s with accounting alone. Logical pread volume fell substantially, but most reads could be satisfied by the OS cache; logical bytes must not be presented as physical SSD traffic. Combining accounting with a separate slot-selection experiment only brought MTP approximately level with ordinary decoding. I have not enabled these experiments in the normal runtime.

A possible fix is a narrowly scoped target-work accounting API around successful batch verification, with protection against double counting and counter overflow. It needs a design decision about the clock's intended meaning and tests for scalar fallback, rejected proposals, prompt prefill and draft exclusion before becoming a default. I am reporting the reproducible accounting mismatch separately rather than proposing the experimental performance switches as a production patch.

These measurements are from the retained October 23 experiment, not a fresh full-model run on the current upstream tree. CUDA/ROCm and multi-GPU behavior were not tested.

Lingua principale
C
Stelle
24.4k
Fork
2.4k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di antirez/ds4

Tutte le issue di antirez/ds4

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.