Repository navigation
fix(motion): gather reference frames from device carrier in full refresh - #2105
Merged
Merged
Conversation
TensorMotionCommand._refresh_motion_torch read the host NumPy MotionSampler.current_frames on the full (rows=None) refresh path, but c9a8169 removed the host mirror sync when stepping moved to TensorMotionSampler.step_full, leaving the host frames frozen at zero. Every per-step refresh re-ingested frame 0 of the reference clip into the command, motion-anchor observations, and tracking rewards for all TensorMotionCommand owners (flashsac all sims, sac/mjwarp), in both training and eval. Gather from the device time_steps carrier instead, matching the selected-rows branch, and add a regression test that keeps the host sampler frozen at frame 0 and asserts the full refresh gathers the advanced device frames. Fixes #2104
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TensorMotionCommand._refresh_motion_torch的全量刷新分支(rows is None)改为从设备端time_stepscarrier gather 参考帧,与 selected-rows 分支一致。c9a8169d(perf: publish full sampler step)把 sampler 步进移到设备端step_full时删除了_sync_tensor_sampler_state()宿主镜像同步,宿主MotionSampler.current_frames永久冻结为全 0,而全量刷新仍在读它——每步把参考动作第 0 帧写入 command、motion_anchor_pos_b/ori_b观测和全部 tracking 奖励,机器人表现为"只追踪第一帧"。TensorMotionCommandCfgowner(flashsac 全部 sim、sac/mjwarp)自 2026-10-03 起的训练参考均为冻结第 0 帧,修复后这些路径的 checkpoint 需要重新训练;NumPyMotionCommand路径(如 ppo)不受影响。test_tensor_command_full_refresh_gathers_advanced_frames:宿主 sampler 保持冻结在第 0 帧,断言全量刷新 gather 的是步进后的设备帧号(已验证该测试在修复前失败、修复后通过)。Linked Work
mainValidation
make test-allpassed on the final local head before this PR was created or updated(见下:13 个失败为 main 上已存在的 macOS 环境问题,与本改动无关)Commands actually run:
make test-all的 13 个失败全部位于tests/training/test_cuda_mps_cli.py,失败原因OSError: AF_UNIX path too long(macOS 本机临时目录路径过长),在未含本改动的origin/main(cbafb50)上复现完全相同,属已存在的环境问题,与本改动无关。Remote CI route:
main: 当前 head CI 链接与状态待 PR 创建后补充。Impact
Artifacts
Checklist
test_cuda_mps_cli.py的 macOS 环境问题建议单独处理)