Skip to content

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Aug 26, 2025

This PR adds crank-driven SPMI collections (TechEmpower, OrchardCMS, etc). For now I've added 4 benchmarks, will enable more. the ones requiring databases might be tricky to add.

TODOs (in separate PRs):

  • 32-bit targets (windows-x86, linux-arm)
  • Enable Linux-x64 (azurelinux.3.amd64.open) - currently, it runs out of disk space when running this script (it requires ~3GB of disk space).
  • Remove git dependency and hacks around it once Add Archive source option crank#841 is landed.
  • Enable more benchmarks
  • Add runs with special JIT modes like TC=0, etc.

The currently produced MCH contains 32k contexts (0.5Gb)

In case if you want to have a dryrun locally:

py .\src\coreclr\scripts\superpmi_aspnet2.py --dryrun

Actual run:

py .\src\coreclr\scripts\superpmi_aspnet2.py --core_root .\artifacts\bin\coreclr\windows.x64.Checked `
--output_mch aspnet2.mch

@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 26, 2025
@AndyAyersMS
Copy link
Member

I found on recent builds I also needed to copy over some of the host dlls or I get odd CFI failures on windows. I have unmerged changes to my script with these changes. Maybe I should put it up for PR?

@dotnet dotnet deleted a comment from azure-pipelines bot Aug 31, 2025
@dotnet dotnet deleted a comment from azure-pipelines bot Aug 31, 2025
@dotnet dotnet deleted a comment from azure-pipelines bot Aug 31, 2025
@dotnet dotnet deleted a comment from azure-pipelines bot Aug 31, 2025
@EgorBo
Copy link
Member Author

EgorBo commented Sep 1, 2025

/azp run runtime-coreclr superpmi-collect-test

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@EgorBo EgorBo marked this pull request as ready for review September 2, 2025 06:41
@Copilot Copilot AI review requested due to automatic review settings September 2, 2025 06:41
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR automates SPMI (Super PMI) collection for ASP.NET benchmarks, specifically the TechEmpower benchmarks, by integrating with the "crank" tool. The changes enable automated collection of JIT compilation data from real-world ASP.NET workloads to improve JIT performance analysis.

  • Adds a new "aspnet2" collection type that runs TechEmpower benchmarks via crank
  • Creates a self-contained Python script to manage the entire crank-based collection workflow
  • Integrates the new collection type into the existing SPMI pipeline infrastructure

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/coreclr/scripts/superpmi_collect_setup.py Updates setup script to recognize and handle the new "aspnet2" collection type
src/coreclr/scripts/superpmi_aspnet2.py New comprehensive script that orchestrates TechEmpower benchmark execution via crank for SPMI collection
src/coreclr/scripts/superpmi-collect.proj Adds MSBuild configuration for aspnet2 collections including Helix work item definitions
eng/pipelines/coreclr/templates/superpmi-collect-pipeline.yml Enables aspnet2 collection in the CI pipeline for multiple platforms
eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml Configures input directory for aspnet2 collection jobs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@EgorBo
Copy link
Member Author

EgorBo commented Sep 2, 2025

PTAL @dotnet/jit-contrib @AndyAyersMS

@EgorBo EgorBo requested a review from AndyAyersMS September 2, 2025 10:46
Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

Overall this looks good.

You might want to do the same thing my old script does (and we now do for benchmarks) and use a release build with checked jit.

If a particular scenario fails does the whole thing just fail? I ended up trying to carry on anyways, with the thought that a partial collection was better than nothing.

@EgorBo
Copy link
Member Author

EgorBo commented Sep 2, 2025

Overall this looks good.

You might want to do the same thing my old script does (and we now do for benchmarks) and use a release build with checked jit.

If a particular scenario fails does the whole thing just fail? I ended up trying to carry on anyways, with the thought that a partial collection was better than nothing.

@AndyAyersMS

You might want to do the same thing my old script does (and we now do for benchmarks) and use a release build with checked jit.

My code re-uses the same logic, see here:

if coreclr_args.collection_name == "benchmarks" or coreclr_args.collection_name == "realworld" or coreclr_args.collection_name == "aspnet2":
# create a directory with release runtime bits and a checked jit

I only added the aspnet2 check.

If a particular scenario fails does the whole thing just fail? I ended up trying to carry on anyways, with the thought that a partial collection was better than nothing.

Yes, I copied that logic from your script (100%) 🙂

@AndyAyersMS
Copy link
Member

You might want to do the same thing my old script does (and we now do for benchmarks) and use a release build with checked jit.

My code re-uses the same logic, see here:

Ah, good ... in my old script we had to do this with the script itself, so I was looking for that.

@EgorBo EgorBo enabled auto-merge (squash) September 3, 2025 08:25
@EgorBo
Copy link
Member Author

EgorBo commented Sep 3, 2025

/ba-g "linux-x64 Debug NativeAOT timeout"

@EgorBo EgorBo merged commit a6740f4 into dotnet:main Sep 3, 2025
96 of 98 checks passed
@EgorBo EgorBo deleted the automate-te branch September 3, 2025 08:26
filipnavara pushed a commit to filipnavara/runtime that referenced this pull request Sep 5, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 3, 2025
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