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

Introduce System.Runtime.TieredPGO knob #26350

Merged
merged 6 commits into from
Jul 12, 2022
Merged

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Jun 29, 2022

Related dotnet/runtime PR: dotnet/runtime#71438

The idea is to introduce a configuration switch similar to TieredCompilation to expose a config switch for TieredPGO. It's done because many of our first/third parties are interested in trying Dynamic PGO and currently it's only possible with DOTNET_TieredPGO=1 env. variable defined in the execution process.

With this PR and the related SDK change customers will be able to turn it on (it's off by default) via MSBUILD or JSON config just like TieredCompilation, e.g.:

<TieredPGO>true</TieredPGO>

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@EgorBo
Copy link
Member Author

EgorBo commented Jul 11, 2022

Um.. I am not sure who to ask for review here, perhaps @eerhardt?
I verified locally that this property enables PGO. More context in dotnet/runtime#70410

@eerhardt
Copy link
Member

Can you also add to the test to ensure the MSBuild settings are flown to the runtimeconfig.json file? See #12362 for an example of where to change the tests.

@@ -487,6 +487,10 @@ Copyright (c) .NET Foundation. All rights reserved.
Condition="'$(TieredCompilationQuickJitForLoops)' != ''"
Value="$(TieredCompilationQuickJitForLoops)" />

<RuntimeHostConfigurationOption Include="System.Runtime.TieredPGO"
Condition="'$(TieredPGO)' != ''"
Value="$(TieredPGO)" />
Copy link
Member

Choose a reason for hiding this comment

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

Question: Is PGO the term we use in docs when discussing this feature with customers? These strings System.Runtime.TieredPGO and TieredPGO are basically public APIs, so we have to be happy with the names we are picking here. It would be a breaking change to rename them later.

Copy link
Member Author

@EgorBo EgorBo Jul 11, 2022

Choose a reason for hiding this comment

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

@eerhardt We've been advertising DOTNET_TieredPGO environment variable since .NET 6.0 e.g.
https://devblogs.microsoft.com/dotnet/announcing-net-6/#dynamic-pgo (I was collecting feedback from users here: https://gist.github.com/EgorBo/dc181796683da3d905a5295bfd3dd95b) - it perfectly aligns with DOTNET_TieredCompilation which maps to <TieredCompilation>true</TieredCompilation> here.

We considered other names/options but a simple boolean property seems to be the best and simple. Eventually, we plan to enable it by default I guess (e.g. in .NET 8.0). For .NET 7.0 we just want our customers to be able to easily enable it to try the feature

@EgorBo EgorBo merged commit 14a527b into dotnet:main Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants