Skip to content

Add benchmarks.run_pgo_optrepeat collection #112750

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 3 commits into from
Mar 2, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions eng/pipelines/coreclr/superpmi-collect-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,27 @@ extends:
collectionName: benchmarks
collectionUpload: false

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml
buildConfig: checked
platforms:
- osx_arm64
- linux_arm
- linux_arm64
- linux_x64
- windows_x64
- windows_x86
- windows_arm64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
testGroup: outerloop
liveLibrariesBuildConfig: Release
collectionType: run_pgo_optrepeat
collectionName: benchmarks
collectionUpload: false

#
# Collection of coreclr test run
#
Expand Down
20 changes: 20 additions & 0 deletions eng/pipelines/coreclr/superpmi-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,26 @@ extends:
collectionType: run_pgo
collectionName: benchmarks

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml
buildConfig: checked
platforms:
- osx_arm64
- linux_arm
- linux_arm64
- linux_x64
- windows_x64
- windows_x86
- windows_arm64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
testGroup: outerloop
liveLibrariesBuildConfig: Release
collectionType: run_pgo_optrepeat
collectionName: benchmarks

#
# Collection of coreclr test run
#
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/scripts/superpmi-collect.proj
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<PropertyGroup Condition=" '$(CollectionType)' == 'run_pgo' ">
<RunArguments>--tiered_pgo</RunArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(CollectionType)' == 'run_pgo_optrepeat' ">
<RunArguments>--tiered_pgo --jitoptrepeat_all</RunArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(CollectionType)' != 'run_tiered' and '$(CollectionType)' != 'run_pgo' ">
<RunArguments></RunArguments>
</PropertyGroup>
Expand Down
9 changes: 9 additions & 0 deletions src/coreclr/scripts/superpmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ def add_core_root_arguments(parser, build_type_default, build_type_help):
collect_parser.add_argument("--disable_r2r", action="store_true", help="Sets DOTNET_ReadyToRun=0 when doing collection to cause ReadyToRun images to not be used, and thus causes JIT compilation and SuperPMI collection of these methods.")
collect_parser.add_argument("--tiered_compilation", action="store_true", help="Sets DOTNET_TieredCompilation=1 when doing collections.")
collect_parser.add_argument("--tiered_pgo", action="store_true", help="Sets DOTNET_TieredCompilation=1 and DOTNET_TieredPGO=1 when doing collections.")
collect_parser.add_argument("--jitoptrepeat_all", action="store_true", help="Sets DOTNET_JitOptRepeat=* when doing collections.")
collect_parser.add_argument("--ci", action="store_true", help="Special collection mode for handling zero-sized files in Azure DevOps + Helix pipelines collections.")

# Allow for continuing a collection in progress
Expand Down Expand Up @@ -864,6 +865,9 @@ def __collect_mc_files__(self):
else:
dotnet_env["TieredCompilation"] = "0"

if self.coreclr_args.jitoptrepeat_all:
dotnet_env["JitOptRepeat"] = "*"

if self.coreclr_args.disable_r2r:
dotnet_env["ReadyToRun"] = "0"

Expand Down Expand Up @@ -4911,6 +4915,11 @@ def verify_base_diff_args():
lambda unused: True,
"Unable to set tiered_pgo")

coreclr_args.verify(args,
"jitoptrepeat_all",
lambda unused: True,
"Unable to set jitoptrepeat_all")

coreclr_args.verify(args,
"pmi_path",
lambda unused: True,
Expand Down
9 changes: 9 additions & 0 deletions src/coreclr/scripts/superpmi_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
parser.add_argument("-benchmark_binary", help="Benchmark binary to execute")
parser.add_argument("--tiered_compilation", action="store_true", help="Sets DOTNET_TieredCompilation=1 when doing collections.")
parser.add_argument("--tiered_pgo", action="store_true", help="Sets DOTNET_TieredCompilation=1 and DOTNET_TieredPGO=1 when doing collections.")
parser.add_argument("--jitoptrepeat_all", action="store_true", help="Sets DOTNET_JitOptRepeat=*.")

def setup_args(args):
""" Setup the args for SuperPMI to use.
Expand Down Expand Up @@ -113,6 +114,11 @@ def setup_args(args):
lambda unused: True,
"Unable to set tiered_pgo")

coreclr_args.verify(args,
"jitoptrepeat_all",
lambda unused: True,
"Unable to set jitoptrepeat_all")

return coreclr_args


Expand Down Expand Up @@ -288,6 +294,9 @@ def build_and_run(coreclr_args, output_mch_name):
else:
collection_command += "DOTNET_TieredCompilation:0"

if coreclr_args.jitoptrepeat_all:
collection_command += " DOTNET_JitOptRepeat:\"*\""

# Generate the execution script in Temp location
with TempDir() as temp_location:
script_name = os.path.join(temp_location, script_name)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/scripts/superpmi_collect_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

parser = argparse.ArgumentParser(description="description")

parser.add_argument("-collection_type", required=True, help="Type of the SPMI collection to be done (nativeaot, crossgen2, pmi, run, run_tiered, run_pgo)")
parser.add_argument("-collection_type", required=True, help="Type of the SPMI collection to be done (nativeaot, crossgen2, pmi, run, run_tiered, run_pgo, run_pgo_optrepeat)")
parser.add_argument("-collection_name", required=True, help="Name of the SPMI collection to be done (e.g., libraries, libraries_tests, coreclr_tests, benchmarks)")
parser.add_argument("-payload_directory", required=True, help="Path to payload directory to create: subdirectories are created for the correlation payload as well as the per-partition work items")
parser.add_argument("-source_directory", required=True, help="Path to source directory")
Expand All @@ -57,7 +57,7 @@

is_windows = platform.system() == "Windows"

legal_collection_types = [ "nativeaot", "crossgen2", "pmi", "run", "run_tiered", "run_pgo" ]
legal_collection_types = [ "nativeaot", "crossgen2", "pmi", "run", "run_tiered", "run_pgo", "run_pgo_optrepeat" ]

directories_to_ignore = [
"runtimes", # This appears to be the result of a nuget package that includes a bunch of native code
Expand Down
Loading