Skip to content

Commit

Permalink
Elevate many forks benchmarking defintion to the ci root
Browse files Browse the repository at this point in the history
  • Loading branch information
farquet committed Sep 13, 2021
1 parent 476bfd0 commit 168e089
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 38 deletions.
40 changes: 40 additions & 0 deletions bench-common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,45 @@
$.hwlocIfNuma(true, cmd_node0, node=0) + ["&"],
$.hwlocIfNuma(true, cmd_node1, node=1) + ["&"],
["wait"]
],

many_forks_benchmarking:: common.build_base + {
// building block used to generate fork builds
local benchmarking_config_repo = self.ci_resources.infra.benchmarking_config_repo,
environment+: {
BENCHMARKING_CONFIG_REPO: "$BUILD_DIR/benchmarking-config",
FORK_COUNTS_DIRECTORY: "$BENCHMARKING_CONFIG_REPO/fork-counts",
FORK_COUNT_FILE: error "FORK_COUNT_FILE env var must be set to use the many forks execution!"
},
setup+: [
["set-export", "CURRENT_BRANCH", ["git", "rev-parse", "--abbrev-ref", "HEAD"]],
["echo", "[BENCH-FORKS-CONFIG] Using configuration files from branch ${CURRENT_BRANCH} if it exists remotely."],
["git", "clone", benchmarking_config_repo, "${BENCHMARKING_CONFIG_REPO}"],
["test", "${CURRENT_BRANCH}", "=", "master", "||", "git", "-C", "${BENCHMARKING_CONFIG_REPO}", "checkout", "--track", "origin/${CURRENT_BRANCH}", "||", "echo", "Using default fork counts since there is no branch named '${CURRENT_BRANCH}' in the benchmarking-config repo."]
]
},

generate_fork_builds(suite_obj, subdir='compiler', forks_file_base_name=null)::
/* based on a benchmark suite definition, generates the many forks version based on the hidden fields
* 'forks_batches' that specifies the number of batches this job should be split into and the corresponding
* 'forks_timelimit' that applies to those long-running jobs.
*
* The generated builder will set the 'FORK_COUNT_FILE' to the corresponding json file. So, make sure that the
* mx benchmark command sets --fork-count-file=${FORK_COUNT_FILE}
*/

if std.objectHasAll(suite_obj, "forks_batches") && std.objectHasAll(suite_obj, "forks_timelimit") && suite_obj.forks_batches != null then
[ $.many_forks_benchmarking + suite_obj + {
local batch_str = if suite_obj.forks_batches > 1 then "batch"+i else null,
"job_prefix":: "bench-forks-" + subdir,
"job_suffix":: batch_str,
"timelimit": suite_obj.forks_timelimit,
local base_name = if forks_file_base_name != null then forks_file_base_name else suite_obj.suite,
"environment" +: {
FORK_COUNT_FILE: "${FORK_COUNTS_DIRECTORY}/" + subdir + "/" + base_name + "_forks" + (if batch_str != null then "_"+batch_str else "") + ".json"
}
}
for i in std.range(0, suite_obj.forks_batches - 1)]
else
[],
}
2 changes: 1 addition & 1 deletion compiler/ci_common/benchmark-builders.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@

// intensive weekly benchmarking
local weekly_forks_builds = std.flattenArrays([
cc.generate_fork_builds(c.weekly + hw.x52 + jdk + cc.libgraal + suite)
bc.generate_fork_builds(c.weekly + hw.x52 + jdk + cc.libgraal + suite, subdir='compiler')
for jdk in amd64_jdks
for suite in bench.groups.weekly_forks_suites
if suite.is_jdk_supported(jdk.jdk_version)
Expand Down
37 changes: 0 additions & 37 deletions compiler/ci_common/compiler-common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -52,43 +52,6 @@
]
},


many_forks_benchmarking:: common.build_base + {
// building block used to generate fork builds
local benchmarking_config_repo = self.ci_resources.infra.benchmarking_config_repo,
environment+: {
BENCHMARKING_CONFIG_REPO: "$BUILD_DIR/benchmarking-config",
FORK_COUNTS_DIRECTORY: "$BENCHMARKING_CONFIG_REPO/fork-counts",
FORK_COUNT_FILE: error "FORK_COUNT_FILE env var must be set to use the many forks execution!"
},
setup+: [
["set-export", "CURRENT_BRANCH", ["git", "rev-parse", "--abbrev-ref", "HEAD"]],
["echo", "[BENCH-FORKS-CONFIG] Using configuration files from branch ${CURRENT_BRANCH} if it exists remotely."],
["git", "clone", benchmarking_config_repo, "${BENCHMARKING_CONFIG_REPO}"],
["test", "${CURRENT_BRANCH}", "=", "master", "||", "git", "-C", "${BENCHMARKING_CONFIG_REPO}", "checkout", "--track", "origin/${CURRENT_BRANCH}", "||", "echo", "Using default fork counts since there is no branch named '${CURRENT_BRANCH}' in the benchmarking-config repo."]
]
},

generate_fork_builds(suite_obj, subdir='compiler')::
/* based on a benchmark suite definition, generates the many forks version based on the hidden fields
* 'forks_batches' that specifies the number of batches this job should be split into and the corresponding
* 'forks_timelimit' that applies to those long-running jobs.
*/

if std.objectHasAll(suite_obj, "forks_batches") && std.objectHasAll(suite_obj, "forks_timelimit") && suite_obj.forks_batches != null then
[ $.many_forks_benchmarking + suite_obj + {
local batch_str = (if suite_obj.forks_batches > 1 then "batch"+i else null),
"job_prefix":: "bench-forks-compiler",
"job_suffix":: batch_str,
"timelimit": suite_obj.forks_timelimit,
"environment" +: {
FORK_COUNT_FILE: "${FORK_COUNTS_DIRECTORY}/" + subdir + "/" + suite_obj.suite + "_forks" + (if batch_str != null then "_"+batch_str else "") + ".json"
}
}
for i in std.range(0, suite_obj.forks_batches - 1)]
else
[],

// JVM configurations
// ******************
c1:: {
Expand Down

0 comments on commit 168e089

Please sign in to comment.