Skip to content
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

Allow JIT to know if dynamic pgo is active #101575

Merged
merged 1 commit into from
Apr 27, 2024

Conversation

AndyAyersMS
Copy link
Member

When dynamic PGO is active we would like for all methods to have some profile data, so we don't have to handle a mixture of profiled and unprofiled methods during or after inlining.

But to reduce profiling overhead, the JIT will not instrument methods that have straight-line control flow, or flow where all branches lead to throws (aka "minimal profiling"). When the JIT tries to recover profile data for these methods it won't get any data back. SO there is a fairly high volume of these profiled/unprofiled mixtures today and they lead to various poor decisions in the JIT.

This change enables the JIT to see if dynamic PGO is active. The JIT does not yet do anything with the information. A subsequent change will have the JIT synthesize data for methods with no profile data in this case.

We could also solve this by creating a placeholder PGO schema for theswith no data, but it seems simpler and less resource intensive to have the runtime tell the JIT that dynamic PGO is active.

This also changes the JIT GUID for the new API surface.

Contributes to #93020.

When dynamic PGO is active we would like for all methods to have some
profile data, so we don't have to handle a mixture of profiled and unprofiled
methods during or after inlining.

But to reduce profiling overhead, the JIT will not instrument methods that have
straight-line control flow, or flow where all branches lead to throws (aka
"minimal profiling"). When the JIT tries to recover profile data for these methods
it won't get any data back. SO there is a fairly high volume of these profiled/unprofiled
mixtures today and they lead to various poor decisions in the JIT.

This change enables the JIT to see if dynamic PGO is active. The JIT does not yet
do anything with the information. A subsequent change will have the JIT synthesize
data for methods with no profile data in this case.

We could also solve this by creating a placeholder PGO schema for theswith no data, but it seems
simpler and less resource intensive to have the runtime tell the JIT that dynamic PGO
is active.

This also changes the JIT GUID for the new API surface.

Contributes to dotnet#93020.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 25, 2024
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@AndyAyersMS
Copy link
Member Author

@amanasifkhalid PTAL
cc @dotnet/jit-contrib

New guid, so no diffs possible. But none expected.

Copy link
Member

@amanasifkhalid amanasifkhalid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@AndyAyersMS
Copy link
Member Author

FYI @dotnet/jit-contrib a new GUID.

I will merge this end of day today to try and minimize likelihood of SPMI disruption.

@AndyAyersMS AndyAyersMS merged commit 09b983e into dotnet:main Apr 27, 2024
93 checks passed
matouskozak pushed a commit to matouskozak/runtime that referenced this pull request Apr 30, 2024
When dynamic PGO is active we would like for all methods to have some
profile data, so we don't have to handle a mixture of profiled and unprofiled
methods during or after inlining.

But to reduce profiling overhead, the JIT will not instrument methods that have
straight-line control flow, or flow where all branches lead to throws (aka
"minimal profiling"). When the JIT tries to recover profile data for these methods
it won't get any data back. SO there is a fairly high volume of these profiled/unprofiled
mixtures today and they lead to various poor decisions in the JIT.

This change enables the JIT to see if dynamic PGO is active. The JIT does not yet
do anything with the information. A subsequent change will have the JIT synthesize
data for methods with no profile data in this case.

We could also solve this by creating a placeholder PGO schema for theswith no data, but it seems
simpler and less resource intensive to have the runtime tell the JIT that dynamic PGO
is active.

This also changes the JIT GUID for the new API surface.

Contributes to dotnet#93020.
michaelgsharp pushed a commit to michaelgsharp/runtime that referenced this pull request May 9, 2024
When dynamic PGO is active we would like for all methods to have some
profile data, so we don't have to handle a mixture of profiled and unprofiled
methods during or after inlining.

But to reduce profiling overhead, the JIT will not instrument methods that have
straight-line control flow, or flow where all branches lead to throws (aka
"minimal profiling"). When the JIT tries to recover profile data for these methods
it won't get any data back. SO there is a fairly high volume of these profiled/unprofiled
mixtures today and they lead to various poor decisions in the JIT.

This change enables the JIT to see if dynamic PGO is active. The JIT does not yet
do anything with the information. A subsequent change will have the JIT synthesize
data for methods with no profile data in this case.

We could also solve this by creating a placeholder PGO schema for theswith no data, but it seems
simpler and less resource intensive to have the runtime tell the JIT that dynamic PGO
is active.

This also changes the JIT GUID for the new API surface.

Contributes to dotnet#93020.
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants