Skip to content

Add FP8 KV-cache support - #28392

Open
ORippler wants to merge 24 commits into
masterfrom
osimons/ocp_fp8_kv
Open

ORippler wants to merge 24 commits into
masterfrom
osimons/ocp_fp8_kv

Conversation

@ORippler

@ORippler ORippler commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

Add support for OCP-FP8-based KV-caches. Run-time, static per-tensor scales are supported, but optional.

Additional information

https://huggingface.co/nvidia/Mistral-Medium-3.5-128B-NVFP4 is an example for a model with non-unit-scaled FP8-KV-cache

  • Used graph-level scaling/multiplication instead of modifying ggml_flash_attn_ext. This matches the ownership-model we have in place for NVFP4/FP8, and makes it easier to share FP8 logic across FA and standard attention layers.
  • Added E2E tests for:
    • conversion + loading
    • context shifts
    • general correctness of FP8-scaled KV caches

would love to get input from @ggml-org/ci if our CI can handle this.

Requirements

@github-actions github-actions Bot added testing Everything test related examples conversion labels Sep 4, 2026
@ORippler
ORippler force-pushed the osimons/ocp_fp8_kv branch 2 times, most recently from 51f6a0f to b5f3dfd Compare October 1, 2026 13:55
@ORippler
ORippler force-pushed the osimons/ocp_fp8_kv branch from c802335 to 4602e64 Compare October 1, 2026 15:59
@ORippler
ORippler force-pushed the osimons/ocp_fp8_kv branch from 4602e64 to 10e80e6 Compare October 9, 2026 19:14
@ORippler
ORippler marked this pull request as ready for review October 13, 2026 15:35
@ORippler
ORippler requested review from a team, CISC and ggerganov as code owners October 13, 2026 15:35
Comment thread src/llama-graph.cpp Resolved
Comment thread src/llama-context.cpp Resolved
@ORippler

ORippler commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator Author

Comment thread src/llama-graph.cpp Resolved
Comment thread src/llama-model.h Resolved
While fused KQV is currently impractival for non-shared scales, this is
an improvement for future use regardless
They belong there as they are not just a test for ggml's backend ops

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conversion devops improvements to build systems and github actions examples testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants