Files
Robot_Arm/docs/本机执行清单.md
T

64 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 本机执行清单(给本地 AI 逐条执行)
本文件是 Hark 对本机计算的唯一要求清单。按顺序执行,每一步把「回传」里的文件或输出原样交给用户,不要跳步,不要自行改代码。
所有命令在仓库根目录(G:\Robot_v2\机器人手臂)的 Git Bash 里运行。完成的条目由 Hark 在下一次提交里删掉。
## 已知结论(2026-10-19 02:35 回传)
- 特征口径 Python 与 JS 一致(最大差 3.6e-6),同噪声动作差 ~1e-5°:排除「闭环输入没见过」。
- 闭环关安全层 0% 到达 / 99.6% 碰撞,首撞中位 1.46 s,主碰撞组对 2-4;全程最小目标误差中位 254 mm:策略根本没朝目标走。开安全层碰撞 5.5%,到达仍 0.4%。
- 开环正常:ol_fk_mm 5.98、ol_best_mm 2.92、ol_div 0.655。老师回放 pass。
- 下一个嫌疑:子目标。训练时特征里的子目标是老师真实途经点,闭环里换成子目标头自己的预测。第 2 步的 D 段专门验证它。
- gaps 显存:上一版只给精算段分块,粗筛段 4096 点仍 9.3 GiB。本版粗筛也按点分块(每块 ≤ 446 点)。
## 第 0 步:同步代码(不要 reset --hard)
本地有未提交的 `ml/monitor.html`、`ml/pstate.py` 改动和一个未推送的合并提交,`reset --hard` 会把它们丢掉。
```bash
git add ml/monitor.html ml/pstate.py && git commit -m "monitor: 开环指标两张图;pstate: train 归档加 review_*"
git pull --rebase gitea main
git log --oneline -3 # 最上面应是你的 monitor 提交,其下是 Hark 的「fix(kin/diag): …」
git push gitea main
```
- 训练控制台若开着先点「停止」,确认没有 python 训练进程在跑。
- 不要启动 DAgger / M5,等 Hark 看完第 1、2 步结果再定。
## 第 1 步:gaps 显存峰值(不到 1 分钟)
```bash
PYTHONUTF8=1 python - <<'EOF'
import torch
from ml.common.kin_torch import Kin
kin = Kin(device='cuda')
for n, cap in [(512, 40.0), (4096, 4.0), (4096, 40.0)]:
q = kin.lo + (kin.hi - kin.lo) * torch.rand(n, 6, device='cuda')
torch.cuda.empty_cache(); torch.cuda.reset_peak_memory_stats()
with torch.no_grad(): kin.gaps(q, cap)
print(f'n={n:5d} cap={cap:4.0f} peak {torch.cuda.max_memory_allocated() / 2**30:6.2f} GiB', flush=True)
EOF
```
- 通过:三行峰值都 ≤ 2 GiB。
- 专用显存接近 22 GB 或共享显存开始上涨:立刻 Ctrl+C,回传已打印的行,不要继续第 2 步。
- 回传:终端 3 行。
## 第 2 步:闭环失败定位(含新加的 D 段,约 5–8 分钟)
```bash
PYTHONUTF8=1 python -m ml.eval.diag_cl --ckpt ml/runs/base/last.pt --n 256 --out ml/runs/diag_cl.json
```
- 专用显存超过 22 GB 就 Ctrl+C 并回传终端输出。
- 新增输出:`C.goal_err_ratio_p50`(0.5/1/2 s 时目标误差 ÷ 起点误差,<1 表示在靠近);`D0_subhead`(冷启动子目标头精度);`D1_no_sub`(不用子目标);`D2_oracle_sub`(用老师真实途经点)。
- 回传:`ml/runs/diag_cl.json`。
## 回传汇总
| 步骤 | 回传内容 |
|---|---|
| 1 | 终端 3 行峰值 |
| 2 | ml/runs/diag_cl.json |
| 任一步出错 | 终端最后 30 行输出 |