Skip to content

bugfix: fix mtp prefix cache prefill starvation.#1264

Merged
phantomlei3 merged 2 commits intojd-opensource:mainfrom
phantomlei3:bugfix/mtp-prefix-cache
Apr 25, 2026
Merged

bugfix: fix mtp prefix cache prefill starvation.#1264
phantomlei3 merged 2 commits intojd-opensource:mainfrom
phantomlei3:bugfix/mtp-prefix-cache

Conversation

@phantomlei3
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an explicit reference counting mechanism for physical blocks to improve the accuracy of usage tracking, particularly when prefix caching is enabled. It also updates the prefill scheduler to bypass memory threshold checks when using the prefix cache. The review feedback identifies critical thread-safety risks due to non-atomic updates of the new reference counters and notes a style guide violation regarding the use of auto for primitive types.

Comment thread xllm/core/framework/block/block_manager_impl.cpp Outdated
Comment thread xllm/core/framework/block/block_manager_impl.cpp Outdated
Comment thread xllm/core/framework/block/block_manager_impl.cpp Outdated
Comment thread xllm/core/scheduler/prefill_only_scheduler.cpp Outdated
Comment thread xllm/core/framework/block/block_manager_impl.cpp Outdated
@phantomlei3 phantomlei3 force-pushed the bugfix/mtp-prefix-cache branch from 5f34a91 to 83b7791 Compare April 16, 2026 13:10
@phantomlei3 phantomlei3 force-pushed the bugfix/mtp-prefix-cache branch from 83b7791 to 801f372 Compare April 18, 2026 02:18
@phantomlei3 phantomlei3 reopened this Apr 18, 2026
yq33victor
yq33victor previously approved these changes Apr 22, 2026
Copy link
Copy Markdown
Collaborator

@yq33victor yq33victor left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread xllm/core/framework/block/block_manager_impl.cpp
@phantomlei3 phantomlei3 force-pushed the bugfix/mtp-prefix-cache branch from d741666 to 27e07e4 Compare April 23, 2026 07:55
Copy link
Copy Markdown
Collaborator

@RobbieLeung RobbieLeung left a comment

Choose a reason for hiding this comment

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

LGTM

@phantomlei3 phantomlei3 merged commit d394d61 into jd-opensource:main Apr 25, 2026
17 of 35 checks passed
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.

4 participants