fix(wbc): drop wrong-family default checkpoint; actionable error + SONIC-stack detection#847
Conversation
…NIC-stack detection
create_policy("wbc") with no checkpoint defaulted to the HuggingFace repo
nvidia/GEAR-SONIC, which ships the SONIC VLA inference stack
(model_encoder.onnx / model_decoder.onnx / planner_sonic.onnx) - not the
decoupled-WBC Balance/Walk ONNX policies WBCPolicy actually loads. The result
was a silent download of the wrong model family followed by a confusing
'main ONNX checkpoint not found' error (which even suggested GEAR-SONIC).
Changes:
- Remove the _DEFAULT_HF_REPO = 'nvidia/GEAR-SONIC' default. A missing
checkpoint now raises an actionable error before any network call, pointing
at the NVlabs/GR00T-WholeBodyControl git-LFS tree where the Balance/Walk
ONNX live.
- Add _reject_sonic_inference_stack(): when a checkpoint dir holds the SONIC
encoder/decoder/planner ONNX but no policy.onnx, raise a clear error
explaining it is the wrong family and where to get the right weights.
- Centralize the not-found message in _checkpoint_not_found_message().
- Update docs (policies/wbc.md, training/vla_workflow.md) + example
placeholder paths to point at the correct LFS source.
Regression tests fail on pre-fix code (reproduce the GEAR-SONIC download) and
pass after: TestDefaultCheckpoint covers the no-checkpoint actionable error
(no download attempted), SONIC-stack rejection, and the explicit-dir happy
path.
yinsong1986
left a comment
There was a problem hiding this comment.
Summary
This PR removes the wrong-family default checkpoint (_DEFAULT_HF_REPO = "nvidia/GEAR-SONIC") from WBCPolicy. Previously a bare create_policy("wbc") silently downloaded the SONIC VLA inference stack (encoder/decoder/planner ONNX) instead of the decoupled-WBC Balance/Walk policies the provider actually loads, then failed with a confusing policy.onnx not found whose hint pointed back at the same wrong repo. Now a missing checkpoint raises an actionable RuntimeError before any network call, naming the correct NVlabs/GR00T-WholeBodyControl git-LFS source. A new _reject_sonic_inference_stack() guard rejects an explicitly-passed SONIC-stack directory up front (while leaving a dir that colocates a SONIC marker with policy.onnx alone), and the not-found message is centralized in _checkpoint_not_found_message(). Docs and example placeholder paths are updated to a neutral grootwbc-g1 dir name.
Traced the no-checkpoint path: checkpoint=None -> _maybe_download_checkpoint(None) returns None (no network), _reject_sonic_inference_stack(None) short-circuits, and the resolver raises the centralized no-checkpoint message. The default-behavior change is loud (explicit RuntimeError, not a silent coercion), the removed constant is private (_-prefixed, not in __all__), and the SONIC-detection helper handles the None/file/dir cases without a crash. No security surface, no wire-format/schema/public-signature changes, no host paths or emojis in the new strings. Verdict: no blocking concerns.
What's good
- Fails fast with an actionable error before the network call, matching AGENTS.md #5/#6 (raise on fatal, no silent wrong-family fetch) and the loud-default-change pattern (AGENTS.md PR #86 > Safety Defaults).
- Regression tests pin the behavior:
snapshot_downloadis wired to assert-raise if reached, and the SONIC-detection edge cases (None, a file, marker-with-policy.onnx) each have a dedicated test. - Scope-disciplined: a loading-path correctness + UX fix with matching doc/example updates, no incidental behavior change to a loaded gait.
Problem
create_policy("wbc")with nocheckpointdefaulted to the HuggingFace reponvidia/GEAR-SONIC. That repo ships the SONIC VLA inference stack (model_encoder.onnx,model_decoder.onnx,planner_sonic.onnx,low_latency/*) — not the decoupled-WBC Balance/Walk ONNX policiesWBCPolicyactually loads (policy.onnx/walk_policy.onnx).The decoupled-WBC G1 weights live only in the
NVlabs/GR00T-WholeBodyControlgit-LFS tree atdecoupled_wbc/sim2mujoco/resources/robots/g1/policy/(GR00T-WholeBodyControl-Balance.onnx+GR00T-WholeBodyControl-Walk.onnx), not as a standalone HF repo.So a bare
create_policy("wbc")silently downloaded ~MB of the wrong model family, then failed with a confusingWBCPolicy main ONNX checkpoint not found— whose own hint pointed back atnvidia/GEAR-SONIC, sending the user in a circle.Change
_DEFAULT_HF_REPO = "nvidia/GEAR-SONIC"default. No weights are bundled and there is no working default repo to guess, so a missing checkpoint now raises an actionable error before any network call, pointing at the correct NVlabs git-LFS source._reject_sonic_inference_stack(): if a checkpoint directory holds the SONIC encoder/decoder/planner ONNX but nopolicy.onnx, raise a clear error up front explaining it is the wrong family and where to obtain the Balance/Walk weights (covers the case where a user explicitly passes the SONIC checkpoint). A dir that colocates both a SONIC marker andpolicy.onnxis left alone._checkpoint_not_found_message()with distinct text for the no-checkpoint vs. resolved-but-missing cases.docs/policies/wbc.mdnow explains there is no default download and gives the exactgit clone+ copy steps from the NVlabs LFS tree; clarifies thatnvidia/GEAR-SONICis the SONIC inference stack, not this family. Updateddocs/training/vla_workflow.md+ example placeholder paths to a neutralgrootwbc-g1dir name.Behavior after fix
No network call is made for the no-checkpoint path (verified by the regression test, which wires
snapshot_downloadto assert-raise if reached).Tests
New
TestDefaultCheckpointclass intests/policies/wbc/test_policy.py:test_no_default_hf_repo_constant— the wrong-family default constant is gone.test_create_policy_wbc_without_checkpoint_raises_actionable_error— barecreate_policy("wbc")raises the actionable error and attempts no download.test_no_checkpoint_message_points_at_nvlabs_lfs— message names the LFS path + warns GEAR-SONIC is the wrong family.test_sonic_inference_stack_dir_rejected/test_sonic_marker_with_policy_onnx_is_allowed/test_reject_sonic_noops_on_none_and_files— SONIC-stack detection.test_explicit_checkpoint_dir_still_works— explicit local checkpoint dir happy path unchanged.These fail on pre-fix code (reproducing the
nvidia/GEAR-SONICdownload) and pass after.Gate
ruff check strands_robots tests tests_integ: cleanruff format --check: cleanmypy strands_robots tests tests_integ: Success, no issues in 564 source filesMUJOCO_GL=egl pytest tests/policies/wbc/: 109 passed (7 new)No behavior change to a loaded gait — this is a loading-path correctness + UX fix, so a rollout video is not applicable; the before/after error reproduction above is the relevant proof.