Conversation
|
- event_manager: interval_step==1 fast path passes the explicit all-row ID tensor (torch.arange) instead of None — functors calling len(env_ids) (e.g. randomize_rigid_object_mass) keep working - contact_history: black formatting on the pooled allocation - tests: focused coverage for the env_ids=None fused reset path
G1×4096 NoRender 训练实测(RTX 5090 D):SPS 80.6k → 95.8k(+19%),passed。 - contact_history: 按 dtype/shape 家族池化分配(10 独立张量 → 6 池), 重置从 10 次 CUDA 写融合为 foreach 1 次(全量)/ 6 次广播写(子集) - event_manager: interval_step==1 的事件走 env_ids=None 快路径, 消除每 control step 一次 GPU nonzero + 宿主 len() 设备同步 (contact_sensor 重置图与 reset_masked 为 graph 化预留,暂不入库)
- event_manager: interval_step==1 fast path passes the explicit all-row ID tensor (torch.arange) instead of None — functors calling len(env_ids) (e.g. randomize_rigid_object_mass) keep working - contact_history: black formatting on the pooled allocation - tests: focused coverage for the env_ids=None fused reset path
ef3628a to
a95a655
Compare
…ll-row IDs - tests: focused EventManager test with a spy functor asserting env_ids is a torch.long tensor on env.device and equals torch.arange(env.num_envs) (regression guard for the interval_step==1 dispatch contract; functors calling len(env_ids) require explicit IDs) - event_manager: cache the manager-owned all-row ID tensor during preparation and treat it as read-only (~0.03 µs reuse vs ~5 µs fresh torch.arange per call, per the maintainer's bounded probe) Both findings confirmed on a95a655 by yuecideng; the P3 caching follows the maintainer's suggested design.
| @@ -0,0 +1,50 @@ | |||
| """interval_step==1 快路径:functor 收到显式全量 ID 张量(非 None)。""" | |||
There was a problem hiding this comment.
New test lacks required conventions
This new file omits the required DexForce 2021–2026 Apache 2.0 copyright header and from __future__ import annotations. The multiline self.calls.append at lines 14–16 also needs the repository-required Black formatting. These requirements must be satisfied before merging.
Context Used: CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/gym/envs/managers/test_event_manager_interval_fastpath.py
Line: 1
Comment:
**New test lacks required conventions**
This new file omits the required DexForce 2021–2026 Apache 2.0 copyright header and `from __future__ import annotations`. The multiline `self.calls.append` at lines 14–16 also needs the repository-required Black formatting. These requirements must be satisfied before merging.
**Context Used:** CLAUDE.md ([source](https://github.com/dexforce/embodichain/blob/main/CLAUDE.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| lambda mode, name, cfg, env, ids: received.append(ids), | ||
| ) | ||
|
|
||
| manager.apply(mode="interval") |
There was a problem hiding this comment.
The test calls apply() only once, so it would pass if the interval-one path went back to allocating a new ID tensor on every control step. The repository requires focused tests that prove new production behavior. Assert that successive calls reuse the cached tensor to protect this throughput change before merging.
Context Used: CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/gym/envs/managers/test_event_manager_interval_fastpath.py
Line: 43
Comment:
**Cache reuse remains untested**
The test calls `apply()` only once, so it would pass if the interval-one path went back to allocating a new ID tensor on every control step. The repository requires focused tests that prove new production behavior. Assert that successive calls reuse the cached tensor to protect this throughput change before merging.
**Context Used:** CLAUDE.md ([source](https://github.com/dexforce/embodichain/blob/main/CLAUDE.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
reset()fused from 10 CUDA writes → 1_foreach_zero_(full reset) / 6 broadcast writes (subset reset)interval_step == 1events take anenv_ids=Nonefast path, eliminating a per-control-step GPUnonzero+ hostlen()device synchronizationWhy
G1 × 4096 NoRender training is bound by the host-side Python orchestration (~600k calls/control step, GPU busy <25%). The contact sensor reset chain (36 advanced-indexing writes per episode reset, ×26 resets/iteration early in training) and the per-step event scheduling sync were the two largest measurable contributors.
Benchmark
G1 × 4096, NoRender + newton physics, RTX 5090 D, 2 warmup + 10 iterations,
passed, compiles=0:7ae9a5012)GPU peak 9.1 GiB / 24.5 GiB.