Skip to content

Support DSV4 disaggregated launcher - #1310

Merged
yueming-yuan merged 3 commits into
mainfrom
yueming/dsv4-disaggregate-launcher
Jun 9, 2026
Merged

Support DSV4 disaggregated launcher#1310
yueming-yuan merged 3 commits into
mainfrom
yueming/dsv4-disaggregate-launcher

Conversation

@yueming-yuan

@yueming-yuan yueming-yuan commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add DeepSeek V4 launcher resource plumbing for non-colocated training and rollout workers
  • Use --rollout-num-nodes to derive actor nodes and rollout GPU counts from --num-nodes and --num-gpus-per-node
  • Use actor node/GPU counts for SPMD conversion and Megatron parallel config
  • Switch the 64-GPU H200 recipe to TP8 CP1
  • Use SGLang router only: R3 adds --use-rollout-routing-replay without enabling Miles router
  • Use the DAPO thinking_mode chat-template kwarg
  • Set SGLANG_HEALTH_CHECK_TIMEOUT=120 to avoid false rollout health failures during long detokenizer gaps

Validation

  • pre-commit run --all-files
  • Covered by the DeepSeek V4 16-node disaggregate debug run: 8 training nodes + 8 rollout nodes, R3 enabled, Miles router disabled, reached step 1 with no health failures or engine kills

Related PRs

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for non-colocated actor and rollout configurations in the DeepSeek-V4 training script, adding new arguments (colocate, actor_num_nodes, actor_num_gpus_per_node, and rollout_num_gpus) along with validation logic in __post_init__. It also updates the parallel configuration logic, environment variables, and chat template arguments, and introduces a conditional enable_miles_router flag. The feedback recommends replacing bare assert statements with explicit ValueError exceptions to prevent uninformative errors and avoid issues when Python is run with optimization flags.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread scripts/run_deepseek_v4.py Outdated
Comment on lines +118 to +132
if self.actor_num_nodes is None:
if self.colocate:
self.actor_num_nodes = self.num_nodes
else:
assert self.num_nodes % 2 == 0
self.actor_num_nodes = self.num_nodes // 2
assert self.actor_num_nodes <= self.num_nodes
assert self.actor_num_gpus_per_node <= self.num_gpus_per_node
if self.rollout_num_gpus is None:
if self.colocate:
self.rollout_num_gpus = self.actor_num_nodes * self.actor_num_gpus_per_node
else:
self.rollout_num_gpus = (self.num_nodes - self.actor_num_nodes) * self.num_gpus_per_node
if not self.colocate:
assert self.rollout_num_gpus > 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using bare assert statements for input validation in __post_init__ can lead to uninformative AssertionError exceptions and may be optimized away if Python is run with the -O flag. It is better to raise a ValueError with a descriptive error message to improve usability and robustness.

        if self.actor_num_nodes is None:
            if self.colocate:
                self.actor_num_nodes = self.num_nodes
            else:
                if self.num_nodes % 2 != 0:
                    raise ValueError(
                        f"num_nodes ({self.num_nodes}) must be even for non-colocated training "
                        "when actor_num_nodes is not specified."
                    )
                self.actor_num_nodes = self.num_nodes // 2
        if self.actor_num_nodes > self.num_nodes:
            raise ValueError(f"actor_num_nodes ({self.actor_num_nodes}) cannot exceed num_nodes ({self.num_nodes}).")
        if self.actor_num_gpus_per_node > self.num_gpus_per_node:
            raise ValueError(
                f"actor_num_gpus_per_node ({self.actor_num_gpus_per_node}) cannot exceed "
                f"num_gpus_per_node ({self.num_gpus_per_node})."
            )
        if self.rollout_num_gpus is None:
            if self.colocate:
                self.rollout_num_gpus = self.actor_num_nodes * self.actor_num_gpus_per_node
            else:
                self.rollout_num_gpus = (self.num_nodes - self.actor_num_nodes) * self.num_gpus_per_node
        if not self.colocate and self.rollout_num_gpus <= 0:
            raise ValueError("rollout_num_gpus must be greater than 0 when colocate is False.")

Comment thread scripts/run_deepseek_v4.py Outdated
if args.enable_r3:
misc_args += "--use-rollout-routing-replay "
if args.enable_miles_router:
assert args.enable_r3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using a bare assert statement here can raise an uninformative AssertionError if enable_miles_router is enabled without enable_r3. Raising a ValueError with a clear, actionable error message is much more user-friendly.

Suggested change
assert args.enable_r3
if not args.enable_r3:
raise ValueError("enable_miles_router requires enable_r3 to be True.")

@yueming-yuan
yueming-yuan force-pushed the yueming/dsv4-disaggregate-launcher branch 4 times, most recently from ee0ea84 to 13b201f Compare June 8, 2026 23:11
@yueming-yuan
yueming-yuan force-pushed the yueming/dsv4-disaggregate-launcher branch from 13b201f to 4705f59 Compare June 8, 2026 23:15
@yueming-yuan yueming-yuan added the run-ci-model-scripts Run model script smoke tests label Jun 8, 2026
@yueming-yuan
yueming-yuan merged commit f95652a into main Jun 9, 2026
31 checks passed
@yueming-yuan
yueming-yuan deleted the yueming/dsv4-disaggregate-launcher branch June 9, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci-model-scripts Run model script smoke tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants