From 5f6553fb603556865554f7c16e8034ab991623e5 Mon Sep 17 00:00:00 2001 From: Piotr Balcer Date: Wed, 2 Apr 2025 09:56:22 +0000 Subject: [PATCH] [CI][Benchmarks] add driver information to runs --- devops/scripts/benchmarks/history.py | 5 +++ devops/scripts/benchmarks/html/scripts.js | 39 +++++++++++------------ devops/scripts/benchmarks/utils/result.py | 1 + 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/devops/scripts/benchmarks/history.py b/devops/scripts/benchmarks/history.py index 0b80c54ad7393..c31b800b1017a 100644 --- a/devops/scripts/benchmarks/history.py +++ b/devops/scripts/benchmarks/history.py @@ -77,6 +77,10 @@ def create_run(self, name: str, results: list[Result]) -> BenchmarkRun: git_hash = "unknown" github_repo = None + compute_runtime = ( + options.compute_runtime_tag if options.build_compute_runtime else None + ) + return BenchmarkRun( name=name, git_hash=git_hash, @@ -84,6 +88,7 @@ def create_run(self, name: str, results: list[Result]) -> BenchmarkRun: date=datetime.now(tz=timezone.utc), results=results, hostname=socket.gethostname(), + compute_runtime=compute_runtime, ) def save(self, save_name, results: list[Result], to_file=True): diff --git a/devops/scripts/benchmarks/html/scripts.js b/devops/scripts/benchmarks/html/scripts.js index 6cd1857387024..3300de2f1182c 100644 --- a/devops/scripts/benchmarks/html/scripts.js +++ b/devops/scripts/benchmarks/html/scripts.js @@ -94,6 +94,7 @@ function createChart(data, containerId, type) { `Value: ${point.y.toFixed(2)} ${data.unit}`, `Stddev: ${point.stddev.toFixed(2)} ${data.unit}`, `Git Hash: ${point.gitHash}`, + `Compute Runtime: ${point.compute_runtime}`, ]; } else { return [`${context.dataset.label}:`, @@ -145,7 +146,7 @@ function createChart(data, containerId, type) { const chartConfig = { type: type === 'time' ? 'line' : 'bar', data: type === 'time' ? { - datasets: createTimeseriesDatasets(data) + datasets: Object.values(data.runs) } : { labels: data.labels, datasets: data.datasets @@ -677,36 +678,32 @@ function processLayerComparisonsData(benchmarkRuns) { return Object.values(groupedResults); } -function createRunDataStructure(run, result, label) { - return { - runName: run.name, - points: [{ - date: new Date(run.date), - value: result.value, - stddev: result.stddev, - git_hash: run.git_hash, - github_repo: run.github_repo, - label: label || result.label - }] - }; -} - function addRunDataPoint(group, run, result, name = null) { const runKey = name || result.label + ' (' + run.name + ')'; if (!group.runs[runKey]) { + const datasetIndex = Object.keys(group.runs).length; group.runs[runKey] = { + label: runKey, runName: run.name, - points: [] + data: [], + borderColor: colorPalette[datasetIndex % colorPalette.length], + backgroundColor: colorPalette[datasetIndex % colorPalette.length], + borderWidth: 1, + pointRadius: 3, + pointStyle: 'circle', + pointHoverRadius: 5 }; } - group.runs[runKey].points.push({ - date: new Date(run.date), - value: result.value, + group.runs[runKey].data.push({ + seriesName: runKey, + x: new Date(run.date), + y: result.value, stddev: result.stddev, - git_hash: run.git_hash, - github_repo: run.github_repo, + gitHash: run.git_hash, + gitRepo: run.github_repo, + compute_runtime: run.compute_runtime }); return group; diff --git a/devops/scripts/benchmarks/utils/result.py b/devops/scripts/benchmarks/utils/result.py index 6afcc8d1b627b..3051f624e676f 100644 --- a/devops/scripts/benchmarks/utils/result.py +++ b/devops/scripts/benchmarks/utils/result.py @@ -42,6 +42,7 @@ class BenchmarkRun: default=None, metadata=config(encoder=datetime.isoformat, decoder=datetime.fromisoformat), ) + compute_runtime: str = "Unknown" @dataclass_json