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

[Perf] Linux/arm64: Regressions in System.Collections.TryAddGiventSize #96500

Closed
performanceautofiler bot opened this issue Dec 7, 2023 · 5 comments
Closed
Assignees
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI os-linux Linux OS (any supported distro) PGO runtime-coreclr specific to the CoreCLR runtime
Milestone

Comments

@performanceautofiler
Copy link

Run Information

Name Value
Architecture arm64
OS ubuntu 20.04
Queue AmpereUbuntu
Baseline 60be20ccdea212f1fa841f01114cc72324e7d56f
Compare 276aa2dc8f7cf5350df4c1bf8cdf056f207b1518
Diff Diff
Configs CompilationMode:tiered, RunKind:micro

Regressions in System.Collections.TryAddGiventSize<Int32>

Benchmark Baseline Test Test/Base Test Quality Edge Detector Baseline IR Compare IR IR Ratio
5.68 μs 6.21 μs 1.09 0.03 False

graph
Test Report

Repro

General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md

git clone https://github.com/dotnet/performance.git
python3 .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Collections.TryAddGiventSize&lt;Int32&gt;*'

Payloads

Baseline
Compare

System.Collections.TryAddGiventSize<Int32>.Dictionary(Count: 512)

ETL Files

Histogram

JIT Disasms

Docs

Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository

@performanceautofiler performanceautofiler bot added arch-arm64 os-linux Linux OS (any supported distro) PGO runtime-coreclr specific to the CoreCLR runtime untriaged New issue has not been triaged by the area owner labels Dec 7, 2023
@EgorBo
Copy link
Member

EgorBo commented Dec 7, 2023

Could be #95340

@EgorBo EgorBo removed the untriaged New issue has not been triaged by the area owner label Dec 7, 2023
@EgorBo EgorBo changed the title [Perf] Linux/arm64: 1 Regression on 12/1/2023 8:25:32 AM [Perf] Linux/arm64: Regressions in System.Collections.TryAddGiventSize Jan 4, 2024
@EgorBo EgorBo transferred this issue from dotnet/perf-autofiling-issues Jan 4, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 4, 2024
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jan 4, 2024
@EgorBo
Copy link
Member

EgorBo commented Jan 4, 2024

cc @amanasifkhalid

@EgorBo EgorBo added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jan 4, 2024
@ghost
Copy link

ghost commented Jan 4, 2024

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

Run Information

Name Value
Architecture arm64
OS ubuntu 20.04
Queue AmpereUbuntu
Baseline 60be20ccdea212f1fa841f01114cc72324e7d56f
Compare 276aa2dc8f7cf5350df4c1bf8cdf056f207b1518
Diff Diff
Configs CompilationMode:tiered, RunKind:micro

Regressions in System.Collections.TryAddGiventSize<Int32>

Benchmark Baseline Test Test/Base Test Quality Edge Detector Baseline IR Compare IR IR Ratio
5.68 μs 6.21 μs 1.09 0.03 False

graph
Test Report

Repro

General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md

git clone https://github.com/dotnet/performance.git
python3 .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Collections.TryAddGiventSize&lt;Int32&gt;*'

Payloads

Baseline
Compare

System.Collections.TryAddGiventSize<Int32>.Dictionary(Count: 512)

ETL Files

Histogram

JIT Disasms

Docs

Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository

Author: performanceautofiler[bot]
Assignees: -
Labels:

arch-arm64, os-linux, area-CodeGen-coreclr, untriaged, runtime-coreclr, PGO

Milestone: -

@JulieLeeMSFT JulieLeeMSFT added this to the 9.0.0 milestone Jan 4, 2024
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jan 4, 2024
@amanasifkhalid
Copy link
Member

amanasifkhalid commented Jan 5, 2024

I took a look at the disassemblies of this benchmark with the base/diff builds, and I didn't see any differences in codegen on Linux ARM64. I couldn't find any jumps to the next block in Tier0, so I wouldn't expect the optimization touched by #95340 to do anything different for this benchmark. I guess this regression could be caused by lower TP in the JIT, though I'm skeptical of that hypothesis, too. I don't have a Linux ARM64 box to try this on, but when targeting Unix ARM64 on Windows x64 with SPMI and compiling the benchmark method System.Collections.TryAddGiventSize'1[int]:Dictionary():System.Collections.Generic.Dictionary'2[int,int]:this, the TP diff is a small improvement (0.02%) over the baseline JIT (though this may not be the case when executing on Linux ARM64).

Looking at my changes in #95340, I would expect TP to only improve: For unoptimized methods with jumps that can be removed, we now skip emitting those jumps, which easily pays for the checks in BasicBlock::CanRemoveJumpToNext. And for unoptimized methods with no jumps to the next block (such as the above benchmark), we now skip checking if optimizations are enabled (or if BBF_NONE_QUIRK is set), and immediately short-circuit on the JumpsToNext check, so I'd expect this path to be slightly faster, too. I might be too focused on the benchmark method itself, but I don't think #95340 is to blame, here.

@EgorBo do you know what the "Test Quality" score means, in this case? Is that a measure of its flakiness? Is a larger score better? Thank you!

@amanasifkhalid
Copy link
Member

This seems to have since resolved itself: Test report.

@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI os-linux Linux OS (any supported distro) PGO runtime-coreclr specific to the CoreCLR runtime
Projects
None yet
Development

No branches or pull requests

3 participants