Repository navigation
Closed
Labels
area:coremlxcel-core: MLX FFI, primitives, KV cache, layersarea:inferenceGeneration, sampling, decoding (incl. speculative, DRY)priority:backlogFuture considerationsstatus:doneCompletedtype:performancePerformance improvements
Milestone
Description
Summary
Extend the quant/cache advisor to recommend a KV-cache mode (fp16, int8, turbo4, turbo4-asym, or turbo3) per model family and context range, prioritizing long-context and memory-constrained serving.
Source: idea.md "8. TurboQuant Advisor Expansion" (P3, expected payoff mostly memory with possible speed, risk low-medium).
Current state
- Turbo KV cache modes can reduce memory bandwidth and long-context footprint, but the docs treat them as workload-dependent and require real-model validation (
docs/turbo-kv-cache.md). - Project rule (CLAUDE.md / AGENTS): preserve bf16 scales and biases for quantized models. Any advisor recommendation must NOT reintroduce bf16 to f16 promotion for quantized weights.
Proposal
- Extend the advisor to recommend
fp16,int8,turbo4,turbo4-asym, orturbo3per model family and context range. - Keep recommendations opt-in or advisory until each family has decode quality and throughput coverage.
- Prioritize long-context serving and memory-constrained devices over short single-request decode.
Validation
scripts/bench_kv_cache.sh-style sweeps at contexts 4k/16k/32k.- Real-checkpoint smoke tests across at least two dense and two MoE/VLM families.
- Quality guard: compare short deterministic outputs and longer perplexity-like token-logprob traces where available.
Acceptance criteria
- The advisor emits a per-family and per-context-range KV-mode recommendation among the five modes.
- Recommendations are advisory/opt-in until a family has quality and throughput coverage.
- No recommendation reintroduces bf16 to f16 promotion for quantized weights.
- KV-cache sweeps recorded at 4k/16k/32k for at least two dense and two MoE/VLM families.
- Quality guard documented (short deterministic plus longer logprob-trace comparison).
Risk and priority
idea.md priority P3; risk low-medium. The main gain is memory capacity and bandwidth, not guaranteed raw tok/s; it is still useful for high-context deployments where KV-cache pressure dominates.
References
- idea.md "8. TurboQuant Advisor Expansion".
docs/turbo-kv-cache.md,scripts/bench_kv_cache.sh. Project rule: preserve bf16 scales/biases for quantized models.
Metadata
Metadata
Assignees
Labels
area:coremlxcel-core: MLX FFI, primitives, KV cache, layersarea:inferenceGeneration, sampling, decoding (incl. speculative, DRY)priority:backlogFuture considerationsstatus:doneCompletedtype:performancePerformance improvements
Activity