Skip to content

Commit 8fe767f

Browse files
Create superpmi-asmdiffs pipeline (#61194)
Create a new `runtime-coreclr superpmi-asmdiffs` pipeline that runs SuperPMI asmdiffs for every change in the JIT directory. The diffs are run on two platforms: Windows x64 and Windows x86. Linux, and Arm64 and Arm32, asm diffs are done using cross-compilers, as follows: | Platform | Asm diffs | | -- | -- | | Windows x64 | win-x64, win-arm64, linux-x64, linux-arm64 | | Windows x86 | win-x86, linux-arm | The resulting summary .md files are uploaded into the pipeline artifacts, one .md file per platform (so, one for the Windows x64 runs and one for the Windows x86 runs). The results are also displayed in "Extensions" page of the AzDO pipeline. The runs take about 50 minutes to complete (assuming not much waiting for machines). The asm diffs pipeline is similar to the "superpmi-replay" pipeline, except: 1. It determines what an appropriate baseline JIT would be based on the PR commit and how it merges with the `main` branch. Given this, it downloads the matching baseline JITs from the JIT rolling build artifacts in Azure Storage. 2. It clones the `jitutils` repo and builds the `jit-analyze` tool, needed to generate the summary .md file. 3. It downloads and adds to the Helix machine payload a "portable" `git` installation, as `git diff` is used by `jit-analyze` for analyzing the generated .dasm files of the diff. 4. It collects all the various summary.md files into one per platform on which the runs are done, and publishes that to the artifacts and the `Extensions` page. 5. It only does one replay (asmdiffs) run, not one for each of a set of multiple stress modes. As part of this implementation, a. The `azdo_pipelines_util.py` was renamed to `jitutil.py`, and a lot of utility functions from superpmi.py were moved over to it. This was mostly to share the code for downloading and uncompressing .zip files. (There is a slight change to the output from the `superpmi.py download` command as a result.) However, I also moved a bunch of simple, more general helpers, for possible future sharing. b. `jitrollingbuild.py download` can now take no arguments and download a baseline JIT (from the JIT rolling build Azure Storage location), for the current enlistment, to the default location. Previously, it required a specific git_hash and target directory. There is similar logic in superpmi.py, but not quite the same. c. The `superpmi.py --no_progress` option was made global, and applied in a few more places. This was necessary because `superpmi.py asmdiffs` will download a coredistools binary from the JIT Azure Storage if one isn't found in the Core_Root folder. Fixes #59445
1 parent 213020c commit 8fe767f

21 files changed

+1770
-714
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
pr:
2+
branches:
3+
include:
4+
- main
5+
paths:
6+
include:
7+
- src/coreclr/jit/*
8+
9+
jobs:
10+
11+
- template: /eng/pipelines/common/platform-matrix.yml
12+
parameters:
13+
jobTemplate: /eng/pipelines/coreclr/templates/build-jit-job.yml
14+
buildConfig: checked
15+
platforms:
16+
- windows_x64
17+
- windows_x86
18+
jobParameters:
19+
uploadAs: 'pipelineArtifacts'
20+
21+
- template: /eng/pipelines/common/platform-matrix.yml
22+
parameters:
23+
jobTemplate: /eng/pipelines/coreclr/templates/superpmi-asmdiffs-job.yml
24+
buildConfig: checked
25+
platforms:
26+
- windows_x64
27+
- windows_x86
28+
helixQueueGroup: ci
29+
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
parameters:
2+
steps: [] # optional -- any additional steps that need to happen before pulling down the jitutils repo and sending the jitutils to helix (ie building your repo)
3+
variables: [] # optional -- list of additional variables to send to the template
4+
jobName: '' # required -- job name
5+
displayName: '' # optional -- display name for the job. Will use jobName if not passed
6+
pool: '' # required -- name of the Build pool
7+
container: '' # required -- name of the container
8+
buildConfig: '' # required -- build configuration
9+
archType: '' # required -- targeting CPU architecture
10+
osGroup: '' # required -- operating system for the job
11+
osSubgroup: '' # optional -- operating system subgroup
12+
continueOnError: 'false' # optional -- determines whether to continue the build if the step errors
13+
dependsOn: '' # optional -- dependencies of the job
14+
timeoutInMinutes: 120 # optional -- timeout for the job
15+
enableTelemetry: false # optional -- enable for telemetry
16+
liveLibrariesBuildConfig: '' # optional -- live-live libraries configuration to use for the run
17+
helixQueues: '' # required -- Helix queues
18+
dependOnEvaluatePaths: false
19+
20+
jobs:
21+
- template: xplat-pipeline-job.yml
22+
parameters:
23+
dependsOn: ${{ parameters.dependsOn }}
24+
buildConfig: ${{ parameters.buildConfig }}
25+
archType: ${{ parameters.archType }}
26+
osGroup: ${{ parameters.osGroup }}
27+
osSubgroup: ${{ parameters.osSubgroup }}
28+
liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }}
29+
enableTelemetry: ${{ parameters.enableTelemetry }}
30+
enablePublishBuildArtifacts: true
31+
continueOnError: ${{ parameters.continueOnError }}
32+
dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }}
33+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
34+
35+
${{ if ne(parameters.displayName, '') }}:
36+
displayName: '${{ parameters.displayName }}'
37+
${{ if eq(parameters.displayName, '') }}:
38+
displayName: '${{ parameters.jobName }}'
39+
40+
variables:
41+
42+
- ${{ each variable in parameters.variables }}:
43+
- ${{ if ne(variable.name, '') }}:
44+
- name: ${{ variable.name }}
45+
value: ${{ variable.value }}
46+
- ${{ if ne(variable.group, '') }}:
47+
- group: ${{ variable.group }}
48+
49+
- name: PythonScript
50+
value: 'py -3'
51+
- name: PipScript
52+
value: 'py -3 -m pip'
53+
- name: SpmiCollectionLocation
54+
value: '$(Build.SourcesDirectory)\artifacts\spmi\'
55+
- name: SpmiLogsLocation
56+
value: '$(Build.SourcesDirectory)\artifacts\spmi_logs\'
57+
- name: SpmiAsmdiffsLocation
58+
value: '$(Build.SourcesDirectory)\artifacts\spmi_asmdiffs\'
59+
- name: HelixResultLocation
60+
value: '$(Build.SourcesDirectory)\artifacts\helixresults\'
61+
62+
workspace:
63+
clean: all
64+
pool:
65+
${{ parameters.pool }}
66+
container: ${{ parameters.container }}
67+
steps:
68+
- ${{ parameters.steps }}
69+
70+
- script: |
71+
mkdir $(SpmiCollectionLocation)
72+
mkdir $(SpmiLogsLocation)
73+
mkdir $(SpmiAsmdiffsLocation)
74+
displayName: Create directories
75+
76+
- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_asmdiffs_setup.py -source_directory $(Build.SourcesDirectory) -product_directory $(buildProductRootFolderPath) -arch $(archType)
77+
displayName: ${{ format('SuperPMI asmdiffs setup ({0})', parameters.archType) }}
78+
79+
# Run superpmi asmdiffs in helix
80+
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml
81+
parameters:
82+
displayName: 'Send job to Helix'
83+
helixBuild: $(Build.BuildNumber)
84+
helixSource: $(_HelixSource)
85+
helixType: 'build/tests/'
86+
helixQueues: ${{ join(',', parameters.helixQueues) }}
87+
creator: dotnet-bot
88+
WorkItemTimeout: 2:00 # 2 hours
89+
WorkItemDirectory: '$(WorkItemDirectory)'
90+
CorrelationPayloadDirectory: '$(CorrelationPayloadDirectory)'
91+
helixProjectArguments: '$(Build.SourcesDirectory)/src/coreclr/scripts/superpmi-asmdiffs.proj'
92+
BuildConfig: ${{ parameters.buildConfig }}
93+
osGroup: ${{ parameters.osGroup }}
94+
archType: ${{ parameters.archType }}
95+
shouldContinueOnError: true # Run the future step i.e. upload superpmi logs
96+
97+
# Always upload the available logs for diagnostics
98+
- task: CopyFiles@2
99+
displayName: Copying superpmi.log of all partitions
100+
inputs:
101+
sourceFolder: '$(HelixResultLocation)'
102+
contents: '**/superpmi_*.log'
103+
targetFolder: '$(SpmiLogsLocation)'
104+
condition: always()
105+
106+
- task: CopyFiles@2
107+
displayName: Copying superpmi.md of all partitions
108+
inputs:
109+
sourceFolder: '$(HelixResultLocation)'
110+
contents: '**/superpmi_*.md'
111+
targetFolder: '$(SpmiAsmdiffsLocation)'
112+
condition: always()
113+
114+
- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_asmdiffs_summarize.py -diff_summary_dir $(SpmiAsmdiffsLocation) -arch $(archType)
115+
displayName: ${{ format('Summarize ({0})', parameters.archType) }}
116+
condition: always()
117+
118+
- task: PublishPipelineArtifact@1
119+
displayName: Publish SuperPMI logs
120+
inputs:
121+
targetPath: $(SpmiLogsLocation)
122+
artifactName: 'SuperPMI_Logs_$(archType)_$(buildConfig)'
123+
condition: always()
124+
125+
- task: PublishPipelineArtifact@1
126+
displayName: Publish SuperPMI asmdiffs files
127+
inputs:
128+
targetPath: $(SpmiAsmdiffsLocation)
129+
artifactName: 'SuperPMI_Asmdiffs_$(archType)_$(buildConfig)'
130+
condition: always()
131+
132+
- task: PublishPipelineArtifact@1
133+
displayName: Publish SuperPMI build logs
134+
inputs:
135+
targetPath: $(Build.SourcesDirectory)/artifacts/log
136+
artifactName: 'SuperPMI_BuildLogs_$(archType)_$(buildConfig)'
137+
condition: always()

eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
- script: |
115115
mkdir -p $(MergedMchFileLocation)
116116
mkdir -p $(SpmiLogsLocation)
117-
displayName: Create directory for merged collection
117+
displayName: Create directories
118118
- ${{ if eq(parameters.osGroup, 'windows') }}:
119119
- script: |
120120
mkdir $(MergedMchFileLocation)

eng/pipelines/coreclr/templates/run-superpmi-replay-job.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ jobs:
6666
- ${{ parameters.steps }}
6767

6868
- script: |
69-
mkdir -p $(SpmiCollectionLocation)
70-
displayName: Create directory for SPMI collection
69+
mkdir $(SpmiCollectionLocation)
70+
mkdir $(SpmiLogsLocation)
71+
displayName: Create directories
7172
7273
- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_replay_setup.py -source_directory $(Build.SourcesDirectory) -product_directory $(buildProductRootFolderPath) -arch $(archType)
73-
displayName: ${{ format('SuperPMI replay setup ({0} {1})', parameters.osGroup, parameters.archType) }}
74+
displayName: ${{ format('SuperPMI replay setup ({0})', parameters.archType) }}
7475

7576
# Run superpmi replay in helix
7677
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
parameters:
2+
buildConfig: '' # required -- build configuration
3+
archType: '' # required -- targeting CPU architecture
4+
osGroup: '' # required -- operating system for the job
5+
osSubgroup: '' # optional -- operating system subgroup
6+
pool: ''
7+
timeoutInMinutes: 120 # build timeout
8+
variables: {}
9+
helixQueues: ''
10+
dependOnEvaluatePaths: false
11+
runJobTemplate: '/eng/pipelines/coreclr/templates/run-superpmi-asmdiffs-job.yml'
12+
13+
jobs:
14+
- template: ${{ parameters.runJobTemplate }}
15+
parameters:
16+
jobName: ${{ format('superpmi_asmdiffs_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
17+
displayName: ${{ format('SuperPMI asmdiffs {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
18+
pool: ${{ parameters.pool }}
19+
buildConfig: ${{ parameters.buildConfig }}
20+
archType: ${{ parameters.archType }}
21+
osGroup: ${{ parameters.osGroup }}
22+
osSubgroup: ${{ parameters.osSubgroup }}
23+
dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }}
24+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
25+
helixQueues: ${{ parameters.helixQueues }}
26+
dependsOn:
27+
- ${{ format('coreclr_jit_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
28+
29+
variables: ${{ parameters.variables }}
30+
31+
steps:
32+
33+
# Download jit builds
34+
- template: /eng/pipelines/common/download-artifact-step.yml
35+
parameters:
36+
unpackFolder: $(buildProductRootFolderPath)
37+
artifactFileName: '$(buildProductArtifactName)$(archiveExtension)'
38+
artifactName: '$(buildProductArtifactName)'
39+
displayName: 'JIT product build'

src/coreclr/scripts/antigen_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from os.path import getsize
2121
import os
2222
from coreclr_arguments import *
23-
from azdo_pipelines_util import run_command, TempDir
23+
from jitutil import run_command, TempDir
2424

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

0 commit comments

Comments
 (0)