Skip to content

Add -repeatCount in superpmi.exe to repeat method compilation #94503

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

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

BruceForstall
Copy link
Member

Passing -repeatCount N for some integer N > 0 will compile each function N times. This is true for each function in the MCH file, by default, or each one specified by a -c argument or .mcl file.

This can be used to help investigate the JIT throughput for compilation of a particular function or set of functions.

This is based on #93417.

Passing `-repeatCount N` for some integer `N > 0` will compile
each function `N` times. This is true for each function in the
MCH file, by default, or each one specified by a `-c` argument
or .mcl file.

This can be used to help investigate the JIT throughput for compilation
of a particular function or set of functions.

This is based on dotnet#93417.
@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 Nov 8, 2023
@ghost ghost assigned BruceForstall Nov 8, 2023
@ghost
Copy link

ghost commented Nov 8, 2023

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

Issue Details

Passing -repeatCount N for some integer N > 0 will compile each function N times. This is true for each function in the MCH file, by default, or each one specified by a -c argument or .mcl file.

This can be used to help investigate the JIT throughput for compilation of a particular function or set of functions.

This is based on #93417.

Author: BruceForstall
Assignees: BruceForstall
Labels:

area-CodeGen-coreclr

Milestone: -

@BruceForstall
Copy link
Member Author

This is based on the work @kunalspathak investigated in #93417. I submitted it as a separate PR because it ended up so different.

The most annoying part here was getting the progress report to make sense for the normal case as well as the -c 1 -repeatCount 5000 case.

Percent complete should actually be a little more accurate for the case of specified indexes without TOC, and TOC without specified indexes.

@BruceForstall
Copy link
Member Author

@kunalspathak PTAL
cc @dotnet/jit-contrib

// InitJit already printed a failure message
return (int)SpmiResult::JitFailedToInit;
}
SimpleTimer stInitJit;
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that most of the changes starting here are because everything in the iter loop was indented 4 spaces.

if (o.details != nullptr)
// Write a progress message if necessary.
const int progressInterval = 500;
if ((jittedCount > 0) && (jittedCount % progressInterval == 0))
Copy link
Member Author

Choose a reason for hiding this comment

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

The progress output was moved to the end of the loop because it made all the progress output scenarios work better.

Copy link
Member

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

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

The most annoying part here was getting the progress report to make sense for the normal case as well as the -c 1 -repeatCount 5000 case.

I think thats where I spent my energy to get it right., but your approach is more reasonable. Thanks!

@JulieLeeMSFT
Copy link
Member

Percent complete should actually be a little more accurate for the case of specified indexes without TOC, and TOC without specified indexes.

What is TOC?
BTW, this feature will be useful to study contribution of specific methods during app startup.

@kunalspathak
Copy link
Member

What is TOC?

Table of contents. We have a .mct file that basically contains index of various method contexts for easy reading the method contexts from .mch files.

@BruceForstall BruceForstall merged commit 44bdec3 into dotnet:main Nov 8, 2023
@BruceForstall BruceForstall deleted the AddRepeatCount branch November 8, 2023 16:14
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
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.

3 participants