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

Start time regressions on windows across many TE benchmarks #74315

Closed
EgorBo opened this issue Aug 21, 2022 · 15 comments
Closed

Start time regressions on windows across many TE benchmarks #74315

EgorBo opened this issue Aug 21, 2022 · 15 comments
Assignees
Milestone

Comments

@EgorBo
Copy link
Member

EgorBo commented Aug 21, 2022

I noticed a lot of start-time and time-to-first-request regressions on Windows in various benchmarks, e.g.:

JsonMvc:

PlatformPlaintext:

PlaintextMvc:

What is even more interesting that DynamicPGO is now as fast as FullPGO:

it suggests that less methods are R2R'd (or R2R is broken)

cc @sebastienros

@dotnet-issue-labeler
Copy link

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

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 21, 2022
@EgorBo
Copy link
Member Author

EgorBo commented Aug 21, 2022

dotnet/aspnetcore commit range: dotnet/aspnetcore@14a3e98...87ef6f0
dotnet/runtime commit range: 08fdcb7...37193fd

@EgorBo
Copy link
Member Author

EgorBo commented Aug 21, 2022

The only thing I can blame is #74279 - it bumps R2R format version from 7.1 to 8.0 (and MINIMUM_READYTORUN_MAJOR_VERSION from 6 to 8)
cc @davidwrighton

I also fetched output dirs for both data points and checked corelib via r2rdump - they have 7.1 and 8.0 version accordingly.
No idea how it could affect the benchmark on windows only - feels like aspnetcore binaries are prejitted with previous version of r2r format so runtime had to ignore r2r for them.

@EgorBo
Copy link
Member Author

EgorBo commented Aug 21, 2022

Yes, e.g. Kestrel (Microsoft.AspNetCore.Server.Kestrel.Core.dll) is R2R 7.1 while CoreLib is 8.0 for the "after" data point.

From my understanding, System.Private.CoreLib.dll is the only binary we prejit in dotnet/runtime using locally built crossgen, other bits are prejitted in dotnet/installer with whatever its global.json is - https://github.com/dotnet/installer/blob/main/global.json#L3 - so we need to update dotnet/installer to point to an SDK that produces 8.0 R2R scheme

UPD: or, actually, crossgen version looks to be controlled by this version - https://github.com/dotnet/installer/blob/04eccb846748563880c407b91e009e13ed8ce495/eng/Versions.props#L80

@EgorBo
Copy link
Member Author

EgorBo commented Aug 21, 2022

It actually feels a bit weird if my guesses are correct - it means when you download a daily SDK - all binaries except System.Private.CoreLib.dll are prejitted with some older crossgen, not the one you'd expect - it might explain some unexplainable regressions/improvements we observe time to time during dotnet/performance triage meetings - e.g. because newer R2R images bring updated static PGO data

@mangod9
Copy link
Member

mangod9 commented Aug 22, 2022

R2R version doesnt increment frequently. Agree that we are in a state where all previous crossgen2 built R2R binaries are going to be ignored. We need to ensure that asp.net builds with latest cg2 for RC1 to avoid these regressions.

@mangod9 mangod9 removed the untriaged New issue has not been triaged by the area owner label Aug 22, 2022
@mangod9 mangod9 added this to the 7.0.0 milestone Aug 22, 2022
@mangod9
Copy link
Member

mangod9 commented Aug 22, 2022

surprising this doesnt show up on Linux? Perhaps the runtime version is not updating yet for those runs?

@sebastienros
Copy link
Member

Also I changed the SDK feed and it's taking 8.0.* now, but the regression doesn't seem related. Might be better to check we get the same numbers with a 7.0 SDK (--application.sdkVersion 7.0.100-rc.2.22419.9)

@mangod9
Copy link
Member

mangod9 commented Aug 22, 2022

do we keep tracking 7 till GA? There are changes still being made there which would impact perf.

@sebastienros
Copy link
Member

We still take runtime and aspnet from 7 branches, just the SDK is updated so we are ready to run with net8.0 TFM when it's available (and runtime+aspnet).

@ivdiazsa
Copy link
Member

For the record, Linux runs have been also showing noticeable slowdowns.

@mangod9
Copy link
Member

mangod9 commented Aug 24, 2022

Windows startup seems to have normalized, but Linux hasn't yet. Is there a delay in when the sdk is updated for the two platforms on TE?

@sebastienros
Copy link
Member

The benchmarks take the same SDK version for both. Sometimes the charts might be delayed. But I checked the version numbers in the tooltips and they are up to date.

@sebastienros
Copy link
Member

Issue seems to be fixed. The discrepancy is due to some machines using the dotnet8 feeds for builds, which contain some rc1 builds that are older than the latest ones. If you check the runtime version on these benchmarks you'll see it's not going up because of that. The charts that are fixed have up-to-date runtime versions with the fix.

I am pushing a change to crank so that it will look on the other feeds for more recent versions.

@mangod9
Copy link
Member

mangod9 commented Aug 25, 2022

closing this since its an infra issue.

@mangod9 mangod9 closed this as completed Aug 25, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants