Skip to content

[Others] Exit to ensure no residual processes (cpu cache & dp)#6377

Open
CSWYF3634076 wants to merge 2 commits intoPaddlePaddle:developfrom
CSWYF3634076:good-exit
Open

[Others] Exit to ensure no residual processes (cpu cache & dp)#6377
CSWYF3634076 wants to merge 2 commits intoPaddlePaddle:developfrom
CSWYF3634076:good-exit

Conversation

@CSWYF3634076
Copy link
Collaborator

@CSWYF3634076 CSWYF3634076 commented Feb 6, 2026

Motivation

优雅退出,保证无残留进程 (启动服务具有CPU cache功能,ctrl+c关闭时会残留cache_transfer_manager进程)

Modifications

start_data_parallel_service在结束后调用expert_service._exit_sub_services()清理cache_transfer_manager进程

Usage or Command

CUDA_VISIBLE_DEVICES=0,2 \
ENABLE_V1_KVCACHE_SCHEDULER=1 \
python /root/paddlejob/workspace/env_run/output/wangyafeng/myGithub/FastDeploy/fastdeploy/entrypoints/openai/api_server.py \
--model /root/paddlejob/workspace/env_run/output/wangyafeng/models/Qwen3-VL-30B-A3B-Instruct \
--data-parallel-size 2 \
--workers 8 \
--port 8801 \
--engine-worker-queue-port 8902 \
--cache-queue-port 8903 \
--gpu-memory-utilization 0.9 \
--max-model-len 8192 \
--max-num-seqs 32 \
--swap-space 50 \
--graph-optimization-config '{"use_cudagraph":false}' \
--load-choices dummy \
--limit-mm-per-prompt '{"image": 100, "video": 100}'

main分支
启动后ctrl+c,有cache_transfer_manager.py的残留进程

PR
启动后ctrl+c,无残留进程

Accuracy Tests

no

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 6, 2026

Thanks for your contribution!

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@6563b83). Learn more about missing BASE report.

Files with missing lines Patch % Lines
fastdeploy/engine/expert_service.py 50.00% 2 Missing and 1 partial ⚠️
fastdeploy/cache_manager/prefix_cache_manager.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #6377   +/-   ##
==========================================
  Coverage           ?   68.23%           
==========================================
  Files              ?      391           
  Lines              ?    52245           
  Branches           ?     8145           
==========================================
  Hits               ?    35647           
  Misses             ?    13991           
  Partials           ?     2607           
Flag Coverage Δ
GPU 68.23% <42.85%> (?)

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.

except Exception as e:
console_logger.error(
f"Error killing cache manager process {p.pid}: {e}, {str(traceback.format_exc())}"
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

只有 EP 场景会杀不干净吗

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