Skip to content

[Core] Default prefix_cache_retention_interval to dense for Mamba + EAGLE - #55760

Merged
khluu merged 1 commit into
vllm-project:releases/v0.29.0from
ZJY0516:mamba-eagle-retention-default
Sep 8, 2026
Merged

khluu merged 1 commit into
vllm-project:releases/v0.29.0from
ZJY0516:mamba-eagle-retention-default

Conversation

@ZJY0516

@ZJY0516 ZJY0516 commented Sep 7, 2026

Copy link
Copy Markdown
Member

Purpose

#52216 promoted prefix_cache_retention_interval to an argument and changed the default from None (dense) to 0 (sparse: keep only the latest replay boundary). This default is unfriendly to Mamba + EAGLE: with sparse retention, only the latest replay boundary keeps a Mamba state checkpoint, and EAGLE additionally drops the tail block from prefix-cache hits, leaving Mamba checkpoints largely unreachable — prefix caching never hits for the Mamba cache group (see #53504 for a production report of 0 hit tokens).

This PR keeps the public argument unchanged (int | None, default 0) and only changes how an unset value is resolved: EngineArgs.prefix_cache_retention_interval now defaults to a private sentinel (or the deprecated VLLM_PREFIX_CACHE_RETENTION_INTERVAL env var when set), so create_engine_config can tell an unset value apart from an explicit one and resolve it once the model and speculative-decoding configurations are known:

Explicitly configured values are always respected: --prefix-cache-retention-interval 0/N/None and the deprecated env var all override the resolution.

Only vllm/engine/arg_utils.py is touched on the product side; CacheConfig, VllmConfig, and the CLI surface are unchanged.

Not a duplicate: open PRs in this area (#54713, #53479, #55403) change retention/blocking mechanics for Mamba under EAGLE; none restore the pre-#52216 dense default for this combination.

Test Plan

.venv/bin/python -m pytest tests/config/test_config_utils.py tests/v1/engine/test_engine_args.py tests/engine/test_arg_utils.py -q
.venv/bin/python -m pytest tests/v1/core/test_prefix_caching.py -q -k "retention or mamba"

Test Result

132 passed + 27 passed. New parametrized test test_prefix_cache_retention_interval_default_resolution covers: unset -> dense for Mamba+EAGLE, unset -> 0 for Mamba w/o EAGLE / EAGLE w/o Mamba / plain models, explicit 0/None/64 respected, CLI default remains the unset sentinel, and the deprecated env var path. pre-commit run passes on all changed files (ruff, mypy, etc.). tests/v1/engine/test_engine_core_client.py has 11 failures on this machine, all from GPU OOM / HF 403s (real-model GPU tests), unrelated to this change.


This change was made with AI assistance (Kimi Code); all changed lines were reviewed and the tests above were run by the submitter.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 8d12dd7d-2c57-485b-b18b-d05532de73e4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T17:02:48.552579Z 89fa938 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…AGLE

PR vllm-project#52216 changed the default of prefix_cache_retention_interval from
None to 0. With sparse retention (0), only the latest replay boundary
keeps a Mamba state checkpoint, and EAGLE additionally drops the tail
block from prefix-cache hits, leaving Mamba checkpoints largely
unreachable so prefix caching never hits for Mamba models with
EAGLE-style speculative decoding.

Keep the public argument unchanged (int | None, default 0) and only
change how an unset value is resolved: EngineArgs now defaults the
field to a private sentinel (or the deprecated
VLLM_PREFIX_CACHE_RETENTION_INTERVAL env var when set) so that
create_engine_config can tell an unset value apart from an explicit
one and resolve it once the model and speculative-decoding
configuration are known: dense (None) for Mamba models with
EAGLE-style speculative decoding, 0 otherwise. Explicitly configured
values (0 / N / None / env var) are always respected.

Co-authored-by: Kimi Code
Signed-off-by: zjy0516 <riverclouds.zhu@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants