Closed
Description
This issue captures work items and other notes related to profile synthesis in RyuJit.
Overview
Profile synthesis is an algorithm to estimate plausible block and edge profile data. It can be used to guide optimizations in the absence of true profile data, fill in gaps in profile data, or repair damaged (inconsistent data).
See the section on synthesis in the main Dynamic PGO for more context.
Completed for .NET 8
- implement core reconstruction algorithm (JIT: initial implementation of profile synthesis #82926). This turns local likelihoods into global counts.
- extend to handle inlinee flow graphs (see JIT: it is difficult to do flow analysis on inlinees #82755)
- consistency check and fix issues (JIT: profile synthesis consistency checking and more #83068)
- PGO blend modes, random, etc JIT: profile synthesis blend and repair modes #83567
- Repair mode JIT: profile synthesis blend and repair modes #83567, JIT: extend initial profile repair to more cases #84741
- Proper weight comp for finallies (JIT: treat synthesized profile data as pgo data, fix finally weights #83185)
- Profile fill-in for OSR cases where Tier0 instrumented method never returns (JIT: extend initial profile repair to more cases #84741)
Opportunistic work for .NET 8
- come up with some strategy for irreducible loops (see notes below)
- assess how often
$C_p$ gets capped in real programs (not many; see notes below) - if we end up capping, can we go back and revise likelihoods so profile data is consistent (JIT: extend initial profile repair to more cases #84741, ...)
- faster way of doing
fgGetPredForBlock
-- we often want to go from a block to the successor edges - vet heuristics against some real data -- maybe leverage MIBC compare capabilities.
Some initial data in JIT: profile synthesis consistency checking and more #83068. - IR based heuristics (perhaps)
- When computing
$C_p$ avoid repeatedly propagating through nested loops - Fake BB0 or always force scratch BB or just tolerate
fgFirstBB
being special - Reconcile with our other loop finding stuff (Improve JIT loop optimizations #65342)
- Stop the upweight/downweight of loop blocks in rest of jit
- Durable edge properties (entry, exit, back)
- Tweak RunRarely to mean at or near zero (Consider fully replacing BBF_RUN_RARELY with the weight of 0 #48778)
- OSR entry weight still seems off
- Special handling for deep nests?
Note a number of the above were handled in .NET 9, see #93020
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done