Add per-step routing overhead timing to output JSON#12
Open
lmcafee-nvidia wants to merge 1 commit into
Open
Conversation
Temporary instrumentation to measure MoE routing replay overhead. Times four operations per step: routing_gather (bookkeeping + GPU-to-CPU), routing_store (per-block distribution), routing_reconstruct (block reassembly on completion), and routing_finalize (chunk concatenation). Output is a "step_details" array in the JSON with per-step prefill/decode counts, step time, and all four routing timings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
routing_gather(_router_record_bookkeeping),routing_store(store_routing_per_block),routing_reconstruct(reconstruct_routing_from_blocks),routing_finalize(finalize_routing_chunks)"step_details"array in the JSON with per-step prefill/decode request counts, step time, and all 4 routing timingsKey finding
With CUDA graphs enabled on nano-v3,
routing_gatherdominates decode overhead at ~22ms/step (74% of decode step time). The bottleneck is.cpu().numpy()in_router_record_bookkeepingwhich forces a full CUDA sync, blocking until the async CUDA graph replay completes.Test plan
🤖 Generated with Claude Code