Fix batch quantized rotating cache decode#1
Open
Thump604 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the batch quantized rotating cache path used by MLLM continuous batching when KV quantization and bounded KV caches are enabled together.
Three bugs were exposed by a real Qwen 3.6 VLM media-path smoke under
--max-kv-size 65536 --kv-cache-quantization --kv-cache-quantization-bits 8:QuantizedRotatingSDPACachedid not exposemerge(), so MLLM per-request cache merge failed immediately.BatchQuantizedRotatingSDPACache.make_mask()built mask width from logicaloffset; multimodal position progress can exceed the visible K/V buffer length, causing mask/K shape mismatches.BatchQuantizedRotatingSDPACache.merge()returns compact visible buffers, but decode writes did not grow those buffers before appending the next token.Validation
python -m pytest tests -q->95 passedrouting=mllm_batch,kv_quantize=true, non-empty image description.--disable-prefix-cache --no-memory-aware-cache --kv-cache-quantization --kv-cache-quantization-bits 8, all validated, no server errors, prefix cache stayed at zero entries/zero MB, Metal active returned to 41.0GB with 43.59GB peak.Notes
This is part of the issue #442 follow-up in
vllm-mlx. It does not by itself prove every long-run memory report is closed, but it removes the MLLM media-path crashes found while validating the cache-off control fix.