Skip to content

perf(core): extend the quant/KV-cache advisor to recommend Turbo KV modes per family and context #327

Closed

Description

@inureyes

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, or turbo3 per 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.

Activity

  1. added
    type:performance
    priority:backlog
    area:core
    area:inference
    status:in-progress
    status:review
    status:done
    and removed
    status:in-progress
    status:review
    on Jun 17, 2026
  2. added this to the 0.3 milestone on Jun 21, 2026
  3. self-assigned this
    on Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:corearea:inferencepriority:backlogstatus:donetype:performance

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions