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

63 lines
2.9 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:43 回传)
- 特征口径 Python 与 JS 一致(最大差 3.6e-6):排除「闭环输入没见过」。
- 子目标排除:不用子目标、用老师真实途经点,与基线完全一样(0% 到达 / 99.6% 碰撞)。
- 闭环方向对但极慢:2 s 只把目标误差缩小 18.5%,首撞中位 1.46 s,主碰撞组对 2-4。开环(老师状态上)几乎精确。
- 现在的嫌疑:模型「抄上一帧速度」。第 2 步的 E 段专门验证。
- gaps 显存:粗筛分块已生效(1.05 / 1.40 GiB),4096×40 的 4.46 GiB 全在拼接胶囊对。本版默认只返回 gm,不再拼胶囊对(只有 APG 要)。
## 第 0 步:同步代码
```bash
git status --short # 有未提交改动就先 commit,不要丢
git pull --rebase gitea main
git log --oneline -1 # 应是 Hark 的「fix(kin/diag): gaps 默认不拼胶囊对 …」
```
- 训练控制台若开着先点「停止」,确认没有 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 步:闭环失败定位(含新加的 E 段,约 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 并回传终端输出。
- 新增输出:`E0_openloop`(开环动作幅度 ÷ 老师幅度;把 dq 抹成 0 后的幅度;起点行幅度);`E1_mid_teacher_vel` / `E1_mid_zero_vel`(从老师轨迹 30% 处起步,带老师速度 vs 静止起步:到达、碰撞、1 s 目标误差比、前 1 s 速度 ÷ 老师速度)。D 段已删。
- 回传:`ml/runs/diag_cl.json`。
## 回传汇总
| 步骤 | 回传内容 |
|---|---|
| 1 | 终端 3 行峰值 |
| 2 | ml/runs/diag_cl.json |
| 任一步出错 | 终端最后 30 行输出 |
---