Repository navigation
Support quantized kv cache for Minimax M3 - #26180
Conversation
|
/bot review |
Automated code reviewStatic review complete. Here's the review. Review of PR #26180: Support quantized kv cache for Minimax M3The change is small, single-purpose, and addresses a documented issue (#26155). It mirrors the rotation pattern already used by Correctness (verified)
No correctness, security, or lifetime issues found. Will slow the review(point 1) No test exercises the path this PR enables. Nits(point 2) Optional: a one-line comment noting that the index branch is intentionally left un-rotated (because (point 3) The removed blank line at the second SummaryNo blocking issues. The logic is correct and the approach reuses the established This review was generated automatically by pi coding agent using |
am17an
left a comment
There was a problem hiding this comment.
@ngxson probably need to add this in skill for adding new models.
Check whether quantized kv-cache works since it undergoes a hadamard rotation. If you added a new type of attention mechanism, make sure it to check inp_attn->self_{k,v}_rot
|
Performance degradation, it works 2 times slower after the update |
|
@smalinin I think this may be because you were necessarily running with an unquantized KV cache before. If you are running quantized caches now, could you please try with |
I tested with both q8_0 and f16, the degradation is existed in both cases. |
Overview
The M3 graph calls
ggml_flash_attn_extdirectly instead of going throughbuild_attn. As a result, it did not apply the rotations required for quantized KV cache types, therefore quantized -ctk and -ctv were asserted out.This change should enable quantized KV caches to be used with M3's MSA. Unquantized cache types are unchanged since for those self_k_rot and self_v_rot are null. Should also close #26155
Additional information
Requirements