Skip to content

feat: support data parallel (DP) for DeepSeek-V3.2 Python model executor. - #2258

Open
yingxudeng wants to merge 3 commits into
xLLM-AI:mainfrom
yingxudeng:feat/deepseek-v32-python-dp
Open

feat: support data parallel (DP) for DeepSeek-V3.2 Python model executor.#2258
yingxudeng wants to merge 3 commits into
xLLM-AI:mainfrom
yingxudeng:feat/deepseek-v32-python-dp

Conversation

@yingxudeng

Copy link
Copy Markdown
Collaborator

Description

Related Issues

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor
  • Documentation
  • Test
  • Build or CI

Pull Request Checklist

Thank you for contributing to xLLM. Before requesting review, please make sure the following items are complete.

PR Title and Commit Messages

  • The PR title and each commit message follow the xLLM commit format: <type>: <subject>.

Allowed types: feat, bugfix, docs, test, refactor, chore, style, revert, perf, model, build, release.
The subject should use clear English, start with a verb, include at least 4 words, and end with ..

Pre-commit Checks

  • I have installed pre-commit by running pip install pre-commit or an equivalent command.
  • I have installed the hooks with pre-commit install.
  • I have run pre-commit run --all-files and fixed any reported issues.

If you are unsure how to set up pre-commit, see the pre-commit documentation.

Self Review

  • I have self-reviewed the code according to .agents/skills/code-review/references/custom-code-style.md, especially code written or assisted by AI.
  • I have rebased this PR onto the latest main branch.

Build and Test Coverage

  • Tests have been added or updated as needed.
  • CUDA: python setup.py build test has passed on a CUDA machine.
  • NPU: python setup.py build test has passed on an NPU machine.
  • MLU: python setup.py build test has passed on an MLU machine.

Reviewer Notes

@yingxudeng
yingxudeng force-pushed the feat/deepseek-v32-python-dp branch 4 times, most recently from 8fb01fe to 90a5951 Compare August 18, 2026 12:29
@yingxudeng
yingxudeng marked this pull request as ready for review August 18, 2026 12:32
@yingxudeng
yingxudeng force-pushed the feat/deepseek-v32-python-dp branch 2 times, most recently from e375d65 to 0c15f12 Compare August 18, 2026 14:40
@yingxudeng
yingxudeng force-pushed the feat/deepseek-v32-python-dp branch from 0c15f12 to 6d9486d Compare August 19, 2026 07:24

@zhang-minchao zhang-minchao left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

发现两处需要在合入前处理的 DP 正确性/性能问题。

Comment thread xllm/python/model_executor/runners/decode_acl_graph.py
Comment thread xllm/python/models/deepseek_v32.py Outdated
… mismatch.

DP mode (dp_size > 1) must not fall back to eager for decode steps, as
divergent execution paths across ranks would deadlock HCCL collectives.
This change raises RuntimeError instead of silently returning False when
graph execution is declined, and fixes an MLA-specific bug where the C++
engine sends kv_seq_lens_host_values with global DP batch length while
block_table only contains local rank sequences.
@yingxudeng
yingxudeng force-pushed the feat/deepseek-v32-python-dp branch from 6d9486d to bdf93f5 Compare August 19, 2026 08:20
- Expose dp_is_decode from C++ metadata to Python so graph runners can
  detect when not all DP ranks are in decode phase and fall back to
  eager, preventing collective hang during asymmetric capture.
- In eager DP path, use all_gather_variable to collect only valid tokens
  (compact) instead of pad-to-max, avoiding O(dp_size * max_tokens)
  amplification through gate/MoE/shared-experts.
- Remove the hard RuntimeError in executor.py that blocked DP decode
  eager fallback, enabling eager-mode precision debugging.
- Update tests to cover both graph (fixed-shape) and eager (compact)
  gather paths.
@yingxudeng
yingxudeng force-pushed the feat/deepseek-v32-python-dp branch from ffbbc6d to 4bf6175 Compare August 19, 2026 13:15
@yingxudeng

Copy link
Copy Markdown
Collaborator Author
image

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