Support: trace native decode overlap - #1811
Conversation
- Correlate graph, staging, prepare, launch, device, release, and retirement spans with scheduler-owned identities - Keep pipeline records on native thread lanes and standardize lifecycle attributes on slot_id - Add a machine-readable assertion for native prepare overlap and FIFO launch ordering - Exercise the assertion in the existing A2/A3 concurrent-prepare stress test
📝 WalkthroughWalkthroughThe change adds host-clock tracing for native pipeline lifecycle phases. It records dispatch identities and validates adjacent-dispatch preparation overlap, launch ordering, and ordered release through ChangesNative pipeline tracing and validation
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Orchestrator
participant WorkerThread_submit_dispatch
participant NativeRunContext
participant strace_timing
Orchestrator->>Orchestrator: Emit graph_build and retirement spans
WorkerThread_submit_dispatch->>WorkerThread_submit_dispatch: Emit frame_staging span
NativeRunContext->>NativeRunContext: Record device trace start
NativeRunContext->>strace_timing: Provide native pipeline spans
strace_timing->>strace_timing: Validate adjacent dispatch overlap and release order
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/dfx/host-trace.md`:
- Around line 122-125: Update the adjacent-dispatch overlap requirements in the
command documentation to state that native_prepare(N+1) must finish after
device_execution(N) starts and no later than device_execution(N) ends, while
preserving the existing start-before-end and ordered_release constraints.
In `@src/common/hierarchical/pipeline_trace.h`:
- Around line 49-53: Update the STRACE formatting call in the pipeline trace
emission to populate the tid field with the actual native thread ID, matching
the mechanism used by strace_tid(), while retaining getpid() for pid and leaving
the remaining fields unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 68aad3ec-83ea-4ed3-9b56-9b546304d1ca
📒 Files selected for processing (11)
docs/dfx/host-trace.mdsimpler_setup/tools/strace_timing.pysrc/common/hierarchical/orchestrator.cppsrc/common/hierarchical/pipeline_trace.hsrc/common/hierarchical/types.hsrc/common/hierarchical/worker_manager.cppsrc/common/log/include/common/strace.hsrc/common/platform/onboard/host/c_api_shared.cppsrc/common/worker/native_run_context.htests/st/a2a3/host_build_graph/concurrent_prepare_stress/test_concurrent_prepare_stress.pytests/ut/py/test_strace_timing.py
32ed069 to
415760e
Compare
Summary
run_id / dispatch_id / slot_id / generationthrough the trace and add--assert-native-overlapfor machine-verifiable orderingTesting
pre-commit run --files ...pytest -q tests/ut/py/test_strace_timing.py(18 passed)_task_interfacebuildtest_orchestrator(54 passed)test_scheduler(66 passed)test_chip_run_lane(17 passed)task-submitbuild_package_a2a3with PTO-ISA pin0cefc9a5a1c24c62655cc345d408559595a8af32test_concurrent_prepare_overlapviatask-submit(1 passed, 40 runs / 39 adjacent pairs)