-
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
Add ability for crossgen2 to synthesize PGO histograms #77683
Add ability for crossgen2 to synthesize PGO histograms #77683
Conversation
09a826a
to
518d473
Compare
Add an option --synthesize-random-mibc. When passed, crossgen2 will use metadata from the compilation group to synthesize PGO histograms for methods that did not have any input profile data. Mainly for testing purposes. Currently only works in R2R mode, but hopefully will also work to embed random static PGO data in the future.
518d473
to
255a128
Compare
Split up "we have a profile" and "we have profile weights" questions.
Avoid ordering issues. Also revert now unrelated PhasedVar changes.
Various places were setting this to "true" and various other places to "1". Always use "1" in the environment variable and "true" in the msbuild property. This fixes local runs of crossgen2 tests (using src/tests/run.cmd runcrossgen2tests) -- these were not skipping FileCheck tests before as the test wrapper script only checks for "1".
This reverts commit a8ff57f.
|
||
// R2R field layout needs compilation group information | ||
((ReadyToRunCompilerContext)context).SetCompilationGroup(group); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved this so it happens right after we create the compilation group so it is early enough for the ProfileDataManager
that also needs this now (for some EnsureLoadable
calls).
<!-- Synthesized PGO may cause the expected TypeLoadExceptions in this test to appear at unexpected places --> | ||
<SynthesizedPgoIncompatible>true</SynthesizedPgoIncompatible> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably an actual bug -- loading the type for the GDV guess can have observable behavior due to load failure, and does so in this test. Ideally we would have a "TypeHandle or null if not loadable" fixup we could use for GDV guesses, but for now I have just disabled this single test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please file this issue as a bug and push for it to get fixed.
cc @dotnet/jit-contrib PTAL @davidwrighton |
...r/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodWithGCInfo.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/azp run runtime-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
Add an option --synthesize-random-mibc. When passed, crossgen2 will use
metadata from the compilation group to synthesize PGO histograms for
methods that did not have any input profile data. Also supported for --embed-pgo-data,
in which case the synthesized PGO data gets embedded.
Adds a
synthesizepgo
argument to thesrc/tests/run.cmd
/src/tests/run.sh
scripts which enable this mode for compatible tests. So testing can be done locally via:This passes in pri1 on win-x64 for me currently. I have not yet hooked it up in CI. I want to do that in a separate change later, for now this is enough to allow me to do some manual testing on #77267 that has at least some level of coverage.
Some stats:
Ideally we can get the libraries tests running with crossgen'd libraries using synthesized PGO, but it will depend on #75230, so I will leave it to future work.