Skip to content

[UR][Benchmarks] fix bench charts colors #18623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from
Open
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
23 changes: 18 additions & 5 deletions devops/scripts/benchmarks/html/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ const colorPalette = [
'rgb(210, 190, 0)',
];

const nameColorMap = {};
let colorIndex = 0;

function getColorForName(name) {
if (!(name in nameColorMap)) {
nameColorMap[name] = colorPalette[colorIndex % colorPalette.length];
colorIndex++;
}
return nameColorMap[name];
}

// Run selector functions
function updateSelectedRuns(forceUpdate = true) {
selectedRunsDiv.innerHTML = '';
Expand Down Expand Up @@ -557,7 +568,7 @@ function processTimeseriesData(benchmarkRuns) {
runs: {}
};
}
addRunDataPoint(resultsByLabel[result.label], run, result, run.name);
addRunDataPoint(resultsByLabel[result.label], run, result, false, run.name);
});
});

Expand Down Expand Up @@ -686,14 +697,14 @@ function processLayerComparisonsData(benchmarkRuns) {
group.benchmarkLabels.push(result.label);
}

addRunDataPoint(group, run, result, name);
addRunDataPoint(group, run, result, true, name);
});
});

return Object.values(groupedResults);
}

function addRunDataPoint(group, run, result, name = null) {
function addRunDataPoint(group, run, result, comparison, name = null) {
const runKey = name || result.label + ' (' + run.name + ')';

if (!group.runs[runKey]) {
Expand All @@ -702,8 +713,10 @@ function addRunDataPoint(group, run, result, name = null) {
label: runKey,
runName: run.name,
data: [],
borderColor: colorPalette[datasetIndex % colorPalette.length],
backgroundColor: colorPalette[datasetIndex % colorPalette.length],
borderColor:
comparison ? colorPalette[datasetIndex % colorPalette.length] : getColorForName(run.name),
backgroundColor:
comparison ? colorPalette[datasetIndex % colorPalette.length] : getColorForName(run.name),
borderWidth: 1,
pointRadius: 3,
pointStyle: 'circle',
Expand Down
Loading