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

Commit 6eaf27d

Browse files
Separate large perf benchmarks into their own legs (#15231)
Separate large perf benchmarks into their own legs This change splits the windows perf test stages into 6 pipelined legs per flavor to reduce the amount of time we spend running the perf tests and reduce the total time of the job. This change also decreases the size of the stashed bin directory by deleting the obj directory. Finally, we move the benchstones suite into one directory (moving BenchF and BenchI into a shared dir called Benchstones)
1 parent ca7448c commit 6eaf27d

File tree

90 files changed

+69
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+69
-20
lines changed

buildpipeline/perf-pipeline.groovy

Lines changed: 69 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44
// Note that the parameters will be set as env variables so we cannot use names that conflict
55
// with the engineering system parameter names.
66

7+
//-------------------------- Globals ---------------------------------//
8+
9+
def validTestFolders = [
10+
'Benchstones',
11+
'BenchmarksGame',
12+
'Bytemark',
13+
'Math',
14+
'Span',
15+
'first half',
16+
'last half'
17+
]
18+
719
//--------------------- Windows Functions ----------------------------//
820

921
def windowsBuild(String arch, String config, String pgo, boolean isBaseline) {
@@ -19,25 +31,32 @@ def windowsBuild(String arch, String config, String pgo, boolean isBaseline) {
1931
}
2032

2133
bat "set __TestIntermediateDir=int&&.\\build.cmd -${config} -${arch} -skipbuildpackages ${pgoBuildFlag}"
34+
bat "tests\\runtest.cmd ${config} ${arch} GenerateLayoutOnly"
35+
bat "rd /s /q bin\\obj"
2236

2337
// Stash build artifacts. Stash tests in an additional stash to be used by Linux test runs
2438
stash name: "nt-${arch}-${pgo}${baselineString}-build-artifacts", includes: 'bin/**'
2539
stash name: "nt-${arch}-${pgo}${baselineString}-test-artifacts", includes: 'bin/tests/**'
2640
}
2741

28-
def windowsPerf(String arch, String config, String uploadString, String runType, String opt_level, String jit, String pgo, String scenario, boolean isBaseline, boolean isProfileOn) {
42+
def windowsPerf(String arch, String config, String uploadString, String runType, String opt_level, String jit, String pgo, String scenario, boolean isBaseline, boolean isProfileOn, String testFolder) {
2943
withCredentials([string(credentialsId: 'CoreCLR Perf BenchView Sas', variable: 'BV_UPLOAD_SAS_TOKEN')]) {
3044
checkout scm
3145
String baselineString = ""
3246
if (isBaseline) {
3347
baselineString = "-baseline"
3448
}
3549
dir ('.') {
36-
unstash "nt-${arch}-${pgo}${baselineString}-build-artifacts"
50+
unstash "nt-${arch}-${pgo}${baselineString}-test-artifacts"
3751
unstash "benchview-tools"
3852
unstash "metadata"
3953
}
4054

55+
String test = ''
56+
if (testFolder != 'all') {
57+
test = testFolder
58+
}
59+
4160
String pgoTestFlag = ((pgo == 'nopgo') ? '-nopgo' : '')
4261

4362
// We want to use the baseline metadata for baseline runs. We expect to find the submission metadata in
@@ -52,8 +71,6 @@ def windowsPerf(String arch, String config, String uploadString, String runType,
5271

5372
bat "py \".\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\""
5473
bat ".\\init-tools.cmd"
55-
bat "run.cmd build -Project=\"tests\\build.proj\" -BuildOS=Windows_NT -BuildType=${config} -BuildArch=${arch} -BatchRestorePackages"
56-
bat "tests\\runtest.cmd ${config} ${arch} GenerateLayoutOnly"
5774

5875
// We run run-xunit-perf differently for each of the different job types
5976

@@ -62,13 +79,43 @@ def windowsPerf(String arch, String config, String uploadString, String runType,
6279
String runXUnitCommonArgs = "-arch ${arch} -configuration ${config} -generateBenchviewData \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" ${uploadString} ${pgoTestFlag} -runtype ${runType} ${testEnv} -optLevel ${opt_level} -jitName ${jit} -outputdir \"%WORKSPACE%\\bin\\sandbox_logs\""
6380
if (scenario == 'perf') {
6481
String runXUnitPerfCommonArgs = "${runXUnitCommonArgs} -stabilityPrefix \"START \"CORECLR_PERF_RUN\" /B /WAIT /HIGH /AFFINITY 0x2\""
65-
String runXUnitPerflabArgs = "${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${arch}.${config}\\performance\\perflab\\Perflab -library"
82+
if (test == 'first half' || testFolder == 'all')
83+
{
84+
String runXUnitPerflabArgs = "${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${arch}.${config}\\performance\\perflab\\Perflab -library"
6685

67-
profileArg = isProfileOn ? "default+${profileArg}+gcapi" : profileArg
68-
bat "tests\\scripts\\run-xunit-perf.cmd ${runXUnitPerflabArgs} -collectionFlags ${profileArg}"
86+
profileArg = isProfileOn ? "default+${profileArg}+gcapi" : profileArg
87+
bat "tests\\scripts\\run-xunit-perf.cmd ${runXUnitPerflabArgs} -collectionFlags ${profileArg}"
88+
}
6989

70-
String runXUnitCodeQualityArgs = "${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${arch}.${config}\\Jit\\Performance\\CodeQuality"
71-
bat "tests\\scripts\\run-xunit-perf.cmd ${runXUnitCodeQualityArgs} -collectionFlags ${profileArg}"
90+
if (test == 'first half') {
91+
92+
[
93+
'Burgers',
94+
'Devirtualization',
95+
'FractalPerf',
96+
'Inlining',
97+
'Layout'
98+
].each { benchmark ->
99+
String runXUnitCodeQualityArgs = "${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${arch}.${config}\\Jit\\Performance\\CodeQuality\\${benchmark}"
100+
bat "tests\\scripts\\run-xunit-perf.cmd ${runXUnitCodeQualityArgs} -collectionFlags ${profileArg}"
101+
}
102+
}
103+
else if (test == 'last half') {
104+
[
105+
'Linq',
106+
'Roslyn',
107+
'SciMark',
108+
'Serialization',
109+
'V8'
110+
].each { benchmark ->
111+
String runXUnitCodeQualityArgs = "${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${arch}.${config}\\Jit\\Performance\\CodeQuality\\${benchmark}"
112+
bat "tests\\scripts\\run-xunit-perf.cmd ${runXUnitCodeQualityArgs} -collectionFlags ${profileArg}"
113+
}
114+
}
115+
else {
116+
String runXUnitCodeQualityArgs = "${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${arch}.${config}\\Jit\\Performance\\CodeQuality\\${test}"
117+
bat "tests\\scripts\\run-xunit-perf.cmd ${runXUnitCodeQualityArgs} -collectionFlags ${profileArg}"
118+
}
72119
}
73120
else if (scenario == 'jitbench') {
74121
String runXUnitPerfCommonArgs = "${runXUnitCommonArgs} -stabilityPrefix \"START \"CORECLR_PERF_RUN\" /B /WAIT /HIGH\" -scenarioTest"
@@ -307,14 +354,16 @@ def innerLoopTests = [:]
307354
['x64', 'x86'].each { arch ->
308355
['full_opt'].each { opt_level ->
309356
[false].each { isBaseline ->
310-
String baseline = ""
311-
if (isBaseline) {
312-
baseline = " baseline"
313-
}
314-
if (isPR() || !isBaseline) {
315-
innerLoopTests["windows ${arch} ryujit ${opt_level} pgo${baseline} perf"] = {
316-
simpleNode('windows_server_2016_clr_perf', 180) {
317-
windowsPerf(arch, config, uploadString, runType, opt_level, 'ryujit', 'pgo', 'perf', isBaseline, true)
357+
validTestFolders.each { benchmark ->
358+
String baseline = ""
359+
if (isBaseline) {
360+
baseline = " baseline"
361+
}
362+
if (isPR() || !isBaseline) {
363+
innerLoopTests["windows ${arch} ryujit ${opt_level} pgo ${benchmark}${baseline} perf"] = {
364+
simpleNode('windows_server_2016_clr_perf', 180) {
365+
windowsPerf(arch, config, uploadString, runType, opt_level, 'ryujit', 'pgo', 'perf', isBaseline, true, benchmark)
366+
}
318367
}
319368
}
320369
}
@@ -328,13 +377,13 @@ def outerLoopTests = [:]
328377
if (!isPR()) {
329378
outerLoopTests["windows ${arch} ryujit full_opt pgo${baseline} jitbench"] = {
330379
simpleNode('windows_server_2016_clr_perf', 180) {
331-
windowsPerf(arch, config, uploadString, runType, 'full_opt', 'ryujit', 'pgo', 'jitbench', false)
380+
windowsPerf(arch, config, uploadString, runType, 'full_opt', 'ryujit', 'pgo', 'jitbench', false, false, '')
332381
}
333382
}
334383

335384
outerLoopTests["windows ${arch} ryujit full_opt pgo${baseline} illink"] = {
336385
simpleNode('Windows_NT', '20170427-elevated') {
337-
windowsPerf(arch, config, uploadString, runType, 'full_opt', 'ryujit', 'pgo', 'illink', false)
386+
windowsPerf(arch, config, uploadString, runType, 'full_opt', 'ryujit', 'pgo', 'illink', false, false, '')
338387
}
339388
}
340389

@@ -345,7 +394,7 @@ if (!isPR()) {
345394
[true, false].each { isProfileOn ->
346395
outerLoopTests["windows ${arch} ${jit} ${opt_level} ${pgo_enabled} perf"] = {
347396
simpleNode('windows_server_2016_clr_perf', 180) {
348-
windowsPerf(arch, config, uploadString, runType, opt_level, jit, pgo_enabled, 'perf', false, isProfileOn)
397+
windowsPerf(arch, config, uploadString, runType, opt_level, jit, pgo_enabled, 'perf', false, isProfileOn, 'all')
349398
}
350399
}
351400

tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs renamed to tests/src/JIT/Performance/CodeQuality/Benchstones/BenchF/Adams/Adams.cs

File renamed without changes.

tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.csproj renamed to tests/src/JIT/Performance/CodeQuality/Benchstones/BenchF/Adams/Adams.csproj

File renamed without changes.

tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.cs renamed to tests/src/JIT/Performance/CodeQuality/Benchstones/BenchF/BenchMk2/BenchMk2.cs

File renamed without changes.

tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.csproj renamed to tests/src/JIT/Performance/CodeQuality/Benchstones/BenchF/BenchMk2/BenchMk2.csproj

File renamed without changes.

tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.cs renamed to tests/src/JIT/Performance/CodeQuality/Benchstones/BenchF/BenchMrk/BenchMrk.cs

File renamed without changes.

tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.csproj renamed to tests/src/JIT/Performance/CodeQuality/Benchstones/BenchF/BenchMrk/BenchMrk.csproj

File renamed without changes.

tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.cs renamed to tests/src/JIT/Performance/CodeQuality/Benchstones/BenchF/Bisect/Bisect.cs

File renamed without changes.

tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.csproj renamed to tests/src/JIT/Performance/CodeQuality/Benchstones/BenchF/Bisect/Bisect.csproj

File renamed without changes.

tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.cs renamed to tests/src/JIT/Performance/CodeQuality/Benchstones/BenchF/DMath/DMath.cs

File renamed without changes.

0 commit comments

Comments
 (0)