Fix: render drain/drain_prepare/drain_publish swimlane phases#1358
Conversation
hw-native-sys#1304 added the sync_start stop-the-world drain phase kinds (Drain, DrainPrepare, DrainPublish) to the device and host emit sides (l2_swimlane_profiling.h + host l2_swimlane_collector.cpp) but never taught the Python renderer about them. swimlane_converter.py drops any phase outside its sched-lane whitelist, so a sync_start cohort's launch — emitted as drain_publish, not dispatch — was silently filtered out and the scheduler dispatch work for sync_start SPMD cohorts vanished from the trace. - Add drain/drain_prepare/drain_publish to phase_colors (cq_build family; the outer drain bar time-contains the two inner staging passes so Perfetto nests them by depth) - Add the three phases to the sched-lane render whitelist Verified on a2a3 silicon at l2_swimlane_level=4: spmd_sync_start, spmd_sync_start_early_dispatch, and spmd_sync_start_stress now render the drain phases (rendered phase histogram matches the raw record kinds).
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughScheduler phase visualization now recognizes ChangesScheduler drain phases
Estimated code review effort: 1 (Trivial) | ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Summary
#1304added the sync_start stop-the-world drain phase kinds —Drain,DrainPrepare,DrainPublish— to both the device emit(
l2_swimlane_profiling.h) and the host serializer(
l2_swimlane_collector.cpp, which maps them to"drain"/"drain_prepare"/"drain_publish"), but never taught the Pythonrenderer about them.
swimlane_converter.pydrops any phase outside its sched-lane whitelist.A sync_start SPMD cohort launches through
handle_drain_mode→drain_stage_cores, so its actual launch is emitted asdrain_publish,not
dispatch. Result: the drain records were produced on-device andwritten to
l2_swimlane_records.json, but silently filtered out atrender time — the scheduler dispatch work for every sync_start cohort
vanished from the Perfetto trace.
This wires the three phases into the renderer:
drain/drain_prepare/drain_publishtophase_colors(cq_build color family; the outer
drainbar time-contains the twoinner staging passes, so Perfetto nests them by depth on the track).
Testing
Verified on a2a3 silicon at
l2_swimlane_level=4— for each workload therendered scheduler-lane phase histogram now matches the raw record kinds:
spmd_sync_startspmd_sync_start_early_dispatchspmd_sync_start_stressqwen3_14b_decode(no sync_start) is unaffected —dispatch/completerender as before.