Add sub-stage timing spans to system trace generation#61
Draft
qwang98 wants to merge 1 commit into
Draft
Conversation
Break system_trace_gen into measurable sub-stages to identify where the 1.61x APC overhead in trace generation comes from: - program_tracegen, memory_tracegen: top-level system chip spans - boundary_finalize, rechunk_memory: memory controller sub-stages - merkle_finalize (promoted to info), merkle_from_memory, merkle_tree_finalize - boundary_tracegen, merkle_tracegen: trace matrix creation - Counter metrics: boundary_touched_chunks, merkle_touched_chunks, merkle_initial_tree_nodes, merkle_unpadded_rows Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
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
Add sub-stage timing spans to system trace generation for performance profiling.
All spans are
infolevel, captured byTimingMetricsLayerand emitted as*_time_msgauge metrics.New spans
System chip trace gen (
system/mod.rs):program_tracegen— program chip trace genmemory_tracegen— entire memory controllerMemory controller (
memory/controller/mod.rs):boundary_finalize— boundary chip finalize (promoted fromdebugtoinfo)rechunk_memory— regrouping blocks into chunksboundary_tracegen— boundary trace matrix creationmerkle_tracegen— merkle trace matrix creationMerkle chip (
memory/merkle/trace.rs):merkle_finalize— overall merkle finalize (promoted fromdebugtoinfo)merkle_from_memory— initial merkle tree constructionmerkle_tree_finalize— updating tree with touched leavesNew counter metrics
boundary_touched_chunks— actual (unpadded) chunk countmerkle_touched_chunks— touched leaf countmerkle_initial_tree_nodes— non-default nodes afterfrom_memorymerkle_unpadded_rows— actual merkle trace rows before paddingThese metrics were used to determine that the APC trace gen overhead is NOT in system chips (memory/merkle), but in PowdrAir trace generation.