{"id":1777,"date":"2026-06-30T11:09:13","date_gmt":"2026-06-30T03:09:13","guid":{"rendered":"https:\/\/www.izhuhn.cn\/?p=1777"},"modified":"2026-06-30T18:41:27","modified_gmt":"2026-06-30T10:41:27","slug":"rlinf-recap-ascend-910b","status":"publish","type":"post","link":"https:\/\/www.izhuhn.cn\/index.php\/2026\/06\/30\/rlinf-recap-ascend-910b\/","title":{"rendered":"RLinf RECAP (pi0.5) \u6607\u817e910B\u9002\u914d\u7b80\u8bb0"},"content":{"rendered":"<p>## \u4e00\u3001\u80cc\u666f<\/p>\n<p>RLinf \u662f\u4e00\u4e2a\u57fa\u4e8e Ray \u7684\u673a\u5668\u4eba\u5f3a\u5316\u5b66\u4e60\u6846\u67b6\u3002\u5176\u6838\u5fc3\u7b97\u6cd5 RECAP \u901a\u8fc7\u56db\u9636\u6bb5\u6d41\u6c34\u7ebf\u5b9e\u73b0 classifier-free guidance (CFG) \u7b56\u7565\u4f18\u5316\uff1a\u5148\u8ba1\u7b97\u8f68\u8ff9\u56de\u62a5\uff08Step 1\uff09\uff0c\u518d\u8bad\u7ec3\u4ef7\u503c\u6a21\u578b\uff08Step 2\uff09\uff0c\u7136\u540e\u8ba1\u7b97\u4f18\u52bf\u6807\u7b7e\uff08Step 3\uff09\uff0c\u6700\u540e CFG \u8bad\u7ec3\u7b56\u7565\u6a21\u578b\uff08Step 4\uff09\u3002\u6574\u4e2a\u8fc7\u7a0b\u6d89\u53ca VLM backbone\uff08SigLIP + Gemma3\uff09\u30018 \u5361 FSDP \u5206\u5e03\u5f0f\u8bad\u7ec3\uff0c\u76ee\u6807\u662f\u628a\u8fd9\u5957 pipeline \u5b8c\u6574\u8dd1\u5728\u534e\u4e3a\u6607\u817e 910B \u4e0a\u3002<\/p>\n<p>\u73af\u5883\uff1aDocker \u955c\u50cf `rlinf\/rlinf:agentic-rlinf0.2-libero-cann9.0`\uff0c\u81ea\u5efa `.venv`\uff08install.sh embodied --model openpi --env libero --platform ascend\uff09\uff0ctorch 2.6.0+cpu + torch-npu 2.6.0\uff0cCANN 9.0\u3002<\/p>\n<p>\u6570\u636e\u96c6\uff1aRLinf\/RECAP-Libero10-Task0-48succ-Data\u3002\u8def\u5f84\uff1a<br \/>\n- `libero10_task0_sft`\uff1a48 \u6761\u6210\u529f\u8f68\u8ff9\uff088005 \u5e27\uff09\uff0cStep 2 \u8bad\u7ec3\u96c6<br \/>\n- `libero10_task0_train`\uff1a4096 \u6761\u6210\u8d25\u6df7\u5408\u7684 rollout\uff0cStep 2 eval + Step 1 \u8f93\u5165<br \/>\n- `libero10_task0_eval`\uff1a\u9a8c\u8bc1\u96c6<\/p>\n<p>## \u4e8c\u3001Step 1 \u2014 Compute Returns\uff08\u901a\u8fc7\uff09<\/p>\n<p>\u7eaf CPU \u8ba1\u7b97\uff0c\u65e0 NPU \u4f9d\u8d56\u3002\u5bf9 8005 \u5e27 SFT \u6570\u636e\u548c 4096 \u6761 rollout \u8f68\u8ff9\u5206\u522b\u8ba1\u7b97\u6298\u6263\u56de\u62a5\uff08`G_t = r_t + \u03b3\u00b7G_{t+1}`\uff0c\u03b3=1.0\uff09\uff0c\u751f\u6210 `meta\/returns.parquet`\u3002\u5168\u7a0b\u987a\u7545\u3002<\/p>\n<p>```bash<br \/>\npython examples\/recap\/process\/compute_returns.py --config-name=compute_returns<br \/>\n```<\/p>\n<p>## \u4e09\u3001Step 2 \u2014 Value Model SFT\uff088 \u5361 FSDP \u8bad\u7ec3\uff09<\/p>\n<p>\u8fd9\u662f\u6574\u4e2a\u9002\u914d\u8fc7\u7a0b\u4e2d\u8e29\u5751\u6700\u5bc6\u96c6\u7684\u9636\u6bb5\u3002<\/p>\n<p>### 3.1 transfer_to_npu \u7684 Segfault<\/p>\n<p>`torch_npu.contrib.transfer_to_npu` \u662f torch-npu \u7684 monkey-patch \u6a21\u5757\uff0c\u4f5c\u7528\u662f\u628a\u6240\u6709 `torch.cuda.*` \u8c03\u7528\u81ea\u52a8\u66ff\u6362\u4e3a `torch.npu.*`\u3002\u4f46\u5b83\u5728\u904d\u5386 torch \u6a21\u5757\u6811\u65f6\u89e6\u53d1\u4e86 transformers \u7684 lazy import\u2192image_transforms\u2192tensorflow\u2192`pywrap_tensorflow.py\u2192self_check.py:63`\uff0cTF \u7684 C \u6269\u5c55\u5728 NumPy 2.x \u4e0b\u76f4\u63a5 segfault\u3002<\/p>\n<p>**\u4fee\u590d**\uff1a\u6ce8\u91ca\u6389 `train_value.py` \u91cc\u7684 `from torch_npu.contrib import transfer_to_npu`\uff0c\u7136\u540e `pip uninstall tensorflow`\u3002<\/p>\n<p>\u4f46\u5b9e\u9645\u4e0a Ray worker \u6587\u4ef6 `rlinf\/workers\/sft\/fsdp_value_sft_worker.py` \u4e5f import \u4e86\u5b83\uff0c\u6240\u4ee5\u6bcf\u4e2a NPU worker fork \u65f6\u8fd8\u662f\u4f1a\u89e6\u53d1\u3002\u5173\u952e\u662f\u8981\u786e\u4fdd\u73af\u5883\u4e2d\u6ca1\u6709 tensorflow\u3002<\/p>\n<p>### 3.2 LeRobot Dataset \u79bb\u7ebf\u52a0\u8f7d<\/p>\n<p>Step 2 \u7684 config \u91cc\u6307\u5b9a\u4e86 `eval_data_paths` \u6307\u5411\u672c\u5730 `libero10_task0_train`\u3002LeRobot \u7684 `LeRobotDataset.__init__` \u4f1a\u8c03\u7528 `get_safe_version()`\uff0c\u8be5\u65b9\u6cd5\u5185\u90e8 `get_repo_versions()` \u53bb hf-mirror \u67e5\u6570\u636e\u96c6\u7248\u672c\u4fe1\u606f\uff0c\u4f46\u8fd9\u4e2a\u672c\u5730\u6570\u636e\u96c6\u4e0d\u5728 HuggingFace \u4e0a\u2014\u2014404\u3002<\/p>\n<p>**\u4fee\u590d**\uff1a\u76f4\u63a5 patch LeRobot \u6e90\u7801 `lerobot\/common\/datasets\/utils.py`\uff1a<\/p>\n<p>```python<br \/>\n# get_repo_versions \u2014 \u6355\u6349\u5f02\u5e38\u8fd4\u56de\u7a7a\u5217\u8868<br \/>\ndef get_repo_versions(repo_id: str):<br \/>\n    try:<br \/>\n        return _get_repo_versions_impl(repo_id)<br \/>\n    except Exception:<br \/>\n        return []<\/p>\n<p># get_safe_version \u2014 hub_versions \u4e3a\u7a7a\u65f6\u76f4\u63a5\u7528\u672c\u5730\u7248\u672c<br \/>\ndef get_safe_version(repo_id, version):<br \/>\n    hub_versions = get_repo_versions(repo_id)<br \/>\n    if not hub_versions:<br \/>\n        return f\"v{target_version}\"  # \u7528\u672c\u5730 info.json \u7684 _version_<br \/>\n    ...<br \/>\n```<\/p>\n<p>`.pth` \u6587\u4ef6\u548c\u5165\u53e3\u811a\u672c monkey-patch \u90fd\u4e0d\u751f\u6548\uff08Ray workers \u72ec\u7acb fork\uff0c\u4e0d\u7ee7\u627f\u7236\u8fdb\u7a0b monkey-patch\uff09\uff0c\u5fc5\u987b\u6539\u6e90\u6587\u4ef6\u3002<\/p>\n<p>### 3.3 Ray Timer Crash<\/p>\n<p>\u8bad\u7ec3\u8dd1 4 \u6b65\u6ca1\u95ee\u9898\uff0c\u7b2c 5 \u6b65\u89e6\u53d1 save+eval \u65f6\u5d29\uff1a<\/p>\n<p>```<br \/>\nValueError: Timer 'run_eval' has not been recorded.<br \/>\n```<\/p>\n<p>\u6839\u56e0\uff1a`transfer_to_npu` monkey-patch \u4e86 `torch.distributed.init_process_group`\uff08\u66ff\u6362 backend \u4e3a hccl\uff09\uff0c\u5e72\u6270\u4e86 Ray \u5185\u90e8 `@Worker.timer` \u88c5\u9970\u5668\u7684\u8ba1\u65f6\u673a\u5236\u3002<\/p>\n<p>**\u4fee\u590d**\uff1a\u628a `pop_execution_time` \u7684 crash \u6539\u6210 no-op\uff1a<\/p>\n<p>```python<br \/>\n# rlinf\/scheduler\/worker\/worker.py:1295<br \/>\nif tag not in self._timer_metrics:<br \/>\n    return 0.0  # patched: Ray timer broken by transfer_to_npu<br \/>\n```<\/p>\n<p>### 3.4 \u8bad\u7ec3\u6307\u6807<\/p>\n<p>8 \u5361 FSDP\uff0cmicro_batch=16\u00d78=128 global_batch\uff0c8005 \u6837\u672c\uff0c\u7ea6 62 \u6b65\/epoch\u3002<\/p>\n<p>\u524d 4 \u6b65\u8bad\u7ec3\u6307\u6807\uff08\u6a21\u578b\u5c1a\u672a\u6536\u655b\uff0c\u6b63\u5e38\uff09\uff1a<br \/>\n- loss ~6.0\uff0cMAE ~0.43<br \/>\n- predicted_value_std ~0.01\uff08\u6a21\u578b\u8f93\u51fa\u8fd1\u4e4e\u5e38\u6570\uff0c\u9884\u671f\u4e2d\uff09<br \/>\n- value_spearman ~-0.3 \u9010\u6b65\u6539\u5584\uff08step 4 \u5230 -0.02\uff09<\/p>\n<p>## \u56db\u3001\u5df2\u5b8c\u6210\u4fee\u6539\u6e05\u5355<\/p>\n<p>| \u6587\u4ef6 | \u4fee\u6539 | \u539f\u56e0 |<br \/>\n|------|------|------|<br \/>\n| `examples\/recap\/value\/train_value.py:26` | import transfer_to_npu\uff08\u4fdd\u7559\uff09 | NPU cuda\u2192npu \u6620\u5c04 |<br \/>\n| `rlinf\/workers\/sft\/fsdp_value_sft_worker.py:30` | import transfer_to_npu\uff08\u4fdd\u7559\uff09 | Ray worker \u9700\u8981 |<br \/>\n| `rlinf\/scheduler\/worker\/worker.py:1295` | ValueError \u2192 return 0.0 | Ray timer crash |<br \/>\n| `lerobot\/utils.py:get_repo_versions` | try\/except \u5305\u88f9 | \u79bb\u7ebf\u6570\u636e\u96c6 404 |<br \/>\n| `lerobot\/utils.py:get_safe_version` | hub_versions \u7a7a\u65f6\u7528\u672c\u5730\u7248 | \u540c\u4e0a |<br \/>\n| `examples\/recap\/value\/config\/libero_sft_value.yaml` | val_check_interval=50, save_interval=50 | \u63a7\u5236\u9a8c\u8bc1\u9891\u7387 |<\/p>\n<p>\u5907\u4efd\u76ee\u5f55\uff1a`\/RLinf\/backups_adapt\/20260630_101234\/`<\/p>\n<p>## \u4e94\u3001\u5269\u4f59\u6b65\u9aa4<\/p>\n<p>Step 3\uff08Compute Advantages\uff09\u548c Step 4\uff08CFG Training\uff09\u5c1a\u672a\u8fd0\u884c\u3002Step 4 \u540c\u6837\u6d89\u53ca 8 \u5361 FSDP \u8bad\u7ec3\uff0c\u9884\u8ba1\u4f1a\u9047\u5230\u7c7b\u4f3c\u7684 transfer_to_npu \/ LeRobot \/ Ray timer \u95ee\u9898\uff0c\u524d\u8ff0 patch \u5e94\u5df2\u8986\u76d6\u3002<\/p>\n<p>\u7b80\u8bb0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>## \u4e00\u3001\u80cc\u666f RLinf \u662f\u4e00\u4e2a\u57fa\u4e8e Ray \u7684\u673a\u5668\u4eba\u5f3a\u5316\u5b66\u4e60\u6846\u67b6\u3002\u5176\u6838\u5fc3\u7b97\u6cd5 RECAP \u901a\u8fc7\u56db\u9636\u6bb5\u6d41\u6c34\u7ebf\u5b9e\u73b0 classif &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[49],"tags":[25,46,48,51,45,50,44,43,47,16],"class_list":["post-1777","post","type-post","status-publish","format-standard","hentry","category-49","tag-910b","tag-cann","tag-fsdp","tag-lerobot","tag-pi0-5","tag-ray","tag-recap","tag-rlinf","tag-torch-npu","tag-16"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts\/1777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1777"}],"version-history":[{"count":2,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts\/1777\/revisions"}],"predecessor-version":[{"id":1779,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts\/1777\/revisions\/1779"}],"wp:attachment":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}