fix: unpack prompt_checkpoints in _chunked_next for mlx-lm >= 0.31.0#194
Closed
Thump604 wants to merge 1 commit intowaybarrios:mainfrom
Closed
fix: unpack prompt_checkpoints in _chunked_next for mlx-lm >= 0.31.0#194Thump604 wants to merge 1 commit intowaybarrios:mainfrom
Thump604 wants to merge 1 commit intowaybarrios:mainfrom
Conversation
mlx-lm 0.31.0 added prompt_checkpoints as the 7th element in the BatchGenerator.insert() tuple. _chunked_next only unpacked 6 elements, causing ValueError when prefix cache triggers the chunked prefill path. Fixes waybarrios#178
7b3551c to
6d601b1
Compare
This was referenced Mar 22, 2026
Collaborator
Author
|
CI green. Small fix — unpack |
This was referenced Mar 24, 2026
Collaborator
Author
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
mlx-lm 0.31.0 added
prompt_checkpointsas the 7th element in theBatchGenerator.insert()tuple._chunked_nextonly unpacked 6 elements, causingValueError: too many values to unpack (expected 6)when prefix cache triggers the chunked prefill path.One-line fix: add
_prompt_checkpointsto thezip(*batch_prompts)unpack.Same class of bug as the
_process_promptstuple fix — different code path (_chunked_nextbypasses_process_promptsentirely when prefix cache mid-prefill is active).Reproduction
--enable-prefix-cacheand mlx-lm >= 0.31.0ValueError: too many values to unpack (expected 6)Test plan
--enable-prefix-cache --continuous-batchingon mlx-lm 0.31.xFixes #178