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

JIT: allow inlinee profile scale-up #48280

Merged
merged 1 commit into from
Feb 16, 2021

Conversation

AndyAyersMS
Copy link
Member

We can't always be sure that callee entry counts will be greater than or equal
to call site counts. For example a callee could be tiered up before a caller,
and so have relatively smaller counts.

So, when computing inline scale, allow callee counts to be scaled up as well as
scaled down.

We can't always be sure that callee entry counts will be greater than or equal
to call site counts. For example a callee could be tiered up before a caller,
and so have relatively smaller counts.

So, when computing inline scale, allow callee counts to be scaled up as well as
scaled down.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 14, 2021
@AndyAyersMS
Copy link
Member Author

cc @dotnet/jit-contrib

Local testing with special Tiered PGO SPMI collection shows a few diffs:

Total bytes of delta: -170 (-1.72% of base)
    diff is an improvement.


Top file regressions (bytes):
          11 : 77033.dasm (1.45% of base)
           6 : 77059.dasm (0.79% of base)

Top file improvements (bytes):
        -160 : 77248.dasm (-14.32% of base)
         -12 : 99351.dasm (-0.67% of base)
         -10 : 76990.dasm (-1.87% of base)
          -3 : 77035.dasm (-0.35% of base)
          -1 : 99696.dasm (-0.05% of base)
          -1 : 77061.dasm (-0.11% of base)

8 total files with Code Size differences (6 improved, 2 regressed), 1 unchanged.

Top method regressions (bytes):
          11 ( 1.45% of base) : 77033.dasm - EMFloat:MultiplyInternalFPF(byref,byref,byref)
           6 ( 0.79% of base) : 77059.dasm - EMFloatClass:MultiplyInternalFPF(InternalFPF,InternalFPF,InternalFPF)

Top method improvements (bytes):
        -160 (-14.32% of base) : 77248.dasm - LUDecomp:DoLUIteration(System.Double[][],System.Double[],System.Double[][][],System.Double[][],int):long
         -12 (-0.67% of base) : 99351.dasm - DynamicClass:ReadJsonBenchmarks.TestObjectFromXml(System.Runtime.Serialization.XmlReaderDelegator,System.Runtime.Serialization.XmlObjectSerializerReadContext,System.Xml.XmlDictionaryString[],System.Xml.XmlDictionaryString[]):System.Object
         -10 (-1.87% of base) : 76990.dasm - StringSort:LoadStringArray(System.String[][],int,int)
          -3 (-0.35% of base) : 77035.dasm - EMFloat:DivideInternalFPF(byref,byref,byref)
          -1 (-0.05% of base) : 99696.dasm - DynamicClass:ReadJsonBenchmarks_TestObjectFromJson(System.Runtime.Serialization.XmlReaderDelegator,System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson,System.Xml.XmlDictionaryString,System.Xml.XmlDictionaryString[]):System.Object
          -1 (-0.11% of base) : 77061.dasm - EMFloatClass:DivideInternalFPF(InternalFPF,InternalFPF,InternalFPF)

Top method regressions (percentages):
          11 ( 1.45% of base) : 77033.dasm - EMFloat:MultiplyInternalFPF(byref,byref,byref)
           6 ( 0.79% of base) : 77059.dasm - EMFloatClass:MultiplyInternalFPF(InternalFPF,InternalFPF,InternalFPF)

Top method improvements (percentages):
        -160 (-14.32% of base) : 77248.dasm - LUDecomp:DoLUIteration(System.Double[][],System.Double[],System.Double[][][],System.Double[][],int):long
         -10 (-1.87% of base) : 76990.dasm - StringSort:LoadStringArray(System.String[][],int,int)
         -12 (-0.67% of base) : 99351.dasm - DynamicClass:ReadJsonBenchmarks.TestObjectFromXml(System.Runtime.Serialization.XmlReaderDelegator,System.Runtime.Serialization.XmlObjectSerializerReadContext,System.Xml.XmlDictionaryString[],System.Xml.XmlDictionaryString[]):System.Object
          -3 (-0.35% of base) : 77035.dasm - EMFloat:DivideInternalFPF(byref,byref,byref)
          -1 (-0.11% of base) : 77061.dasm - EMFloatClass:DivideInternalFPF(InternalFPF,InternalFPF,InternalFPF)
          -1 (-0.05% of base) : 99696.dasm - DynamicClass:ReadJsonBenchmarks_TestObjectFromJson(System.Runtime.Serialization.XmlReaderDelegator,System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson,System.Xml.XmlDictionaryString,System.Xml.XmlDictionaryString[]):System.Object

8 total methods with Code Size differences (6 improved, 2 regressed), 1 unchanged.

LU decomp shows exactly this case...

Invoking compiler for the inlinee method LUDecomp:lusolve(System.Double[][],int,System.Double[]):int :
...
Computing inlinee profile scale:
   call site count 861.000000 callee entry count 115.000000 scale 7.486957

@AndyAyersMS AndyAyersMS mentioned this pull request Feb 14, 2021
54 tasks
Copy link
Contributor

@briansull briansull left a comment

Choose a reason for hiding this comment

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

Looks Fine to me

@AndyAyersMS AndyAyersMS merged commit 694f40f into dotnet:master Feb 16, 2021
@AndyAyersMS AndyAyersMS deleted the ScaleDownScaleUp branch February 16, 2021 03:58
@ghost ghost locked as resolved and limited conversation to collaborators Mar 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants