Skip to content

[RL] R3 Fix the bug for determining the end of a request#6388

Merged
Jiang-Jia-Jun merged 8 commits intoPaddlePaddle:release/2.4from
gongshaotian:r3_finished_2.4_opt
Feb 10, 2026
Merged

[RL] R3 Fix the bug for determining the end of a request#6388
Jiang-Jia-Jun merged 8 commits intoPaddlePaddle:release/2.4from
gongshaotian:r3_finished_2.4_opt

Conversation

@gongshaotian
Copy link
Collaborator

@gongshaotian gongshaotian commented Feb 7, 2026

Motivation

Fix the bug of failing to promptly determine the end of a request:

  • Only one EOS token was decoded
  • After obtaining Block, model runner immediately launched EOS tokens
  • When the maximum length is exceeded, replace the last token with an EOS token

NOTE:R3 does not support the pooling model

TODO: Unable to promptly determine the end of the request

  • Cherry-pick to develop branch

Modifications

ModelRunner:

  • Use the generation of EOS tokens as the condition for determining the end of the request
  • Implemented in post-process

Usage or Command

None

Accuracy Tests

None

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • 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.

@paddle-bot
Copy link

paddle-bot bot commented Feb 7, 2026

Thanks for your contribution!

@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2026

Codecov Report

❌ Patch coverage is 8.00000% with 23 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release/2.4@603aab0). Learn more about missing BASE report.

Files with missing lines Patch % Lines
fastdeploy/model_executor/pre_and_post_process.py 10.00% 16 Missing and 2 partials ⚠️
fastdeploy/config.py 0.00% 1 Missing and 1 partial ⚠️
...model_executor/layers/moe/routing_indices_cache.py 0.00% 2 Missing ⚠️
fastdeploy/worker/gpu_model_runner.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##             release/2.4    #6388   +/-   ##
==============================================
  Coverage               ?   56.22%           
==============================================
  Files                  ?      333           
  Lines                  ?    42248           
  Branches               ?     6427           
==============================================
  Hits                   ?    23756           
  Misses                 ?    16634           
  Partials               ?     1858           
Flag Coverage Δ
GPU 56.22% <8.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gongshaotian gongshaotian marked this pull request as ready for review February 9, 2026 11:05
@gongshaotian gongshaotian changed the title [WIP][RL] R3 Fix the bug for determining the end of a request [RL] R3 Fix the bug for determining the end of a request Feb 9, 2026
moe_layer_num = fd_config.model_config.num_hidden_layers - fd_config.model_config.moe_layer_start_index
max_num_seqs = fd_config.scheduler_config.max_num_seqs
self.queue_max_size = moe_layer_num * max_num_seqs * 10
self.queue_max_size = moe_layer_num * max_num_seqs * 1000
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

magic number?

@Jiang-Jia-Jun Jiang-Jia-Jun merged commit 041df5d into PaddlePaddle:release/2.4 Feb 10, 2026
15 of 19 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.

5 participants