Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion bazelmod/llvm.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ bazel_dep(name = "toolchains_llvm", version = "1.8.0")
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True)
llvm.toolchain(
name = "llvm_toolchain_llvm",
llvm_version = "20.1.8",
llvm_version = "22.1.8",
extra_llvm_distributions = {
# 22.1.8 — newest released; a forward-looking rung in the CI clang matrix
"LLVM-22.1.8-Linux-ARM64.tar.xz": "805efad2bb91cb4967fa569e0881d10c0f69c04461cf671cccbae19f547acc34",
Expand Down
4 changes: 4 additions & 0 deletions mbo/hash/measurements/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ per-machine LFS bundle, and prints exactly what to commit:
```sh
# Everything, SMHasher3 batteries 4-at-a-time (perf runs first and alone):
mbo/hash/measurements/run_measurements.py --jobs 4
# Pick the toolchain (and thus the recorded compiler): --config clang uses the
# hermetic LLVM clang; omit --config for the native toolchain (gcc on Linux).
# Run once per compiler to compare them - the bundle filenames won't collide:
mbo/hash/measurements/run_measurements.py --config clang --jobs 4
# In-house family only, or perf/chart only:
mbo/hash/measurements/run_measurements.py --algos mumbo,jumbo,dumbo --jobs 1
mbo/hash/measurements/run_measurements.py --skip-smhasher
Expand Down
12 changes: 9 additions & 3 deletions mbo/hash/measurements/hash_benchmark_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ def _machine_augment():
return augment


def _run_benchmark(mode, reps, min_time, warmup):
"""Runs the bazel benchmark with the measurement precautions; returns parsed JSON."""
def _run_benchmark(mode, reps, min_time, warmup, config=None):
"""Runs the bazel benchmark with the measurement precautions; returns parsed JSON.

`config` selects a bazel `--config` (e.g. 'clang' / 'gcc'), so the toolchain -
and therefore the compiler the benchmark records into the dataset - is the one
you want to measure."""
env = dict(os.environ)
if mode == "full":
env["MBO_HASH_BENCHMARK_FULL"] = "1"
Expand All @@ -146,6 +150,7 @@ def _run_benchmark(mode, reps, min_time, warmup):
"run",
"-c",
"opt",
*([f"--config={config}"] if config else []),
_BENCHMARK_TARGET,
"--",
"--benchmark_format=json",
Expand Down Expand Up @@ -549,6 +554,7 @@ def main(argv):
p_run.add_argument("--raw", help="write google/benchmark raw JSON here (.gz compresses)")
p_run.add_argument("--out", help="write the distilled canonical results JSON here")
p_run.add_argument("--tables", action="store_true")
p_run.add_argument("--config", help="bazel --config for the benchmark build (e.g. clang, gcc); picks the toolchain and the recorded compiler")

p_store = sub.add_parser("store", help="distill raw benchmark JSON to canonical results JSON")
p_store.add_argument("--raw", required=True)
Expand Down Expand Up @@ -599,7 +605,7 @@ def main(argv):
stamp = _timestamp()

if args.command == "run":
raw = _run_benchmark(args.mode, args.reps, args.min_time, args.warmup)
raw = _run_benchmark(args.mode, args.reps, args.min_time, args.warmup, args.config)
if args.raw:
raw_path = _timestamped(args.raw, stamp)
opener = gzip.open if raw_path.endswith(".gz") else open
Expand Down
4 changes: 3 additions & 1 deletion mbo/hash/measurements/run_measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def main(argv):
parser.add_argument("--algos", default="all", help="SMHasher3 algorithms (default 'all'; e.g. mumbo,jumbo,dumbo)")
parser.add_argument("--jobs", type=int, default=4, help="SMHasher3 batteries to run concurrently (default 4)")
parser.add_argument("--reps", type=int, default=9, help="benchmark repetitions (default 9)")
parser.add_argument("--config", help="bazel --config for the perf benchmark (e.g. clang, gcc); picks the toolchain + recorded compiler")
parser.add_argument(
"--workdir",
default=os.path.expanduser("~/.cache/mbo-hash-smh"),
Expand Down Expand Up @@ -101,7 +102,8 @@ def main(argv):
with open(os.path.join(data, "README_tables.md"), "w") as tables:
subprocess.run(
[*report, "run", "--mode", "full", "--reps", str(args.reps),
"--raw", os.path.join(data, "raw.json.gz"), "--out", os.path.join(data, "results.json"), "--tables"],
"--raw", os.path.join(data, "raw.json.gz"), "--out", os.path.join(data, "results.json"), "--tables"]
+ (["--config", args.config] if args.config else []),
stdout=tables, check=True,
)
canonical = newest(os.path.join(data, "*_results.json"))
Expand Down
Loading