| title | Performance profile |
|---|
import {buildProfile} from "./components/profile.js";
const [results, benchmarks, run] = await Promise.all([
FileAttachment("./data/results.csv").csv(),
FileAttachment("./data/benchmarks.csv").csv(),
FileAttachment("./data/run.json").json()
]);
const profile = buildProfile(results, benchmarks, run.frameworks);Results from ${html<a href=${run.resultsUrl} target="_blank" rel="noopener">${run.run}</a>}. Each benchmark has equal weight, divided among its selected datasets.
import {tagMenu} from "./components/tagMenu.js";
const hiddenTags = new Set(["standard", "test", "trace"]);
const workloadTags = new Set([
"high-dimensional",
"tensor",
"large-query",
"elementary-ops",
"transcendental-ops",
"shape-ops",
"linalg-ops",
"fancy-ops",
"index-ops",
"nonzero-fill",
"iterative",
"dense",
"hypersparse",
"dynamic-sparsity"
]);
const groupOf = (tag) => workloadTags.has(tag) ? "workload" : "concepts";
const allTags = [...new Set(profile.problems.flatMap((p) => p.tags))]
.filter((tag) => !hiddenTags.has(tag))
.sort();
const keepMenu = tagMenu(allTags, {label: "Include tags", groupOf, groupOrder: ["workload", "concepts"]});
const dropMenu = tagMenu(allTags, {label: "Exclude tags", groupOf, groupOrder: ["workload", "concepts"]});
const countEl = document.createElement("span");
countEl.className = "saps-tag-count";
const row = document.createElement("div");
row.className = "saps-tag-menu-row";
row.append(keepMenu, dropMenu, countEl);
display(row);
const keep = Generators.input(keepMenu);
const drop = Generators.input(dropMenu);const keepSet = new Set(keep);
const dropSet = new Set(drop);
const ok = profile.problems.map((p) =>
(keepSet.size === 0 || p.tags.some((t) => keepSet.has(t))) &&
!p.tags.some((t) => dropSet.has(t))
);
countEl.textContent = `${ok.filter(Boolean).length} problems`;
const nKept = new Map();
profile.problems.forEach((p, i) => {
if (ok[i]) nKept.set(p.benchmark, (nKept.get(p.benchmark) ?? 0) + 1);
});
const total = nKept.size;
const curves = total === 0 ? [] : Object.entries(profile.series).flatMap(([framework, points]) => {
let cum = 0;
const pts = points
.filter(([i]) => ok[i])
.map(([i, ratio]) => ({
framework,
ratio,
pct: (100 * (cum += 1 / nKept.get(profile.problems[i].benchmark))) / total
}));
pts.unshift({framework, ratio: 1, pct: 0});
pts.push({framework, ratio: profile.xMax, pct: pts.at(-1)?.pct ?? 0});
return pts;
});total === 0 ? html`<p role="status">No problems match these tags.</p>` : Plot.plot({
className: "saps-plot",
width,
x: {type: "log", domain: [1, profile.xMax], label: "Ratio (runtime / best runtime)"},
y: {domain: [0, 100], grid: true, label: "% of suite completed"},
color: {legend: true, domain: Object.keys(profile.series)},
marks: [
Plot.line(curves, {
x: "ratio",
y: "pct",
stroke: "framework",
curve: "step-after",
strokeWidth: 3,
tip: true
})
]
})At 1×, a framework matches the fastest runtime for a problem. At 2×, it takes at most twice as long. Failed measurements remain in the suite but do not contribute successes. Include tags match any selection; exclude tags take precedence.
Each benchmark/dataset is tagged with workload descriptors, discovered programmatically through tracing. The table below lists each tag and a short description.
| Tag | Description |
|---|---|
high-dimensional |
5 or more dimensions in a tensor. |
tensor |
3 or more dimensions in a tensor. |
large-query |
5 or more operands on one line. |
elementary-ops |
PEMDAS-only. |
transcendental-ops |
Contains sin, cos, pow, exp, or related operations. |
shape-ops |
Reshape, concat, transpose, squeeze, or similar operations. |
linalg-ops |
Contains xp.linalg or solver-like operations; dot is okay. |
fancy-ops |
min, max, and, or, shift, or similar operations. |
index-ops |
Contains indexing. |
nonzero-fill |
Uses a fill value other than zero. |
iterative |
Loops over a matrix or repeats until convergence. |
dense |
Exclusively dense problems. |
hypersparse |
Contains hypersparsity, such as nnz << n for a dimension. |
dynamic-sparsity |
Sparse-sparse interactions may change the sparsity pattern. |