Skip to content

Conversation

@rainyfly
Copy link
Collaborator

@rainyfly rainyfly commented Dec 12, 2025

Motivation

防止 token processor hang 死,添加探活接口由于探知。

Modifications

新增服务层探活 check 项:token processor组件

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.

Copilot AI review requested due to automatic review settings December 12, 2025 08:33
@paddle-bot
Copy link

paddle-bot bot commented Dec 12, 2025

Thanks for your contribution!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds health monitoring functionality for the token processor to detect and prevent hang situations. The implementation introduces a health check command that can be called externally to verify if the token processor is operating correctly.

Key changes:

  • Added healthy() method to check token processor health status based on timestamp tracking
  • Implemented timestamp monitoring before and after batch processing
  • Added check_health command handler in the internal adapter

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
fastdeploy/envs.py Adds FD_TOKEN_PROCESSOR_HEALTH_TIMEOUT configuration with 120-second default
fastdeploy/output/token_processor.py Implements health monitoring with timestamps and healthy() method to detect hung states
fastdeploy/splitwise/internal_adapter_utils.py Adds check_health command handler that invokes the token processor's healthy() method

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 20.00000% with 20 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@12c76f8). Learn more about missing BASE report.

Files with missing lines Patch % Lines
fastdeploy/output/token_processor.py 26.31% 14 Missing ⚠️
fastdeploy/splitwise/internal_adapter_utils.py 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #5534   +/-   ##
==========================================
  Coverage           ?   60.73%           
==========================================
  Files              ?      329           
  Lines              ?    41161           
  Branches           ?     6274           
==========================================
  Hits               ?    24998           
  Misses             ?    14273           
  Partials           ?     1890           
Flag Coverage Δ
GPU 60.73% <20.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.

@qingqing01 qingqing01 merged commit 7b0fdf7 into PaddlePaddle:develop Dec 15, 2025
19 of 26 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.

3 participants