fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Enable PGO - alternative approach

Open psfinaki opened this issue 1 year ago • 10 comments

Description

This should eventually make the FSC and FSI start about 30% faster. The implementation is inspired by the runtime targets.

Fixes #12636 Fixes #13328

psfinaki avatar Jun 17 '24 13:06 psfinaki

:white_check_mark: No release notes required

github-actions[bot] avatar Jun 17 '24 13:06 github-actions[bot]

Hi @EgorBo, so this is an alternative approach to enable PGO, without doing profile generation ourselves. However - this doesn't seem to work so far, as in, benchmarks don't show any improvements.

Any ideas what could be wrong?

psfinaki avatar Jun 18 '24 17:06 psfinaki

@EgorBo any pointers on how to figure out why is profile we get from nuget is not applying, and if we generate it locally, it shows a difference?

vzarytovskii avatar Jun 19 '24 12:06 vzarytovskii

@psfinaki @vzarytovskii I presume you test it on fsi? have you added fsi as a training scenario to dotnet-optimization repo? Otherwise it produces some MIBC trained to TechEmpower, console apps and for F# it's only "build Giraffe" scenario

EgorBo avatar Jun 19 '24 12:06 EgorBo

@psfinaki @vzarytovskii I presume you test it on fsi? have you added fsi as a training scenario to dotnet-optimization repo? Otherwise it produces some MIBC trained to TechEmpower, console apps and for F# it's only "build Giraffe" scenario

We have tested on fsc, since that's the only F# scenario in the optimization repo as of now.

@psfinaki did you try to build Giraffe with and without profile applied in this PR? Does it change anything?

vzarytovskii avatar Jun 19 '24 12:06 vzarytovskii

So far I have only tried running published fsc against an empty test.fsx script. That was enough to show the differece in that other PR with us creating the profile.

Let me try Giraffe.

psfinaki avatar Jun 19 '24 14:06 psfinaki

@vzarytovskii @EgorBo I'm afraid I don't see any difference in Giraffe compilation either :( it's the same execution time basically.

psfinaki avatar Jun 20 '24 16:06 psfinaki

@vzarytovskii @EgorBo I'm afraid I don't see any difference in Giraffe compilation either :( it's the same execution time basically.

Do you a MIBC that works locally? can you send it to me? I'll check weigths in it

EgorBo avatar Jun 20 '24 19:06 EgorBo

@EgorBo did you, by any chance, look at it? Curious what's the difference between those.

vzarytovskii avatar Jun 26 '24 13:06 vzarytovskii

@EgorBo did you, by any chance, looked at it? Curious what's the difference between those.

The only @psfinaki collected looks extremely weird to me. I propose we merge this PR as is since it generally looks corret to me, the problem must be inside the dotnet-optimization repo, once we figure it out and fix it should propagate a correct MIBC and optimize things out, hopefully 🙂 I'll take a look on Friday

EgorBo avatar Jun 26 '24 13:06 EgorBo

Will split this into 2 parts, closing this for now.

psfinaki avatar Aug 07 '24 18:08 psfinaki