Skip to content

feat(microduck): add bilateral mirror loss and keep turn-in-place commands - #1493

Closed
alexhegit wants to merge 2 commits into
dev/issue-1042-manager-based-apifrom
feat/microduck-rl
Closed

feat(microduck): add bilateral mirror loss and keep turn-in-place commands#1493
alexhegit wants to merge 2 commits into
dev/issue-1042-manager-based-apifrom
feat/microduck-rl

Conversation

@alexhegit

Copy link
Copy Markdown
Collaborator

Summary

  • Add RSL-RL mirror loss (use_data_augmentation=false) for the MicroDuck 61D/14D policy contract, on both the PD and BAM owners. Without it, MuJoCo position-PD PPO converges to seed-dependent one-sided turning.
  • Keep the 15% turn-in-place command bucket from being zeroed by the base standing sampler.
  • Do not change the BAM actuator model or the microduck 对齐 child 3/5: reward / MDP 栈对齐到上游当前 HEAD #1455 reward stack. Multi-GPU env counts stay out of owner YAML.

Builds on #1475 (BAM) and #1455 (reward stack).

Scope

In

  • microduck_velocity_symmetry plus involution / lateral-and-yaw sign-flip tests
  • symmetry_cfg on microduck_velocity_flat/mujoco.yaml and microduck_velocity_bam_flat/mujoco.yaml
  • MicroduckVelocityCommand._resample_command: is_standing_env[turn_ids]=False and refresh vel_command_w
  • Contract tests: PD owner enables mirror loss; BAM and PD share the same symmetry function

Out

Local training notes (not in-tree)

On a 4×MI210 host with a MuJoCo CPU pool, algo.num_envs is per rank:

uv run train --algo ppo --task microduck_velocity_bam_flat --sim mujoco \
  algo.num_envs=2048 algo.max_iterations=12000 \
  'training.devices=[0,1,2,3]'

Global 8192 improved throughput versus 1024/rank and improved PD omnidirectional coverage on this machine. That is host CPU-thread evidence, not a cross-machine default.

BAM 12k (2026-09-04_12-41-58): no NaN; error_vel_yaw 2.13 (PD 12k on the same host was ~9.7); fixed-command stand yaw ≈0, turn-left +0.60 / turn-right −0.72 vs ±0.7. Forward/lateral tracking is still weak and is out of this PR.

Tightening tracking_ang_vel sigma 0.5→0.25 on a PD resume lowered non-yaw rewards as well; it is not adopted.

Validation

  • make check (ruff / mypy / pyright) passed with Node 24 (PATH via nvm; system Node 12 cannot run pyright).
  • uv run pytest tests/envs/locomotion/microduck tests/envs/locomotion/test_sensor_reward_terms.py -m "not slow": 63 passed.
  • uv run python scripts/benchmark/smoke_test.py: passed (mlx scripts skipped as platform-optional).
  • Full make test-all test-cov: 2541 passed. Remaining failures/errors on this host were missing HF meshes (go2/a2/allegro recovered after unilab-pull-assets; t800 still missing LINK_HIP_PITCH_R.obj) and off-policy logger tests asserting untruncated labels under a narrow captured terminal. None of those paths are in this diff.

Made with Cursor

Align the MBA velocity owner with pollen-robotics develop@29e887ec
rewards, keep turn-in-place commands from being zeroed, and add the
61D/14D bilateral mapping so 4-GPU MuJoCo runs stop collapsing to a
one-sided gait.

Co-authored-by: Cursor <cursoragent@cursor.com>
@alexhegit
alexhegit requested a review from TATP-233 as a code owner September 4, 2026 10:02
The 2048-per-rank / 8192-global scale is host-specific training
evidence, not a contract default; record it in the PR instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@TATP-233

TATP-233 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

全部迁移至
https://github.com/unilabsim/microduck_rl_unilab

@TATP-233 TATP-233 closed this Sep 4, 2026
@TATP-233
TATP-233 deleted the feat/microduck-rl branch September 4, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants