ibrobot-inference-verify
Unified inference runtime verification on host and board. Use when users mention "inference verification", "推理验证", "mock test", "ROS mock", "perception test", "policy test", "ACT test", "RAM++ test", "SAM2 test", "SigLIP2 test", "OM test", "Torch NPU test", "板端验证", "本机验证", "use_sim true", "platform mock", "model_service test", "typed service test", or need to verify that the unified inference runtime (ModelRuntimeHandle, ModelSession, RuntimeAssembly) works end-to-end through the ROS pipeline. Covers host CPU/CUDA Torch policy and perception models, board Ascend OM models, and board Torch NPU.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-10
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- ibrobot-inference-verify
- license
- Apache-2.0
- description
- Unified inference runtime verification on host and board. Use when users mention "inference verification", "推理验证", "mock test", "ROS mock", "perception test", "policy test", "ACT test", "RAM++ test", "SAM2 test", "SigLIP2 test", "OM test", "Torch NPU test", "板端验证", "本机验证", "use_sim true", "platform mock", "model_service test", "typed service test", or need to verify that the unified inference runtime (ModelRuntimeHandle, ModelSession, RuntimeAssembly) works end-to-end through the ROS pipeline. Covers host CPU/CUDA Torch policy and perception models, board Ascend OM models, and board Torch NPU.
- compatibility
- Requires IB_Robot workspace with .shrc_local, ROS 2 Humble overlay, LeRobot patch stack applied, and model bundles under models/. Board tests require SSH access to an Ascend board: default ssh OPi_20T (Ascend 310B); when it is unreachable, ask the user for the access method of their 310B (Orange Pi) or 310P (AI Station) board and the IB_Robot path on it. Perception ROS service tests require model bundles with v3 manifest and adapter.json containing interface/model_type fields.
02 资源文件 17
- 参考文档references/board.md7.4 KB
- 参考文档references/host.md7.2 KB
- 参考文档references/troubleshooting.md11.4 KB
- 脚本run.sh3.4 KB
- 脚本sanity.sh1.1 KB
- 脚本scripts/bench_fullsubnet.py1.6 KB
- 脚本scripts/call_perception_services.py4.7 KB
- 脚本scripts/call_tts.py1.6 KB
- 脚本scripts/generate_verify_yaml.py6.2 KB
- 脚本scripts/make_speech_wav.py2.5 KB
- 脚本scripts/prune.sh1.6 KB
- 脚本scripts/redeploy.sh2.3 KB
- 脚本scripts/run_board_tier6.sh1.5 KB
- 脚本scripts/run_fullsubnet.sh3.1 KB
- 脚本scripts/run_perception_services.sh1.8 KB
- 脚本scripts/run_policy_mock.sh1.1 KB
- 脚本scripts/run_zipvoice.sh3.4 KB
03 SKILL.md 正文
IB-Robot Inference Runtime Verification
End-to-end verification of the unified inference runtime through the ROS pipeline on both host (CPU/CUDA Torch) and board (Ascend 310B OM, Torch NPU).
When to Use
- After native runtime or inference_service code changes that affect
ModelSession,ModelRuntimeHandle,RuntimeAssembly,SessionBuilderRegistry, or the policy/perception pipeline. - Before merging a PR that touches
inference_service,perception_service,voice_tts_service,voice_asr_service, ormanipulation_service. - When a user asks to "验证推理", "test inference", "跑一下 mock", or "board inference test".
- After LeRobot patch stack changes that affect policy loading or preprocessing.
Hard Constraints
- Always
source .shrc_localbefore any command (same asibrobot-env). - Use a fresh
ROS_DOMAIN_IDper run (e.g., 93–99) to avoid stale DDS action-server discovery from previous launches. - Never commit files under
models/— that directory is.gitignore-d. - Commit only
src/changes; usegit add <specific-paths>, nevergit add .. - Board operations go through
ibrobot-launch; SSH viassh OPi_20Tby default. If unreachable, resolve access via "Board Access Resolution".
Board Access Resolution
Board tiers (5–7) run on an Ascend NPU development board. Resolve the board target in this order:
- Default: probe the preset target once with
ssh -o ConnectTimeout=5 OPi_20T true(Ascend 310B, openEuler Embedded aarch64). Treat timeout, name resolution failure, or connection refusal as unreachable. - Fallback: when
OPi_20Tis unreachable, use the ask-user tool (interactive question prompt) to request two things from the user:- how to access their Ascend board — either a 310B board (Orange Pi / 香橙派) or a 310P board (AI Station) — e.g. an SSH alias, a host/IP with port and username, or a ready-to-use login command;
- the absolute path of the IB_Robot workspace on that board.
- Substitute the answers for
ssh OPi_20Tand/IB_Robotin every board command below. Never guess hosts, ports, credentials, or board paths; probe a user-provided alias once before running verification commands on it.
Verification Matrix
| Tier | Scope | Method | Platform |
|---|---|---|---|
| 1 | Unit & contract tests | pytest |
Host |
| 2 | ROS overlay build | ./scripts/build.sh --clean |
Host |
| 3 | Policy ROS mock (ACT) | ros2 launch ... use_sim:=true platform:=mock |
Host CPU |
| 4 | Perception ROS typed service | ros2 launch + ros2 service call |
Host CPU |
| 5 | Board OM script | Python script via SSH | OPi_20T 310B |
| 6 | Board OM ROS mock | ros2 launch on board |
OPi_20T 310B |
| 7 | Board Torch NPU (optional) | Python script via SSH | OPi_20T 310B NPU |
Not every PR needs all tiers. Use the table below to pick tiers.
Tier Selection Guide
| Changed code | Required tiers |
|---|---|
model_sessions/, unified_runtime/, pipeline/ |
1, 2, 3 |
perception_service/, model_service_plugins.py |
1, 2, 4 |
voice_tts_service/, voice_asr_service/ |
1, 2, 4b |
manipulation_service/ |
1, 2 |
backends/, runtime_composition.py |
1, 2, 3 |
| LeRobot patch stack | 1, 3, 5 |
Any inference_service change |
1, 2, 3, 5 |
Core Workflow
- Tier 1 — Unit tests:
pytest -q src/inference_service/tests - Tier 2 — Build:
./scripts/build.sh --clean(never rawcolcon build) - Tier 3 — Policy mock: generate YAML with
scripts/generate_verify_yaml.py policy, launch withscripts/run_policy_mock.sh(zsh), checkRESULT=PASS(action_dispatcherreportsFirst inference received) - Tier 4 — Perception service: generate YAML with
scripts/generate_verify_yaml.py perception, launch + call each typed service viascripts/run_perception_services.sh(launch and calls must stay in one shell invocation) 4b. Tier 4b — Speech models: fullsubnet viascripts/run_fullsubnet.sh(streaming pipeline, topic-based evidence) +scripts/bench_fullsubnet.py; zipvoice viascripts/run_zipvoice.sh(typed service). Seereferences/host.mdTier 4b for prerequisites. - Tier 5 — Board OM: SSH to the resolved board target (default
OPi_20T, see "Board Access Resolution"), run OM script per model - Tier 6 — Board ROS mock: Launch ROS mock on board, call typed services
Skill Scripts
| Script | Purpose |
|---|---|
scripts/generate_verify_yaml.py |
Generate mock YAML for policy / perception tiers; auto-resolves the deployment key from each bundle manifest (--device cpu|cuda) |
scripts/run_policy_mock.sh |
zsh: launch policy mock, poll for First inference received, tear down; prints RESULT=PASS/TIMEOUT/FAIL |
scripts/run_perception_services.sh |
zsh: launch perception mock, wait for all endpoints, run the caller, tear down |
scripts/call_perception_services.py |
Call siglip2 / ram_plus / sam2 typed services with a synthetic image (handles stamp matching and response layouts) |
scripts/make_speech_wav.py |
Build a real-speech 6ch 16k wav (LibriSpeech via HF hub + Silero pre-scoring; synthetic audio fails VAD) |
scripts/run_fullsubnet.sh |
zsh: speech_direction wav-replay run (cpu/cuda config generated inline); pass = degraded=False + direction messages |
scripts/bench_fullsubnet.py |
Per-hop fb/sb latency for the stateful torch executor (node timing logs are suppressed) |
scripts/run_zipvoice.sh |
zsh: typed /voice_tts/synthesize run; cuda mode flips providers (restored on exit) + mounts torch CUDA libs + nvidia-smi proof |
scripts/call_tts.py |
SynthesizeSpeech caller with segment details |
scripts/run_board_tier6.sh |
POSIX sh: board ROS mock orchestration (launch + typed service calls + teardown) |
Harness rules: run shell scripts with zsh (bash + set -u breaks
.shrc_local sourcing) and keep launch + verification in one shell
invocation. Detail: references/host.md and
references/troubleshooting.md.
Internal References
| Purpose | Reference |
|---|---|
| Host verification commands (tiers 1–4): pytest, build, mock YAML, service call scripts | references/host.md |
| Board verification commands (tiers 5–6): SSH, OM scripts, board ROS mock | references/board.md |
| Pass/fail criteria, known issues, troubleshooting (DDS stale, adapter.json, batch dim, harness pitfalls) | references/troubleshooting.md |
04 同仓库更多 Skills
atomgit-review-resolution
AtomGit 评审意见处理工具。当用户需要“修复PR评审意见”、“处理review comments”、“apply fixes”、“reply to review”、“回复评论”、“resolve review discussions”、“闭环评审流程”或基于未解决评论继续推进 PR 时使用。只要目标是本仓库在 AtomGit 上的 review comments / discussions,默认优先使用本 skill,而不是 GitHub 默认能力。
atomgit-pr
AtomGit PR 工作流工具。当用户需要在本仓库或 AtomGit 上“创建PR”、“更新PR描述”、“同步PR标题/正文”、“生成PR摘要”、“create pull request”、“open merge request”、“update PR description”、“generate PR summary”或围绕 PR 管理动作工作时调用。它负责 PR 资源的创建和维护,不负责通用代码 review;只要目标是本仓库的 PR / merge request 管理,默认优先使用本 skill,而不是 GitHub 默认能力。
atomgit-pr-review
AtomGit PR 评审工具。当用户需要在本仓库或 AtomGit 上“代码审查”、“PR review”、“review pull request”、“审阅PR”、“帮我看看这个PR”、“检查这个PR有没有问题”、“检查Bug”、“logic check”、“获取完整review上下文”、“提交检视意见”或分析指定 PR 的改动与已有评论时使用。只要目标是本仓库的 PR review,默认优先使用本 skill,而不是 GitHub 默认 review 能力。
atomgit-pr-architecture-review
AtomGit PR 架构评审工具。当用户需要“架构审查PR”、“review architecture compliance”、“检查架构规范”、“审阅PR架构”、“SSOT 合规性检查”、“契约驱动检查”或对指定 PR 做架构维度扫描并提交检视意见时调用。只要目标是本仓库的 PR 架构评审,默认优先使用本 skill,而不是 GitHub 默认 review 能力。
atomgit-issue
AtomGit Issue 工作流工具。当用户需要在本仓库或 AtomGit 上“创建Issue”、“查看Issue详情”、“更新Issue”、“关闭/重开Issue”、“create issue”、“fetch issue info”、“update issue”、“report bug”、“feature request”或围绕 Issue 做任何创建/读取/更新动作时调用。只要目标是本仓库的 Issue,默认优先使用本 skill,而不是 GitHub 默认能力。
atomgit-collaboration
AtomGit 协作路由工具。当用户在 IB_Robot 仓库中提到“PR”、“merge request”、“Issue”、“review”、“comment”、“discussion”、“帮我看看这个 PR”、“看看 #123”、“处理一下评论”、“同步一下 AtomGit 上的协作状态”、“帮我跟进这个合并请求”等泛化协作请求,但没有明确说明是创建、更新、评审、架构审查还是修复评论时调用。此 skill 不直接执行业务动作,而是先识别用户真实意图,再路由到 atomgit-pr、atomgit-issue、atomgit-pr-review、atomgit-pr-architecture-review 或 atomgit-review-resolution。若用户未明确指定 GitHub,则默认优先按 AtomGit 协作处理。