Skip to content

feat(reset): publish call-graph diagnostics - #1942

Merged
TATP-233 merged 1 commit into
dev/issue-1811-tensor-managerfrom
feat/reset-call-graph-diagnostics
Oct 2, 2026
Merged

TATP-233 merged 1 commit into
dev/issue-1811-tensor-managerfrom
feat/reset-call-graph-diagnostics

Conversation

@TATP-233

@TATP-233 TATP-233 commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Why

#1874 has exhausted reset transport and tensor-expression micro-optimizations: #1913, #1914, #1940, UniSim #332, and #1941 were all neutral, while phase timings repeatedly reflected queued GPU drain rather than Python dispatch. Before implementing an owner-level fused reset transaction, the call graph itself must be measured rather than inferred from wall-time labels.

Change

Add stable selected-reset count diagnostics alongside existing timing keys:

  • reset_done_event_term_count — configured reset-mode event terms.
  • reset_done_command_term_count — configured command terms.
  • reset_done_manager_reset_count — Manager reset passes invoked (currently seven).
  • reset_done_observation_term_count — observation terms declared across groups.
  • reset_done_sampler_host_transfer_count — explicit sampler D2H transfers in TensorMotionCommand reset:
    • one row-selector D2H for adaptive reset sampling;
    • three mirror D2H transfers during per-step frame advance (frames, clip indices, clip ends).

Implementation:

  • Extend the stable reset schema in backend_timing.py.
  • Publish counts from ManagerBasedRlEnv.reset().
  • Add an opt-in CommandManager.reset_diagnostics() collection boundary.
  • TensorMotionCommand resets its per-reset transfer counter before resampling and exposes the count through the command boundary.
  • Collector benchmark treats these as count samples, aggregated like reset_done_count.
  • Add a real MJWarp rollout test that forces all rows done and asserts the canonical FlashSAC motion call graph:
    • 0 reset event terms (DR-free owner);
    • 1 command term;
    • 7 manager reset passes;
    • 17 observation terms;
    • at least one sampler host transfer.

No reset semantics, manager execution, term dispatch, RNG, observations, or backend APIs change.

Validation

  • UNILAB_LOCAL_UNISIM=... uv run pytest -q tests/base/test_torch_env.py tests/managers tests/envs/test_motion_command_partial_reset.py tests/envs/mdp/test_uniform_velocity_command.py — 137 passed.
  • Real MJWarp call-graph rollout — passed.
  • Full non-slow suite — 1815 passed / 20 skipped / 566 deselected.
  • make check — passed (existing cli.py Drake import warning only).

Intended use

This is diagnostic-only and deliberately performance-neutral. The next 592 run can now report Manager dispatch counts per reset row, and the fused-reset contract can prove that a candidate removes Manager passes instead of merely shifting a timing boundary.

@TATP-233
TATP-233 requested a review from caozx1110 as a code owner October 2, 2026 14:42
@TATP-233
TATP-233 merged commit 35255d4 into dev/issue-1811-tensor-manager Oct 2, 2026
@TATP-233
TATP-233 deleted the feat/reset-call-graph-diagnostics branch October 2, 2026 16:26
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.

1 participant