-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JIT: update jit config defaults for PGO #49267
Conversation
Enable edge profiling by default, when jitting, or when prejitting for R2R. Keep block profiling there for classic ngen (so there is an entry probe). Enable minimal probing by default, when jitting. Keep full probing there for prejitting so presence of counts in a method implies method was executed. Enable class profiling by default when jitting. Still TBD if we will also do this when prejitting. Enable guarded devirtualization by default (will only kick in for PGO). Adjust experimental CI legs to reflect the above. Net effect is that when jitting, COMPlus_TieredPGO=1 turns on dynamic PGO with the expected set of behaviors, without any other options. We'll still need to set COMPlus_TC_QuickJitForLoops=1 to have methods with loops pass through Tier0.
cc @dotnet/jit-contrib No diffs in Tier1 codegen for a number of tests I tried manually (versus non-minimal probing). |
Is block profiling generally useful to keep around, or is it just a classic ngen legacy? If it is the latter, I think it would be ok to just make it no-op for classic ngen. It is what we have been doing in other places. |
It is still used if OSR is enabled, since OSR methods can't consume edge profiles just yet. |
/azp run runtime-jit-experimental |
Azure Pipelines successfully started running 1 pipeline(s). |
There are some expected failures in the jit-experimental runs. However there is a novel failure in bytemark, with the assert:
This is the code in the optimizer that scales non-pgo loop counts. Since this failure comes from the inline-pgo leg and we're not enabling the pgo inlining policy yet, I'm going to ignore these here. |
@dotnet/jit-contrib anyone able to review? |
@AndyAyersMS runtime/src/coreclr/jit/fgprofile.cpp Lines 1632 to 1633 in 016ec29
because of the below source codes. runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs Lines 2348 to 2355 in 016ec29
in crossgen1 (R2R) runtime/src/coreclr/zap/zapinfo.cpp Lines 960 to 967 in 016ec29
The default profiling method is changed, but other codes only support BasicBlockIntCount. |
@clamp03 thanks for pointing this out. I'll change the defaults for prejitting back to block profiling. Our plan going forward is to do instrumentation at runtime instead of when prejitting. See the dotnet-pgo spec. |
Both crossgen1 and crossgen2 currently reject schemas that contain edge profile counters. Change the jit defaults back to block profiling when prejitting. See notes in dotnet#49267.
Both crossgen1 and crossgen2 currently reject schemas that contain edge profile counters. Change the jit defaults back to block profiling when prejitting. See notes in #49267.
@davidwrighton now that I think about it, it seems like the static PGO path might want to disable the minimal probing so that static tooling can reason about what methods were executed and how often they were called. I had though the jit/prejit distinction was the right one here, but both static and dynamic PGO leverage dynamic instrumentation, so the interesting distinction is really whether we're going to force methods to remain in Tier0, or let them get re-optimized. I wonder if we should have a more direct signal for this instead of inferring it from say an unusually high setting for |
Enable edge profiling by default, when jitting, or when prejitting for R2R.
Keep block profiling there for classic ngen (so there is an entry probe).
Enable minimal probing by default, when jitting. Keep full probing there for
prejitting so presence of counts in a method implies method was executed.
Enable class profiling by default when jitting. Still TBD if we will also
do this when prejitting.
Enable guarded devirtualization by default (will only kick in for PGO).
Adjust experimental CI legs to reflect the above.
Net effect is that when jitting, COMPlus_TieredPGO=1 turns on dynamic PGO
with the expected set of behaviors, without any other options.
We'll still need to set COMPlus_TC_QuickJitForLoops=1 to have methods with
loops pass through Tier0.