-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 PGO for F# compiler #42514
base: main
Are you sure you want to change the base?
Add PGO for F# compiler #42514
Conversation
This will also require adding mibc dependencies via darc, so they are auto-updated. |
Right. I added them to Version.Details.xml - is the right way to go? |
Yes, but they also should be enabled in darc for the msbuild, so they are updated automatically. But this should explicitly be agreed upon with sdk folks. @baronfel is it the way to go? Or should we pack profiles with our nuget (or separate nuget) and when repacking, use them from there? I would personally say the latter is a better way to go, since we probably also want to use those profiles when building proto. |
I'm not sure what's best from an engineering PoV - @joeloff do you have an opinion here? |
Thinking again about this, I think us packing profiles should be better, since we know how to manage them and which channel is correct for which branch (we had to use 8 before and now switched to 9). |
We were looking at this with @KevinRansom and most likely F# is the first one to try to do this via SDK (there is no notion of For reference, here is the alternative approach in the F# repo, in case we decide to do it from from within the compiler itself. |
I vote we distribute profiles with our packages (maybe new package), since
|
Any other opinions here? @baronfel @joeloff @KevinRansom? I am biased since we kind of have a working thing in F# whereas this PR will take some time to finalize so ofc laziness is involved but it's important to do things "right" here. Certainly we can also merge the F# repo implementation and then revert later if needed. |
I thought about it over the weekend, and probably going to insist that we do it in our repo:
This way we are flexible to do whatever we want without making changes to this repo. We know exactly which channel to pull packages from for every given branch. We can transparently change implementation if we want it (either use runtime provided ones, or generate our own), without changes to this repo. It is unlikely that we will be forgetting to update darc for sdk every time we update branches, etc. |
/azp run |
Azure Pipelines successfully started running 4 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 4 pipeline(s). |
CI seems to be flaky but overall this looks like a viable approach. The MIBC files are present in the packages already: @KevinRansom @vzarytovskii please rereview. |
Okay, this is green 😎 |
<PropertyGroup> | ||
<MibcTargetOS>linux</MibcTargetOS> | ||
<!-- We deliberately want to use linux mibc pgo data on macOS --> | ||
<MibcTargetOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">linux</MibcTargetOS> |
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.
When the sdk builds it builds cross target --- ie the tooling used to build the product doesnot necessarily match the build target.
When you do mibc you need to match the build target not the tooling platform.
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.
Hmmm alright, I am trying to leverage NETCoreSdkRuntimeIdentifier now - is this the right thing?
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.
Probably not :)
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.
When the sdk builds it builds cross target --- ie the tooling used to build the product doesnot necessarily match the build target.
When you do mibc you need to match the build target not the tooling platform.
Okay, that's green again... @mmitche @vzarytovskii @baronfel @KevinRansom how does this look like to you? |
<PropertyGroup> | ||
<MibcPath>$(PkgMicrosoft_FSharp_Compiler)/contentFiles/mibc</MibcPath> | ||
<MibcRid>$(Rid)</MibcRid> | ||
<MibcRid Condition="$(MibcRid.Contains('musl-'))">$(MibcRid.Replace('musl-', ''))</MibcRid> |
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.
Is this valid @mmitche? How portable are PGO profiles, can they float across different libc ABIs?
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.
Not sure. I'm going to draw a random name out of the hat on that one and tag @agocke for general knowledge.
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.
Maybe @EgorBo?
@KevinRansom do you have some thoughts here? |
This should eventually make the FSC about 30% faster.
The latest FCS package contains these MIBC files:
In the SDK part of it, we need to unpack them, apply to the compiler, and repack.