Skip to content

feat(rl): consolidate training optimizations and experiment results - #1341

Merged
github-actions[bot] merged 1 commit into
mindspore-ai:masterfrom
haiyangxin:master-hyper-rl-verl
Nov 2, 2026
Merged

github-actions[bot] merged 1 commit into
mindspore-ai:masterfrom
haiyangxin:master-hyper-rl-verl

Conversation

@haiyangxin

@haiyangxin haiyangxin commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature


What does this PR do / why do we need it:

Reduce memory pressure and idle time when RL training and generation share devices, while preserving the sampled trajectories and optimizer-update semantics.

  • Add dynamic token micro-batching for Actor updates and old/reference log-probability forwards. Oversized sequences run individually without truncation. Keep DP balancing and chunked log-probabilities optional and disabled in the default GSM8K recipes.
  • Reuse HSDP gradient synchronization and training offload, and add rollout-phase CPU offload for training state. In shared fully_shard/api.py, release stale flat-buffer references after model conversion so obsolete device storage can be freed.
  • Overlap Codex CPU preparation with a configurable CPU budget, improve request admission and trace concurrency, and preserve verified budget-terminal trajectories. Search-R1 and SWE-Smith reuse the shared isolated executor; Search-R1 keeps its task-specific runtime and original HotpotQA reward.
  • Use one strict verl-compatible GSM8K rule scorer across single-turn and external-harness recipes. Keep the two Hyper-RL 50-step launch configurations and concise result summaries; external baseline recipes, detailed artifacts and analysis utilities remain outside tracked source. Keep the version-checked vLLM-Ascend sampler repair under docker/patches/.
  • Consolidate regression fixtures and documentation, distinguish synchronous preparation overlap from asynchronous training, and retain existing policy-version and shutdown contracts.

Which issue(s) this PR fixes:

Refs #1213 — contributes to the HyperParallel RL roadmap's correctness, performance and Agentic RL workstreams.


Test plan and results:

  • Based on upstream master at d666fdbf; this PR contains one commit.
  • CPU regression after rebasing onto current upstream: python -m pytest -q tests/ut/rl tests/ut/core/fully_shard/test_module_conversion.py --disable-warnings — 1,136 passed (including colocated/fully asynchronous GRPO).
  • Checkpoint export UT: 33 passed with each of Transformers 5.5.4 and 5.13.0. The Qwen3.5 fixture temporarily normalizes composite text configs by model/config type; production loading is unchanged, and export/reload/weight-equality assertions remain intact. This fixture does not establish production support for older Transformers versions.
  • Local CI-parity checks: all 71 changed Python files pass Pylint 3.3.7 with the CI rcfile and existing repository filters; changed production functions pass Lizard 1.17.19 (CCN <= 19, NLOC <= 100). AGENTS catalog and git diff --check passed. Documentation checks passed earlier in this revision; NPU ST and the full main-project UT suite were not rerun. Remote CI is pending.
  • Historical 50-step GSM8K runs used the same 6,400 training questions, 128 questions × 8 candidates per step, and 500 validation questions. Final strict validation rewards were 0.914 for historical verl, 0.944 for Hyper-RL, and 0.930 for Hyper-RL + Codex. Hardware, dependencies, sampler versions and harness prompts differ; these results do not establish a controlled speed ranking or statistical equivalence. See the GSM8K README for comparison limits.

Self-checklist:

  • Design: Maintainer review completed and approved.
  • Tests: Regression coverage retained and executed; test-only compatibility handling and unrun checks are disclosed above.
  • Validation: Results, failures and the limits of the historical experiment evidence are documented.
  • Interfaces: Configuration and runtime-interface review completed and approved.
  • Documentation: Runtime boundaries, runnable recipes, module navigation and result summaries are updated and consolidated.

@haiyangxin
haiyangxin force-pushed the master-hyper-rl-verl branch 3 times, most recently from 45dcf1a to 26fbe5e Compare October 29, 2026 03:22
Comment thread hyper_parallel/core/fully_shard/api.py Resolved
@haiyangxin
haiyangxin force-pushed the master-hyper-rl-verl branch 7 times, most recently from e28321f to f18e993 Compare October 30, 2026 03:37
@haiyangxin
haiyangxin requested a review from mxysfive October 30, 2026 03:39
@haiyangxin
haiyangxin force-pushed the master-hyper-rl-verl branch 4 times, most recently from 5c8ad74 to 44749ce Compare October 30, 2026 07:06
@haiyangxin

