Skip to content

Conversation

@hnyls2002
Copy link
Collaborator

@hnyls2002 hnyls2002 commented Nov 10, 2025

Partially revert #12959, which removes the function process_prefill_chunk and breaks PP's event loop.

H20 CI (PP included) is passed

image

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @hnyls2002, 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 partially reverts a previous change (PR #12959) to fix a critical issue that was breaking the prefill event loop. It restores essential functionality for processing chunked prefill requests by refactoring the relevant logic into a new, dedicated method. This ensures that the system correctly manages request states and KV cache transfers during disaggregated prefill operations, thereby stabilizing the event loop.

Highlights

  • Restored Prefill Event Loop Functionality: The process_prefill_chunk logic, which was previously removed and caused issues with the prefill event loop, has been reintroduced to ensure proper operation.
  • Code Refactoring: The logic for handling chunked prefill requests has been extracted from the get_next_disagg_prefill_batch_to_run method into a new, dedicated method named process_prefill_chunk for better organization and maintainability.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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

  1. 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.

Copy link
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 correctly reintroduces the process_prefill_chunk function, which appears to be a critical fix for the pipeline parallelism event loop. The refactoring of moving the chunk processing logic into its own method is a good step for code clarity. I have one suggestion to further improve the maintainability of this sensitive logic by removing a redundant flag reset.

self.send_kv_chunk(self.chunked_req)
# chunked request keeps its rid but will get a new req_pool_idx
self.req_to_token_pool.free(self.chunked_req.req_pool_idx)
self.running_batch.batch_is_full = False
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This line self.running_batch.batch_is_full = False appears to be redundant. The event loops that call this function, event_loop_normal_disagg_prefill (L352) and event_loop_overlap_disagg_prefill (L385), already reset this flag at the end of each iteration.

The HACK comments in those loops indicate this is a critical piece of logic to prevent hangs. Centralizing this flag reset in the event loops and removing it from here would improve maintainability and reduce the risk of confusion. The logic would be safer and easier to reason about if the reset happens in one canonical place.

@hnyls2002 hnyls2002 force-pushed the lsyin/fix-pp-ci branch 2 times, most recently from d4a9491 to 4c305e6 Compare November 10, 2025 16:49
@hnyls2002 hnyls2002 merged commit f1f4c45 into main Nov 10, 2025
46 of 110 checks passed
@hnyls2002 hnyls2002 deleted the lsyin/fix-pp-ci branch November 10, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants