[Cherry-Pick][BugFix] Seperate prometheus multiproc dir for single-server multi-dp services (#8059)#8062
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/online/20260415 #8062 +/- ##
==========================================================
Coverage ? 71.94%
==========================================================
Files ? 389
Lines ? 54539
Branches ? 8550
==========================================================
Hits ? 39238
Misses ? 12585
Partials ? 2716
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b604581 to
4e3b6e6
Compare
4e3b6e6 to
a30775d
Compare
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 Paddle-CI-Agent | pr_review |
2026-06-23 19:34:02
📋 Review 摘要
PR 概述:为单机多 DP 服务拆分 Prometheus multiprocess 目录,并补充相关测试修复。
变更范围:fastdeploy/metrics/、fastdeploy/engine/、fastdeploy/entrypoints/openai/、相关单测。
影响面 Tag:[Engine] [APIServer]
问题
| 级别 | 文件 | 概述 |
|---|---|---|
| - | - | 未发现新的阻塞性问题。PR 规范问题在下面章节报,不在这里重复 |
历史 Findings 修复情况
| Finding | 问题 | 状态 |
|---|---|---|
| F1 | setup_dp_prometheus_dir() 被 multi_api_server 用于 Popen 子进程时,dp_id == 0 仍会迁移 base 目录下已有 .db 文件。 |
📝 PR 规范检查
标题格式已补充 [Cherry-Pick][BugFix] 和原 PR 号;描述仍保留模板占位,Motivation / Modifications / Usage or Command / Accuracy Tests 未填写。
PR 描述建议(点击展开,可直接复制)
## Motivation
Fix metric interference when multiple data-parallel services run on one server by isolating Prometheus multiprocess files per DP rank.
## Modifications
- Track the original `PROMETHEUS_MULTIPROC_DIR` set during metrics initialization.
- Add `setup_dp_prometheus_dir()` to create per-DP `dp{i}` subdirectories and switch the target environment.
- Apply DP-specific Prometheus dirs when launching internal-adapter DP services from `LLMEngine` / `EngineService` and when `multi_api_server` starts per-DP API server processes.
- Update unit tests for multi API server Prometheus dirs, Prometheus setup behavior, cache transfer setup, and graph optimization metadata.
## Usage or Command
N/A
## Accuracy Tests
N/A
## Checklist
- [x] 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.
- [x] 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.总体评价
核心改动围绕 Prometheus multiprocess 目录隔离展开,本轮未发现新的阻塞性代码问题。历史 F1 在当前 diff 中仍未修复,建议后续把 multi_api_server 的纯环境派生逻辑与 DP0 .db 迁移逻辑拆开,避免 launcher 阶段误迁移文件。
Motivation
Fix metric interference when multiple data-parallel services run on one server by isolating Prometheus multiprocess files per DP rank.
Modifications
PROMETHEUS_MULTIPROC_DIRset during metrics initialization.setup_dp_prometheus_dir()to create per-DPdp{i}subdirectories and switch the target environment.LLMEngine/EngineServiceand whenmulti_api_serverstarts per-DP API server processes.Usage or Command
N/A
Accuracy Tests
N/A
Checklist
[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]]pre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.