已关闭
[ignore] [ci-test] Bad patch 3 Conflicting patches #80
hanboyou创建于 2025年12月22日关闭于 2025年12月24日
[ignore] [ci-test] Bad patch 3 Conflicting patches #80
已关闭
hanboyou创建于 2025年12月22日关闭于 2025年12月24日
共 4 个文件变更+36-38
@@ -1,5 +1,11 @@
1# Qwen3系列模型 RL训练优化实践样例1# Qwen3系列模型 RL训练优化实践样例
2- 2+[2025/12/21 00:33:59.173 GMT+08:00] - [Missing reference] Patch '0001-feature-model_converter.patch' is not mentioned in README.md.
3+[2025/12/21 00:33:59.173 GMT+08:00] - [Missing reference] Patch '0006-vllm_ascend-feature-chunk_moe_eager.patch' is not mentioned in README.md.
4+[2025/12/21 00:33:59.173 GMT+08:00] - [Missing reference] Patch '0011-verl-feature-enable_rollout_rebalance.patch' is not mentioned in README.md.
5+[2025/12/21 00:33:59.173 GMT+08:00] - [Missing reference] Patch '0001-mindspeed-bugfix-bad_context.patch' is not mentioned in README.md.
6+[2025/12/21 00:33:59.173 GMT+08:00] - [Missing reference] Patch '0001-megatron-bugfix-ssssss.patch' is not mentioned in README.md.
7+llm_rl/qwen3/patches/megatron/0001-megatron-bugfix-bad_path.patch
8+0001-megatron-bugfix-state_ten_verification.patch
3## 概述9## 概述
4本样例针对Qwen3-235B-A22B和Qwen3-32B模型,基于[veRL开源框架](https://github.com/volcengine/verl),使用veRL原生支持的MindSpeed和vLLM-Ascend框架,完成RL训练全流程的优化适配。10本样例针对Qwen3-235B-A22B和Qwen3-32B模型,基于[veRL开源框架](https://github.com/volcengine/verl),使用veRL原生支持的MindSpeed和vLLM-Ascend框架,完成RL训练全流程的优化适配。
5 11 
@@ -293,3 +299,5 @@ bash ray_start_npu.sh TRAIN_SCRIPT ENV_SCRIPT
293 299
294 300 
295后续步骤可参考[基于Dockerfile构建环境](#基于dockerfile构建环境) `2. 源码准备及安装所需的python依赖` 和 `3. 使能patch修改`。301后续步骤可参考[基于Dockerfile构建环境](#基于dockerfile构建环境) `2. 源码准备及安装所需的python依赖` 和 `3. 使能patch修改`。
302+0001-megatron-bugfix-conflicting_patch1.patch
303+0002-megatron-bugfix-conflicting_patch2.patch
Rllm_rl/qwen3/patches/megatron/0001-megatron-bugfix-state_ten_verification.patch→llm_rl/qwen3/patches/megatron/0001-megatron-bugfix-conflicting_patch1.patch+0-0
文件重命名但无更改。
@@ -0,0 +1,27 @@
1+From 0faba7fc5b17bcc5ae428f3abb00495764dd2007 Mon Sep 17 00:00:00 2001
2+From: caojingyi <caojingyi@noreply.gitcode.com>
3+Date: Mon, 17 Nov 2025 20:43:10 +0800
4+Subject: [PATCH 1/1] Update megatron: state_ten verification
5+Add state_ten value check in the DistributedOptimizer class to prevent runtime exceptions caused by None,
6+thereby improving code robustness.
7+ 
8+---
9+ llm_rl/qwen3/megatron/core/optimizer/distrib_optimizer.py | 2 ++
10+ 1 file changed, 2 insertions(+)
11+ 
12+diff --git a/llm_rl/qwen3/megatron/core/optimizer/distrib_optimizer.py b/llm_rl/qwen3/megatron/core/optimizer/distrib_optimizer.py
13+index a00d1a3..62fe20f 100644
14+--- a/llm_rl/qwen3/megatron/core/optimizer/distrib_optimizer.py
15++++ b/llm_rl/qwen3/megatron/core/optimizer/distrib_optimizer.py
16+@@ -1319,6 +1319,8 @@ class DistributedOptimizer(MixedPrecisionOptimizer):
17+ # The optimizer state of STEP is handled
18+ # specifically and is read from param_groups.
19+ continue
20++ if state_ten is None:
21++ return []
22+ replace_kwargs = dict(
23+ key=f'{prefix}.{state_key}.{sharded_metadata.key}',
24+ data=state_ten,
25+--
26+2.50.1.windows.1
27+ 
@@ -1,37 +0,0 @@
1-From 233fadd6ac6259494429fe104f66c49a90ddaaf9 Mon Sep 17 00:00:00 2001
2-From: qushiyi <qushiyi@huawei.com>
3-Date: Wed, 26 Nov 2025 18:19:26 +0800
4-Subject: [PATCH] megatron-feature-enable_hdp
5- 
6----
7- .../megatron/core/models/common/embeddings/rope_utils.py | 7 +++++++
8- 1 file changed, 7 insertions(+)
9- 
10-diff --git a/llm_rl/qwen3/megatron/core/models/common/embeddings/rope_utils.py b/llm_rl/qwen3/megatron/core/models/common/embeddings/rope_utils.py
11-index 08c9457..b38a6ca 100644
12---- a/llm_rl/qwen3/megatron/core/models/common/embeddings/rope_utils.py
13-+++ b/llm_rl/qwen3/megatron/core/models/common/embeddings/rope_utils.py
14-@@ -43,6 +43,8 @@ try:
15- except ImportError:
16- apply_rotary_emb_flash = None
17-
18-+from patches.verl.utils.hybrid_data_parallel.utils import set_batch_hdp_group, get_batch_hdp_group
19-+
20-
21- __all__ = ['apply_rotary_emb_flash']
22-
23-@@ -159,6 +161,11 @@ def _apply_rotary_pos_emb_thd(
24-
25- cp_size = parallel_state.get_context_parallel_world_size()
26- cp_rank = parallel_state.get_context_parallel_rank()
27-+ batch_hdp_group = get_batch_hdp_group()
28-+ if batch_hdp_group is not None:
29-+ hdp_group = next(group for group in batch_hdp_group if cp_rank in group)
30-+ cp_size = len(hdp_group)
31-+ cp_rank = hdp_group.index(cp_rank)
32- cu_seqlens = cu_seqlens // cp_size
33- seqlens = (cu_seqlens[1:] - cu_seqlens[:-1]).tolist()
34-
35---
36-2.50.1.windows.1
37-