Copy link
Copy Markdown
Contributor Author

/check-pr

@haiyangxin

Copy link
Copy Markdown
Contributor Author

/retest

@mindspore-ai-bot

Copy link
Copy Markdown

🔵 The pipeline #1253 is running. Please wait a moment... (Link)

@mindspore-ai-bot

Copy link
Copy Markdown
Project Name Build_Stage Build Result Details
Hyper-parallel_Github_Gate - ❌ FAILURE 1253
Check_Pylint FAILURE 1253
Check_Lizard FAILURE 1253

@mindspore-ai-bot

Copy link
Copy Markdown

@haiyangxin, your gate pipeline failed at the code check stage. You can configure some code check tools locally following the (pre-push quick guide), to enable automatic checking when you push your code every time. Tools included are: Check_CMakelint, Check_Codespell, Check_Cpplint, Check_Lizard, Check_Pylint, Check_ClangFormat, Check_ShellCheck.

@haiyangxin

Copy link
Copy Markdown
Contributor Author

/retest

@mindspore-ai-bot

Copy link
Copy Markdown

🔵 The pipeline #1316 is running. Please wait a moment... (Link)

@mindspore-ai-bot

Copy link
Copy Markdown
Project Name Build_Stage Build Result Details(Full/Incremental) Detail
Coverage Line Coverage ❌ FAILURE 72%/100% Link

@mindspore-ai-bot

Copy link
Copy Markdown
Platform Type Module Excution Time Time Limit
- shard 201.375s 300.0s
- pipeline_parallel 699.273s 600.0s
- activation_memory 137.37825s 120.0s
- tensor_parallel 274.83s 300.0s
- auto_models 112.185s 150.0s
- accuracy 84.755s 120.0s
- optimizer 303.164s 300.0s
- fully_shard 376.193s 600.0s
- init_weights 99.13s 118.75s
- swap_optimizer 367.197s 300.0s
- clip_grad 104.389s 120.0s
- process_group 83.257s 90.0s
- distributed_checkpoint 95.83s 120.0s
- dtensor 103.409s 120.0s
- llama3_examples 103.627s 120.0s
- context_parallel 85.614s 120.0s
- expert_parallel 179.21s 120.0s
- multicore 112.465s 120.0s

@mindspore-ai-bot

Copy link
Copy Markdown
Project Name Build_Stage Build Result Details
Hyper-parallel_Github_Gate - ❌ FAILURE 1316
Smoke_Ascend910b_Torch FAILURE 1316

@haiyangxin

Copy link
Copy Markdown
Contributor Author

/check-pr

@haiyangxin

Copy link
Copy Markdown
Contributor Author

/retest

@mindspore-ai-bot

Copy link
Copy Markdown

🔵 The pipeline #1318 is running. Please wait a moment... (Link)

@mindspore-ai-bot

Copy link
Copy Markdown
Project Name Build_Stage Build Result Details(Full/Incremental) Detail
Coverage Line Coverage ✅ SUCCESS 72%/100% Link

@mindspore-ai-bot

Copy link
Copy Markdown
Platform Type Module Excution Time Time Limit
- activation_memory 115.96125s 120.0s
- auto_models 86.983s 150.0s
- shard 164.231s 300.0s
- swap_optimizer 281.996s 300.0s
- pipeline_parallel 544.165s 600.0s
- optimizer 250.208s 300.0s
- fully_shard 282.273s 600.0s
- accuracy 70.582s 120.0s
- clip_grad 72.688s 120.0s
- multicore 108.2205s 120.0s
- tensor_parallel 199.693s 300.0s
- init_weights 73.333s 118.75s
- expert_parallel 140.9195s 120.0s
- dtensor 73.612s 120.0s
- distributed_checkpoint 76.489s 120.0s
- context_parallel 67.729s 120.0s
- process_group 62.581s 90.0s
- llama3_examples 57.294s 120.0s

@mindspore-ai-bot

Copy link
Copy Markdown
Project Name Build_Stage Build Result Details
Hyper-parallel_Github_Gate - ✅ SUCCESS 1318

@github-actions
github-actions Bot merged commit 0e9c019 into mindspore-ai:master Nov 2, 2026
15 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants