Skip to content

fix(eplb): preserve static maps and reject offline pipeline parallelism - #70

Open
llseek wants to merge 1 commit into
HYGON-AI:integrate/pr61-into-hy4-pcp-epfrom
llseek:fix/static-eplb-map-lifecycle
Open

llseek wants to merge 1 commit into
HYGON-AI:integrate/pr61-into-hy4-pcp-epfrom
llseek:fix/static-eplb-map-lifecycle

Conversation

@llseek

@llseek llseek commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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_path is set, while retaining step statistics and explicit elastic-EP remapping. It rejects offline recording/loading with pipeline_parallel_size > 1 before 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-ep to 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.
  • An isolated CPU check executed the local vLLM v0.25.1 EplbState.step implementation 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.
  • Ruff check and format check report existing issues in these files. Comparing Ruff diagnostics against the unmodified base found no new lint diagnostics. No HCU/multi-rank runtime validation was performed.

Duplicate-work check: inspected #61 and the open PR searches for 61 in:body, eplb, static, and offline, 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.

Copilot AI lite review requested due to automatic review settings September 5, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 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() when expert_map_path is set (static/offline load), while still allowing explicit elastic-EP remapping via rank_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.

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.

2 participants