perf: sync mjwarp CUDA graph capture from main (#1273) - #1284
Merged
TATP-233 merged 1 commit intoAug 24, 2026
Conversation
7 tasks
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
将 main 的 mjwarp CUDA graph 优化(1939cfd4, #1273)同步到 dev 分支。dev 与 main 目前仅此一个提交的分叉;cherry-pick 内容与 main 完全一致(同一 patch,未来 dev↔main 收敛时可按 patch-id 干净合并)。
与 #1283(已合入)的 tracked body kinematics 兼容性:CUDA graph 只替换 step/forward/reset 的设备侧执行方式(固定地址 graph replay),
_sensor_cache仍在每个显式 barrier 由_refresh_host_cache下载,tracked body 视图语义不变。本提交树与本地完整验证过的树逐字节一致(
git diff为空),以下验证直接有效:Validation
tests/base/test_mjwarp_cuda_graph.py:7 passed(默认 lane,fake 单测)。tests/base/test_mjwarp_backend.py + test_mjwarp_capabilities.py -m slow:7 passed(真实 CUDA;含 body-state parity 与 graph launch 顺序断言)。make test-all:通过(exit 0)。uv run train --algo sac --task g1_walk_flat --sim mjwarp完整 5000 iterations:总耗时 4m04s → 2m27s(约 40% 提升,RTX 4090),训练与 play 视频渲染均正常。Related: #1273, #1282, #1283