Skip to content

Comments

[Cherry-Pick][BugFix] Fix misleading logging in worker_process for request counting (#5939)#5953

Merged
Jiang-Jia-Jun merged 3 commits intorelease/2.4from
copilot/cherry-pick-pr-5939-again
Jan 9, 2026
Merged

[Cherry-Pick][BugFix] Fix misleading logging in worker_process for request counting (#5939)#5953
Jiang-Jia-Jun merged 3 commits intorelease/2.4from
copilot/cherry-pick-pr-5939-again

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

Motivation

Cherry-pick PR #5939 from develop to release/2.4 branch. The original logging misrepresented metrics: num_running_requests printed the batch slot index (not request count), and num_insert_requests included DECODE requests (not just new inserts).

Modifications

Variable renaming and cleanup:

  • num_running_requestsmax_occupied_batch_index (3 locations: initialization, assignment, function calls)
  • Removed unused req_ids variable initialization

Accurate request counting:

  • Import RequestType to distinguish PREFILL vs DECODE requests
  • Add num_prefill_requests: count of PREFILL requests in current batch
  • Add num_scheduled_requests: total requests scheduled in batch
  • Rename req_idsscheduled_request_ids for clarity

Updated log output:

Before:

logger.info(
    f"Rank: {self.local_rank}, num_running_requests: {num_running_requests}, "
    f"num_insert_requests: {len(req_dicts)}, req_ids: {req_ids}"
)

After:

logger.info(
    f"Rank: {self.local_rank}, num_prefill_requests: {num_prefill_requests}, "
    f"max_occupied_batch_index: {max_occupied_batch_index}, "
    f"num_scheduled_requests: {num_scheduled_requests}, "
    f"scheduled_request_ids: {scheduled_request_ids}"
)

Usage or Command

No usage changes. Logging output now accurately reflects request metrics for debugging and monitoring.

Accuracy Tests

N/A - logging change only, no model output affected.

Checklist

  • Add at least a tag in the PR title.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Reason: Logging output change only. Original PR validated with mock requests covering all scenarios.
  • Provide accuracy results. Reason: N/A - logging change only.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.
Original prompt

#5939 这个PR的改动cherry pick进release/2.4分支


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@paddle-bot
Copy link

paddle-bot bot commented Jan 8, 2026

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Jan 8, 2026
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

…unting (PR #5939)

Co-authored-by: Jiang-Jia-Jun <163579578+Jiang-Jia-Jun@users.noreply.github.com>
Copilot AI changed the title [WIP] Cherry pick changes from PR #5939 into release/2.4 branch [Cherry-Pick][BugFix] Fix misleading logging in worker_process for request counting (#5939) Jan 8, 2026
Copilot AI requested a review from Jiang-Jia-Jun January 8, 2026 08:50
@Jiang-Jia-Jun Jiang-Jia-Jun marked this pull request as ready for review January 8, 2026 09:30
@Jiang-Jia-Jun
Copy link
Collaborator

@copilot Your PR code style check failed.
Please install pre-commit locally and set up git hook scripts:

pip install pre-commit==4.2.0
pre-commit install

Then, run pre-commit to check codestyle issues in your PR:

pre-commit run --files fastdeploy/worker/worker_process.py

Co-authored-by: Jiang-Jia-Jun <163579578+Jiang-Jia-Jun@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 8, 2026

@copilot Your PR code style check failed.
Please install pre-commit locally and set up git hook scripts:

...

Fixed in commit 782b4f3. Removed the unused req_ids variable that was causing the flake8 failure. All pre-commit checks now pass.

Copilot AI requested a review from Jiang-Jia-Jun January 8, 2026 11:01
@Jiang-Jia-Jun Jiang-Jia-Jun merged commit 37bed64 into release/2.4 Jan 9, 2026
14 of 18 checks passed
@Jiang-Jia-Jun Jiang-Jia-Jun deleted the copilot/cherry-pick-pr-5939-again branch January 12, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants