Skip to content

MoE cache and CPU expert refactor #671

Open

Description

@jason-fxz

Tracks the refactor of the MoE expert cache and the CPU expert path: mixed quant formats per layer, GGUF experts, batch-size > 1 decode and AMD support.

Where it stands

  • The GPU slot cache is one LRU pool shared by all MoE layers and assumes one bank layout (one quant_format, one bank schema) for the whole model.
  • The engine takes the quant method of the first MoE layer for every layer.
  • The CPU expert executor serves one weight format per model.

Work items

Cache

  • Slot pools: per-layer pools and pools per bank layout, sized equally or from an expert-use profile. @jason-fxz
  • Bank sets that differ per layer, e.g. NVFP4 layers next to BF16 layers left unquantized. Slot pools key a layout by dtype and row shape over one bank schema, so they cover GGUF mixes (same banks, different row widths) but not formats with different banks. @jason-fxz

Mixed quant per layer

  • Carry the quant format per layer: the engine reads each layer's quant method, loaders and FTW checkpoints record it, and the CPU executor picks a format per (layer, bank).

CPU expert executor

GGUF experts

  • CPU: vendor ggml-cpu quants under kernels/gguf/, built once per ISA tier, behind one GgufFormat(ggml_type); every type with a ggml-cpu vec_dot works through ggml's type traits. One generic gguf bank schema (gate_up, down).
  • GPU: prefill and hybrid need GPU kernels per GGUF type; today they cover Q4_0, Q8_0 and Q6_K.

AMD

Activity

  1. added
    featureNew feature or request
    and removed
    featureNew feature or request
    on Oct 13, 2026
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions