背景
#1621 (分支 feat/issue-1621-ppo-direct-rsl-rl)把 PPO 改为直驱上游 rsl-rl、unilab-rl 降级为可选 extra。为了让单进程 PPO 不依赖 uni_rl,src/unilab/rl/distributed.py 与 src/unilab/rl/vec_env.py 复制/封装了 uni_rl 的若干实现,两侧可独立漂移:
与 uni_rl/ipc/dp_launcher.py 重复或强耦合:
resolve_dp_topology、validate_dp_launchable、current_torch_distributed_rank/local_rank/world_size 为逐行副本;
UNILAB_DP_LOG_DIR 常量两侧各定义一次——该字符串是跨进程契约(uni_rl launcher 设置,UniLab worker 读取),任何一侧改名即静默断链;
resolve_collector_cpu_ids / launch_torchrun_workers 为懒加载委托,签名与 uni_rl 侧强耦合但无编译期/CI 检查。
与 uni_rl/algos/rsl_rl.py 重复:
apply_rsl_rl_rank_seed、resolve_rsl_rl_device、ppo_samples_per_iteration、finish_rsl_rl_distributed、rsl_rl_single_process_topology(uni_rl 侧已随 PPO 封装层一并删除,见 unilab_rl 仓库 chore/remove-rsl-rl-ppo-layer 分支);
RslRlVecEnvAdapter / get_policy_obs_dims 与 uni_rl 保留的 RslRlVecEnvWrapper(APPO 链路仍在消费)语义近似,观测拼接与 done/timeout 语义可独立漂移。
unilab-rl==1.3.0 为精确 pin,当前无实际漂移;风险在于未来 bump pin 后两侧静默不一致——多卡 PPO 与 APPO 回放只在使用时才触发,单进程 CI 覆盖不到。
建议
在 UniLab 为 uni_rl.ipc.dp_launcher 的消费面(launch_torchrun_workers、resolve_collector_cpu_ids、UNILAB_DP_LOG_DIR)加契约测试(inspect.signature 比对 + 常量比对),仅在 uni_rl 安装时运行(dev 组/CI 已装)。
明确每个重复符号的唯一属主并在两侧 AGENTS.md 记录;与 跨边界重复工具模块需明确唯一属主(nan_guard/tensor/seed/device) #1586 的属主决策一并处理。
在 bump unilab-rl pin 的 PR 检查单中加入「核对 dp_launcher 消费面」一项。
证据
UniLab 侧副本:src/unilab/rl/distributed.py、src/unilab/rl/vec_env.py(分支 feat/issue-1621-ppo-direct-rsl-rl)。
uni_rl 侧原件(1.3.0):src/uni_rl/ipc/dp_launcher.py(resolve_dp_topology L35、resolve_collector_cpu_ids L106、validate_dp_launchable L223、launch_torchrun_workers L264、UNILAB_DP_LOG_DIR L24)、src/uni_rl/algos/rsl_rl.py。
uni_rl 侧 PPO 封装层删除:unilab_rl 仓库分支 chore/remove-rsl-rl-ppo-layer。
背景
#1621(分支
feat/issue-1621-ppo-direct-rsl-rl)把 PPO 改为直驱上游 rsl-rl、unilab-rl降级为可选 extra。为了让单进程 PPO 不依赖 uni_rl,src/unilab/rl/distributed.py与src/unilab/rl/vec_env.py复制/封装了 uni_rl 的若干实现,两侧可独立漂移:与
uni_rl/ipc/dp_launcher.py重复或强耦合:resolve_dp_topology、validate_dp_launchable、current_torch_distributed_rank/local_rank/world_size为逐行副本;UNILAB_DP_LOG_DIR常量两侧各定义一次——该字符串是跨进程契约(uni_rl launcher 设置,UniLab worker 读取),任何一侧改名即静默断链;resolve_collector_cpu_ids/launch_torchrun_workers为懒加载委托,签名与 uni_rl 侧强耦合但无编译期/CI 检查。与
uni_rl/algos/rsl_rl.py重复:apply_rsl_rl_rank_seed、resolve_rsl_rl_device、ppo_samples_per_iteration、finish_rsl_rl_distributed、rsl_rl_single_process_topology(uni_rl 侧已随 PPO 封装层一并删除,见 unilab_rl 仓库 chore/remove-rsl-rl-ppo-layer 分支);RslRlVecEnvAdapter/get_policy_obs_dims与 uni_rl 保留的RslRlVecEnvWrapper(APPO 链路仍在消费)语义近似,观测拼接与 done/timeout 语义可独立漂移。unilab-rl==1.3.0为精确 pin,当前无实际漂移;风险在于未来 bump pin 后两侧静默不一致——多卡 PPO 与 APPO 回放只在使用时才触发,单进程 CI 覆盖不到。建议
uni_rl.ipc.dp_launcher的消费面(launch_torchrun_workers、resolve_collector_cpu_ids、UNILAB_DP_LOG_DIR)加契约测试(inspect.signature比对 + 常量比对),仅在 uni_rl 安装时运行(dev 组/CI 已装)。unilab-rlpin 的 PR 检查单中加入「核对 dp_launcher 消费面」一项。证据
src/unilab/rl/distributed.py、src/unilab/rl/vec_env.py(分支feat/issue-1621-ppo-direct-rsl-rl)。src/uni_rl/ipc/dp_launcher.py(resolve_dp_topologyL35、resolve_collector_cpu_idsL106、validate_dp_launchableL223、launch_torchrun_workersL264、UNILAB_DP_LOG_DIRL24)、src/uni_rl/algos/rsl_rl.py。chore/remove-rsl-rl-ppo-layer。