Download all_scripts/audit_pipe.py from SeanWang0027/rose-opd-implementation: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/SeanWang0027/rose-opd-implementation/resolve/main/all_scripts/audit_pipe.py
- Command line
-
hf download hf://SeanWang0027/rose-opd-implementation/all_scripts/audit_pipe.py
-
curl -L -o audit_pipe.py https://huggingface.co/SeanWang0027/rose-opd-implementation/resolve/main/all_scripts/audit_pipe.py
1.27 kB
| """静态核对: 流水路径与同步路径在关键行为上是否一致。""" | |
| P = "/home/haojinw2/rose-bundle-new/verl/recipe/rose/rose_agent_loop.py" | |
| s = open(P).read() | |
| sync = s[s.index("async def _run_sync"): s.index(" # ==================================================================")] | |
| pipe = s[s.index("async def _run_pipelined"):] | |
| checks = [ | |
| ("teacher budget 上限受 response_length 约束", "response_length - len(prefix_ids)" in pipe), | |
| ("跨词表 splice 走同一函数", "self._splice(" in pipe and "self._splice(" in sync), | |
| ("train_prefix 分支", "self.train_prefix" in pipe and "self.train_prefix" in sync), | |
| ("on_early_finish=drop 生效", '"drop"' in pipe or 'item["drop"]' in pipe), | |
| ("resample 逻辑", "resample" in pipe), | |
| ("response 截断到 response_length", "[: self.response_length]" in pipe), | |
| ("seam_shift 上报", "seam_shift" in pipe), | |
| ] | |
| for name, ok in checks: | |
| print(f" [{'OK' if ok else '缺'}] {name}") | |
| # drop 语义: 同步版 skip 后 teacher_ids 为空 -> mask 全 0; 流水版 tprompt=None -> reply 空 -> 同样全 0 | |
| print("\n同步版 drop 处理:", "skip = early_finish and self.on_early_finish" in sync) | |
| print("流水版 drop 处理: tprompt 置 None ->", 'if not drop and prefix_ids:' in s) | |