Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Tiered rejit work items #27147

Merged
merged 2 commits into from
Oct 31, 2019
Merged

Conversation

briansull
Copy link

@briansull briansull commented Oct 11, 2019

  1. Use info.compFullName as the input to create the JIT's MethodHash
  2. Update JitOrder to print out MethodHash and PerfScore
  3. Change eeGetMethodFullName to expand class and struct names for the argument types and the return type
  4. fixed issue where bad edge weight were set in fgFoldConditional
  • Made flEdgeWeightMin and flEdgeWeightMax private fields
  • Added new method setNewEdgeWeights
  • Added support method eeGetArgClass

Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

Generally looks good to me.

src/jit/block.h Outdated Show resolved Hide resolved
src/jit/ee_il_dll.hpp Show resolved Hide resolved
src/jit/flowgraph.cpp Outdated Show resolved Hide resolved
src/jit/block.h Outdated Show resolved Hide resolved
@briansull
Copy link
Author

@BruceForstall @dotnet/jit-contrib PTAL

@briansull briansull changed the title [WIP] Tiered rejit workitem Tiered rejit work items Oct 23, 2019
@BruceForstall
Copy link
Member

I don't think you should add the JitOrderParser to the coreclr repo; I think you should put it in the jitutils repo instead. The jitOrderParser.cs file also needs a license header, and the filenames there should probably be all lower case to avoid future Linux issues.

@jashook
Copy link

jashook commented Oct 23, 2019

I don't think you should add the JitOrderParser to the coreclr repo; I think you should put it in the jitutils repo instead. The jitOrderParser.cs file also needs a license header, and the filenames there should probably be all lower case to avoid future Linux issues.

I agree

src/tools/JitOrderParser/jitOrderParser.cs Outdated Show resolved Hide resolved
printf(" mdToken | | RGN | Count | EH | FRM | LOOP | NRM | IND | BBs | Cnt | Cnt | Cnt | Alloc | IL | HOT | COLD | method name \n");
printf("---------+-----+------+----------+----+-----+------+-----+-----+-----+-----+-----+-----+---------+------+-------+-------+-----------\n");
// 06001234 | PRF | HOT | 219 | EH | ebp | LOOP | 15 | 6 | 12 | 17 | 12 | 8 | 28 p2 | 145 | 211 | 123 | System.Example(int)
printf(" | Profiled | Method | Method has | calls | Num |LclV |AProp| CSE | Perf |bytes | %3s codesize| \n", Target::g_tgtCPUName);
Copy link

Choose a reason for hiding this comment

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

What perfscore gets output on platforms that are missing full support like arm*?

Copy link
Author

Choose a reason for hiding this comment

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

The default PerfScore algorithm counts each instruction executed as 1 unit.

src/tools/JitOrderParser/JitOrderParser.csproj Outdated Show resolved Hide resolved
src/tools/JitOrderParser/JitOrderParser.sln Outdated Show resolved Hide resolved
Update JitOrder to print out MethodHash and PerfScore
Change eeGetMethodFullName to expand class and struct names for the argument types and the return type
Fixed issue where bad edge weight were set in fgFoldConditional

Made flEdgeWeightMin and flEdgeWeightMax private fields
Added new method setEdgeWeights
Added support method eeGetArgClass

Added source for Tool to parse JitOrder output and associate PerfScores
@briansull
Copy link
Author

@BruceForstall @jashook @dotnet/jit-contrib PTAL
I have addressed the feedback from Bruce and Jarret

With this change we will get unique hashes for all methods that have different signatures.

@AndyAyersMS
Copy link
Member

Seems like the edge weight changes are unrelated to the rest and should be a separate PR. I'd hoped that we could get rid of the min/max weight scheme as it's just confusing. Why bother having two weights? Which one is more trustworthy?

I wonder if the hash changes resolve #1957? Do we now get unique hashes for IL stubs?

There are a number of places already where we call getArgClass directly. I never really understood the point of the wrappers for jit interface calls but it seems like we should be consistent and either always directly call or always call via a wrapper.

@briansull
Copy link
Author

I wonder if the hash changes resolve #1957? Do we now get unique hashes for IL stubs?

Yes, IL Stubs are uniquely identified with the new methodhash

@briansull
Copy link
Author

I ran into an assert with edge weights when doing IBC training and optimization using a checked build.
This edge weight work was done to allow me to find and fix the bug.
I would like to get this work checked in, redesign is a separate issue here.

@briansull
Copy link
Author

@AndyAyersMS if you really want I can checked these items in separately.

edge = fgGetPredForBlock(bUpdated->bbNext, bUpdated);
newMaxWeight = bUpdated->bbWeight;
newMinWeight = min(edge->edgeWeightMin(), newMaxWeight);
edge->setEdgeWeights(newMinWeight, newMaxWeight);
Copy link
Author

Choose a reason for hiding this comment

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

These assignments of flEdgeWeightMax could violate the requirements that min-weight <= maxWeight

@AndyAyersMS
Copy link
Member

@AndyAyersMS if you really want I can checked these items in separately

I think it's a good practice not to mix unrelated (or seemingly unrelated) changes in one PR, but I'm not going to ask you to split this one up, as the rest of the changes are diagnostic.

We don't have a good mechanism for creating repros or regression tests for IBC related bugs. Seems like we ought to figure out how to do this.

@briansull
Copy link
Author

briansull commented Oct 31, 2019

We don't have a good mechanism for creating repros or regression tests for IBC related bugs. Seems like we ought to figure out how to do this.

I agree that we should have a better way to create regression repros in this area.
(Checking in the IBC data and running the IbcMerge tool are the required steps)
I believe that their is some rework going on in the profile area,
when that comes online we should have the ability to added regression testing.

@briansull
Copy link
Author

@BruceForstall @jashook @dotnet/jit-contrib PTAL

This is ready for checkin

Copy link

@jashook jashook left a comment

Choose a reason for hiding this comment

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

lgtm

@BruceForstall
Copy link
Member

There are a number of places already where we call getArgClass directly. I never really understood the point of the wrappers for jit interface calls but it seems like we should be consistent and either always directly call or always call via a wrapper.

There's no need for a wrapper unless the wrapper does additional work. In many cases, we use wrappers so the altjit case can do something different.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants