Skip to content

Pack MIBC files#17513

Merged
KevinRansom merged 50 commits into
dotnet:mainfrom
psfinaki:pgo-4
Aug 26, 2024
Merged

Pack MIBC files#17513
KevinRansom merged 50 commits into
dotnet:mainfrom
psfinaki:pgo-4

Conversation

@psfinaki

@psfinaki psfinaki commented Aug 8, 2024

Copy link
Copy Markdown
Contributor

Fixes: #12636
Fixes: #13328

Part one of implementing PGO in F# - this copying the restores MIBC files to the resulting NuGet packages.

The result looks like this:
image

@psfinaki psfinaki requested a review from a team as a code owner August 8, 2024 15:30
@github-actions

github-actions Bot commented Aug 8, 2024

Copy link
Copy Markdown
Contributor

✅ No release notes required

@psfinaki

psfinaki commented Aug 9, 2024

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@psfinaki psfinaki requested a review from a team as a code owner August 9, 2024 13:25
@vzarytovskii vzarytovskii self-assigned this Aug 9, 2024

@vzarytovskii vzarytovskii left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Gonna block it to not forget to review on Monday

Comment thread src/fsc/fsc.targets Outdated
Comment thread src/Directory.Build.props Outdated

@KevinRansom KevinRansom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need to deploy all of the packages to the SDK. Size is not that big a deal.

Comment thread src/Directory.Build.props Outdated
Comment thread src/fsc/fsc.targets Outdated
@vzarytovskii

Copy link
Copy Markdown
Member

I pushed a fix which

  1. Produces compiler package packed with profiles
    image
  2. Applies it to proto.

All things are in place, thing left to do:

  1. Make sure it really applies r2r when building proto fsc
  2. When new artifacts arrive to dotnet/sdk, do the same there.

@vzarytovskii

Copy link
Copy Markdown
Member

There are issues with locking files. I suggest to copy initially to two different paths - mibc and mibc_proto or something. And apply to proto from mibc_proto, and copy to nuget from the other one.

@vzarytovskii

vzarytovskii commented Aug 12, 2024

Copy link
Copy Markdown
Member

Fixed (probably) fixed one part, I believe you'll figure out how to retry and or not lock it.

@psfinaki

Copy link
Copy Markdown
Contributor Author

Fixed (probably) fixed one part, I believe you'll figure out how to retry and or not lock it.

Sure let me try something.

@vzarytovskii

Copy link
Copy Markdown
Member

After restore, it seems that files are getting locked:

Directory.Build.targets(28,5): error MSB3026: (NETCORE_ENGINEERING_TELEMETRY=Build) Could not copy "D:\a\_work\1\s\.packages\optimization.windows_nt-x86.mibc.runtime\1.0.0-prerelease.23614.4\data\DotNet_FSharp.mibc" to "D:\a\_work\1\s\artifacts\\mibc\optimization.windows_nt-arm64.mibc.runtime\DotNet_FSharp.mibc". Beginning retry 1 in 1000ms. The process cannot access the file 'D:\a\_work\1\s\artifacts\\mibc\optimization.windows_nt-arm64.mibc.runtime\DotNet_FSharp.mibc' because it is being used by another process. 

Maybe @baronfel and/or @rainersigwald have some advise here?

Comment thread Directory.Build.targets Outdated
Comment thread src/fsc/fscProject/fsc.fsproj Outdated
@vzarytovskii

Copy link
Copy Markdown
Member

Well, worst case scenario, we can just slap Retries="1000" on Copy and hope that nuget (or whatever holds those files after restore) will release them.

@rainersigwald

Copy link
Copy Markdown
Member

Putting this in Directory.Build.targets means it'll run in every individual project, and it's copying to the same location in all of them.

You just want this once/build, right? But "in any way the build could be triggered" is why you're putting it in D.b.targets?

@vzarytovskii

Copy link
Copy Markdown
Member

Putting this in Directory.Build.targets means it'll run in every individual project, and it's copying to the same location in all of them.

That's a good point, I haven't thought about it 🤦

You just want this once/build, right? But "in any way the build could be triggered" is why you're putting it in D.b.targets?

Yep, pretty much, we want it to happen once, no matter what we're building.

@rainersigwald

Copy link
Copy Markdown
Member

In that case what I'd do is this:

  1. Create a new .targets file that does only this copy stuff.
  2. Change the D.B.targets target to do an <MSBuild task call to that new file/target, with RemoveProperties="TargetFramework" (and maybe passing along some paths that Arcade/common.targets derives for you)

Then the MSBuild engine will deduplicate the request and do the copy operation only once.

@vzarytovskii

Copy link
Copy Markdown
Member

In that case what I'd do is this:

  1. Create a new .targets file that does only this copy stuff.
  2. Change the D.B.targets target to do an <MSBuild task call to that new file/target, with RemoveProperties="TargetFramework" (and maybe passing along some paths that Arcade/common.targets derives for you)

Then the MSBuild engine will deduplicate the request and do the copy operation only once.

Ooh, nice, thanks a tonne, Rainer, will try it out tomorrow!

@psfinaki

Copy link
Copy Markdown
Contributor Author

@KevinRansom @vzarytovskii this is finally green! 🍾

Comment thread eng/restore/optimizationData.targets Outdated
Comment thread Directory.Build.targets Outdated
@psfinaki

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@KevinRansom KevinRansom merged commit 2f27f48 into dotnet:main Aug 26, 2024
@psfinaki psfinaki deleted the pgo-4 branch August 26, 2024 17:41
@psfinaki

Copy link
Copy Markdown
Contributor Author

🍾 🍾 🍾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

dotnet fsi startup overhead surprisingly high Add mibc/profile for R2R FSC/FSI for faster startup

6 participants