[NVIDIA] disable chunked prefix cache when dp is used#9861
[NVIDIA] disable chunked prefix cache when dp is used#9861hnyls2002 merged 3 commits intosgl-project:mainfrom
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @kaixih, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces a targeted fix to resolve an accuracy degradation observed when the chunked prefix cache interacts with data parallelism. By conditionally disabling the cache under these specific circumstances, the system's accuracy is restored, ensuring reliable model performance.
Highlights
- Chunked Prefix Cache Disablement: The chunked prefix cache is now disabled when data parallelism (DP) is in use (i.e.,
dp_size > 1). This change is a workaround to address an accuracy issue identified in issue #9806.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request disables the chunked prefix cache when data parallelism is used, which is a workaround for an accuracy issue. The logic is correct. I've suggested a small refactoring to combine the two conditional statements that disable the cache into a single if/elif block. This improves code clarity and conciseness.
| if not self.use_mla_backend: | ||
| server_args.disable_chunked_prefix_cache = True | ||
|
|
||
| if self.dp_size > 1: | ||
| logger.info("Disable chunked prefix cache when dp size > 1.") | ||
| server_args.disable_chunked_prefix_cache = True |
There was a problem hiding this comment.
These two if statements both set server_args.disable_chunked_prefix_cache to True. They can be combined into an if/elif structure for better readability and to avoid a redundant assignment.
| if not self.use_mla_backend: | |
| server_args.disable_chunked_prefix_cache = True | |
| if self.dp_size > 1: | |
| logger.info("Disable chunked prefix cache when dp size > 1.") | |
| server_args.disable_chunked_prefix_cache = True | |
| if not self.use_mla_backend: | |
| server_args.disable_chunked_prefix_cache = True | |
| elif self.dp_size > 1: | |
| logger.info("Disable chunked prefix cache when dp size > 1.") | |
| server_args.disable_chunked_prefix_cache = True |
|
@kaixih The accuracy issue is only reported on flashinfer backend, so maybe we should disable chunked prefix cache for flashinfer backend + dp. On fa3 backend it should work well as before so no need to disable for dp. |
Sure. I tested it and found that the accuracy issue also occurs with |
|
@zhyncs Can we merge? |
Revert "[NVIDIA] disable chunked prefix cache when dp and blackwell is used (sgl-project#9861)" This reverts commit 90dfe3d.
This PR is to work around an accuracy issue found in #9806.
It seems the chunked prefix cache doesn't work well with the DP. So, we disable it for now to recover the accuracy.
cc @trevor-m @kushanam @zhyncs