Repository navigation
Conversation
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
There was a problem hiding this comment.
Code Review
This pull request introduces the experimental PARALLEL_EVAL setup repair policy, which optimizes setup timing in parallel batches. It adds multi-threaded move generators (RebufferMt, SizeDownFanoutMt, SplitLoadMt, SwapPinsMt, UnbufferMt, VtSwapMt, and SizeUpMt), integrates a sequential timing estimator for flip-flop setup/hold checks, and introduces profiling and diagnostic tools like report_delay_estimator_accuracy_for_rebuffering. The review feedback highlights several critical issues and optimization opportunities, including a bug in SwapPinsMtCandidate::estimate() where non-improving swaps are not marked illegal, potential undefined behavior in RebufferPlannerPool::acquire(), and performance enhancements such as replacing std::hypot with std::sqrt in hot paths, using std::bit_cast, and avoiding unnecessary copies of RebufferTreePlan.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ae428a9 to
c9e0c86
Compare
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
What: the Mt delay estimator models the fanin side loads, the opposite output transition, the latch D-side driver and the flip-flop setup and hold change of a cell swap, and SizeUpMt and VtSwapMt charge them. Why: scoring a swap on the selected path alone let a scored gain turn into a loss after the timing update. How: side models in DelayEstimator and SequentialTimingEstimator, input cap budgets that workers can check without STA, and ArcDelayState renamed to EstimatorContext. The side models are off by default. Setup repair profiler review follow-ups: the profiler constructor takes a RepairSetupProfiler::Mode instead of an int, CRIT_VT_SWAP samples WNS and TNS before its sweep, and the Bazel TestResizerMt target drops the --gtest_filter that skipped the profiler and fixture tests. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: RebufferMt, an Mt buffering move that plans a beam of Rebuffer trees per driver and scores each with the buffer-tree estimator. Why: buffering needs the same scored, comparable candidates as the cell swaps before a batch policy can choose among them. How: makeRebufferTreePlans() and applyRebufferTreePlan() in Rebuffer, estimateBufferTreeWithSidePaths() in DelayEstimator, and current required times after the endpoint scan. No policy runs RebufferMt yet; PARALLEL_EVAL will. LEGACY is unchanged. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: PARALLEL_EVAL, an experimental setup repair policy that commits a batch of VtSwapMt, SizeUpMt and RebufferMt moves per timing update. Why: one timing update per batch instead of per move cuts the repair time. How: worker threads scan endpoints and generate and score candidates from prepared data; BatchSelector, BottleneckAnalysis and ParallelEvalState pick, rank and stop; each batch is kept, salvaged or rolled back by its WNS and TNS (the group's under -path_group). OptimizationPolicy::finish() ends each phase, and the Optimizer prints the final report after the last phase. LEGACY results do not change. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: SplitLoadMt, the Mt form of SplitLoad, joins the PARALLEL_EVAL default sequence. Why: splitting off the less critical loads is a strong setup move that PARALLEL_EVAL lacked. How: estimateLoadChange() scores the lighter target load and the moved loads are charged as side loads; the split itself is chosen as in the serial move. LEGACY is unchanged. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: SwapPinsMt, the Mt form of the pin swap, joins the PARALLEL_EVAL WNS tail. Why: a pin swap is a cheap gain on the worst endpoints once the batches stall. How: Resizer::swapPinDelays() is shared with the serial move; the Mt generator measures the arc delays on the main thread and picks the fastest input on a worker. LEGACY is unchanged. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: UnbufferMt, the Mt form of buffer removal, joins the PARALLEL_EVAL WNS tail. Why: removing a buffer on the worst path is a gain the other Mt moves cannot make. How: the main thread checks the buffer and estimates the saved delay; the tail removes buffers only in single-move batches, since a removal cannot be reverted in place. LEGACY is unchanged. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: SizeDownFanoutMt, the Mt form of SizeDownFanout, joins the PARALLEL_EVAL WNS tail, and every Mt generator follows the same steps: isApplicable() and prepareInputs() on the main thread, generate() and estimate() on the workers. Why: the last serial move with an Mt form, and one rule for which code may read live STA. How: SizeDownFanoutMt measures the step-down cell per off-path load; the virtual MoveGenerator::prepareInputs(Target&) replaces the per-move prepare branches of the policy. PARALLEL_EVAL also stops at the walked -max_utilization area. LEGACY is unchanged. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: profile mode 3 records what every move did to timing, and report_delay_estimator_accuracy_for_rebuffering compares the buffer-tree estimate of a driver with STA. Why: to find the moves whose estimate misled the repair and to measure the buffer-tree estimator. How: RepairSetupAnalysis snapshots each move and samples timing after it; the report plans the trees as RebufferMt does, applies the best one in an ECO journal and undoes it. Lower profile modes do not change. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
c9e0c86 to
f2f551c
Compare
|
Claude == Priority 1 (correctness) ==
== Priority 2 (QoR) ==
|
|
Codex
|
| // Captures timing and topology before and after one ECO move for analysis. | ||
| // Construct it before apply() on the main thread; the caller refreshes RC and | ||
| // STA before the second sample. | ||
| class RepairSetupAnalysis |
There was a problem hiding this comment.
This name is confusing as it isn't really a full analysis but more of a capture of state. Perhaps RepairSetupMoveSampler ?
There was a problem hiding this comment.
Similarly RepairSetupMoveSnapshot.hh
| if { [lsearch -exact {0 1 2 3} $profile_mode] == -1 } { | ||
| utl::error RSZ 3243 "-profile_mode must be 0, 1, 2 or 3." |
There was a problem hiding this comment.
Do such validation in c++ so it covers all APIs and not just TCL
Part 11 of 12 of the PARALLEL_EVAL setup repair stack. It builds on #11803 and also shows the commits of parts 1 to 10; its own change is the last commit.
Summary
Changes
-profile_mode 3: before each move,RepairSetupAnalysissnapshots the target path, its pins, arcs and connections; after the timing update it samples WNS, TNS, the target slack and the estimator window delay.RepairSetupAnalysisReportwrites CSV files underanalysis/and a Markdown report for each flagged move (bad_moves.md).report_delay_estimator_accuracy_for_rebuffering -inst inst [-driver_pin pin] [-delay_levels n]plans and scores the trees of a driver as RebufferMt does, applies the best one inside an ECO journal, prints the estimate next to STA with the side paths it charged, and undoes the tree.flowchart LR subgraph M["profile mode 3, per move"] A["snapshot"] --> B["apply the move"] --> C["RC and STA update"] --> D["sample and compare"] --> E["analysis/*.csv,<br/>bad_moves.md"] end subgraph R["rebuffer accuracy report"] P["plan and score the trees<br/>as RebufferMt does"] --> Q["estimate the best one"] --> X["apply in an ECO journal"] --> Y["measure with STA"] --> Z["print both, undo"] endBehavior
-profile_modebelow 3, logs and results stay the same. Mode 3 is for debugging: it costs about twice the run time and writes large files.Stack