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 policy to the Resizer setup repair architecture, enabling parallel evaluation of multiple targets and batch commits to reduce timing updates. It adds several multi-threaded (Mt) move generators and candidates, a setup repair profiler for run-local diagnostics, and a diagnostic command to report rebuffering delay estimator accuracy. Additionally, EstimateParasitics is updated to track observer-estimated nets, allowing timing reads by observers without clearing pending nets. The review feedback highlights several critical safety improvements, primarily recommending defensive null checks in DelayEstimator.cc and Resizer.cc to prevent potential null pointer dereferences, as well as correcting a truncated FNV-1a 64-bit offset basis constant in Rebuffer.cc.
01f8473 to
fe9e82c
Compare
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>
What: architecture.md describes the setup repair code of this stack: the policy model of LEGACY and PARALLEL_EVAL, the Mt generator steps and threading, the PARALLEL_EVAL batch loop, batch outcome, stop rules, WNS tail stage and effort levels, and the profiler. Why: the document still described the code before the stack. How: documentation only. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
fe9e82c to
eb07c44
Compare
|
WNS precent change gives strange numbers because WNS is often small. Perhaps switch to minimum clock period reg2reg change(ignore in/out constraints because they are often very ad-hoc)? |
| select a score-ordered conflict-free batch <- [ST] | ||
| commit the batch into the open journal <- [ST] | ||
| update parasitics and timing once <- [ST] | ||
| save, salvage, keep or undo the batch <- [ST] |
There was a problem hiding this comment.
Here is it called 'keep' but later it is called 'keep on speculation' or just 'Speculate'. One term would be better and speculate is clearer.
Part 12 of 12 of the PARALLEL_EVAL setup repair stack. It builds on #11804 and also shows the commits of parts 1 to 11; its own change is the last commit.
Summary
src/rsz/doc/architecture.mdto the setup repair code of this stack. The table below summarizes the 12 PRs, and the sections after it introduce the new Mt moves, the new options and the PARALLEL_EVAL policy.Stack
RSZ_*environment knobs becomeOptimizationPolicyConfigfields.-profile_mode 1/2and-profile_dirwrite stage times, WNS/TNS samples and events.-effort.-profile_mode 3per-move analysis andreport_delay_estimator_accuracy_for_rebuffering.New Mt Moves
prepareInputs());generate()andestimate()run on worker threads from that data, and each candidate is scored with the Liberty-tableDelayEstimatorover a window of stages, side paths included.New UI
repair_timing -phases PARALLEL_EVAL: the experimental policy (warning RSZ-2024).repair_timing -effort low|medium|high: how far PARALLEL_EVAL goes after the batch stage stalls;high, the default, runs the WNS tail stage.repair_timing -profile_mode 0|1|2|3and-profile_dir dir: the setup repair profiler, off by default.report_delay_estimator_accuracy_for_rebuffering -inst inst [-driver_pin pin] [-delay_levels n]: the buffer-tree estimate of a driver against STA.report_delay_estimator_accuracy -estimatortakeslegacyorstage_window, and the experimental MT1, MEASURED_VT_SWAP and LEGACY_MT phase tokens are removed.PARALLEL_EVAL Policy