Skip to content

Commit 1426736

Browse files
authored
[CI][Benchmarks] add driver information to runs (#17797)
1 parent 3bd7258 commit 1426736

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

devops/scripts/benchmarks/history.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,18 @@ def create_run(self, name: str, results: list[Result]) -> BenchmarkRun:
7777
git_hash = "unknown"
7878
github_repo = None
7979

80+
compute_runtime = (
81+
options.compute_runtime_tag if options.build_compute_runtime else None
82+
)
83+
8084
return BenchmarkRun(
8185
name=name,
8286
git_hash=git_hash,
8387
github_repo=github_repo,
8488
date=datetime.now(tz=timezone.utc),
8589
results=results,
8690
hostname=socket.gethostname(),
91+
compute_runtime=compute_runtime,
8792
)
8893

8994
def save(self, save_name, results: list[Result], to_file=True):

devops/scripts/benchmarks/html/scripts.js

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ function createChart(data, containerId, type) {
9494
`Value: ${point.y.toFixed(2)} ${data.unit}`,
9595
`Stddev: ${point.stddev.toFixed(2)} ${data.unit}`,
9696
`Git Hash: ${point.gitHash}`,
97+
`Compute Runtime: ${point.compute_runtime}`,
9798
];
9899
} else {
99100
return [`${context.dataset.label}:`,
@@ -147,7 +148,7 @@ function createChart(data, containerId, type) {
147148
const chartConfig = {
148149
type: type === 'time' ? 'line' : 'bar',
149150
data: type === 'time' ? {
150-
datasets: createTimeseriesDatasets(data)
151+
datasets: Object.values(data.runs)
151152
} : {
152153
labels: data.labels,
153154
datasets: data.datasets
@@ -692,36 +693,32 @@ function processLayerComparisonsData(benchmarkRuns) {
692693
return Object.values(groupedResults);
693694
}
694695

695-
function createRunDataStructure(run, result, label) {
696-
return {
697-
runName: run.name,
698-
points: [{
699-
date: new Date(run.date),
700-
value: result.value,
701-
stddev: result.stddev,
702-
git_hash: run.git_hash,
703-
github_repo: run.github_repo,
704-
label: label || result.label
705-
}]
706-
};
707-
}
708-
709696
function addRunDataPoint(group, run, result, name = null) {
710697
const runKey = name || result.label + ' (' + run.name + ')';
711698

712699
if (!group.runs[runKey]) {
700+
const datasetIndex = Object.keys(group.runs).length;
713701
group.runs[runKey] = {
702+
label: runKey,
714703
runName: run.name,
715-
points: []
704+
data: [],
705+
borderColor: colorPalette[datasetIndex % colorPalette.length],
706+
backgroundColor: colorPalette[datasetIndex % colorPalette.length],
707+
borderWidth: 1,
708+
pointRadius: 3,
709+
pointStyle: 'circle',
710+
pointHoverRadius: 5
716711
};
717712
}
718713

719-
group.runs[runKey].points.push({
720-
date: new Date(run.date),
721-
value: result.value,
714+
group.runs[runKey].data.push({
715+
seriesName: runKey,
716+
x: new Date(run.date),
717+
y: result.value,
722718
stddev: result.stddev,
723-
git_hash: run.git_hash,
724-
github_repo: run.github_repo,
719+
gitHash: run.git_hash,
720+
gitRepo: run.github_repo,
721+
compute_runtime: run.compute_runtime
725722
});
726723

727724
return group;

devops/scripts/benchmarks/utils/result.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class BenchmarkRun:
4242
default=None,
4343
metadata=config(encoder=datetime.isoformat, decoder=datetime.fromisoformat),
4444
)
45+
compute_runtime: str = "Unknown"
4546

4647

4748
@dataclass_json

0 commit comments

Comments
 (0)