Conversation
Co-authored-by: Codex <noreply@openai.com>
There was a problem hiding this comment.
🔵 Needs a closer look
It changes distributed/runtime EPLB behavior and enforces a new parallelism constraint, which warrants multi-rank/hardware validation beyond the included unit tests.
Pull request overview
This PR adjusts the offline/static EPLB patching layer to (1) prevent periodic EPLB rearrangement from overwriting a loaded static expert map, and (2) reject offline EPLB recording/loading when pipeline parallelism is enabled to avoid multi-rank clobbering of shared model/file state.
Changes:
- Suppress
EplbState.rearrange()whenexpert_map_pathis set (static/offline load), while still allowing explicit elastic-EP remapping viarank_mapping. - Reject offline recording/loading early when
pipeline_parallel_size > 1, before any model registration or file writes occur. - Extend regression tests to cover static vs. online rearrangement behavior and the pipeline-parallel rejection path.
File summaries
| File | Description |
|---|---|
| vllm_hcu/patch/worker/framework_opt/patch_offline_eplb.py | Adds rearrange wrapping to preserve loaded static maps; adds early PP rejection for offline paths. |
| tests/runtime_patch/test_offline_eplb.py | Adds coverage for static-map non-rearrangement, continued online rearrangement, and PP>1 offline rejection. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Loading an offline expert map still allowed periodic EPLB to replace it. Recording with pipeline parallelism also let separate EP rank-zero workers overwrite the same model entry and temporary file.
This change suppresses scheduled rearrangement when
expert_map_pathis set, while retaining step statistics and explicit elastic-EP remapping. It rejects offline recording/loading withpipeline_parallel_size > 1before model registration or file writes. Online EPLB is unchanged. Regression coverage checks static, recording, online, and pipeline-parallel paths.Targets
integrate/pr61-into-hy4-pcp-epto keep the diff limited to these two fixes (22 production lines changed, plus tests).Validation:
.venv/bin/python -m pytest tests/runtime_patch/test_offline_eplb.py -q: 16 passed.EplbState.stepimplementation at a rearrangement interval boundary: online mode rearranged once; static mode did not rearrange.VLLM_V0251_SOURCE_ROOT=/data/users/xiaojie.yuan/vllm .venv/bin/python -m pytest tests/runtime_patch/test_offline_eplb.py tests/patch/test_worker_dispatcher.py -q: 23 passed, 10 failed during vLLM imports because NumPy was missing from the CPU test environment.git diff --check: passed.Duplicate-work check: inspected #61 and the open PR searches for
61 in:body,eplb,static, andoffline, including #34 and #62. Those PRs provide the underlying HY V4/EPLB integration; none addresses these static-map lifecycle fixes. This PR adds only the fixes on top of #62's branch.AI assistance: Codex assisted with implementation, review, testing, and PR preparation. Human review and relevant hardware validation remain necessary before merge.