Spaces:
Running
Running
GitHub Actions commited on
Commit Β·
9f7edbf
1
Parent(s): 299e359
sync from abhijitramesh/webgpu-bench@b1708230ca
Browse files- js/run/controller.js +39 -0
- run.html +1 -0
js/run/controller.js
CHANGED
|
@@ -738,6 +738,7 @@ function updateButtons() {
|
|
| 738 |
// on demand. (Download button remains for the "pre-cache without running"
|
| 739 |
// workflow.)
|
| 740 |
const rn = $('btn-run'); if (rn) rn.disabled = state.running || checked.length === 0;
|
|
|
|
| 741 |
const ab = $('btn-abort'); if (ab) { ab.disabled = !state.running; ab.hidden = !state.running; }
|
| 742 |
renderBudgetMeter(checked, cachedChecked);
|
| 743 |
// Keep the Sign in / Submit buttons in sync with the running flag β they
|
|
@@ -998,6 +999,43 @@ async function onDownloadClick() {
|
|
| 998 |
|
| 999 |
// ββββββββββββββββ Run ββββββββββββββββ
|
| 1000 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1001 |
async function onRunClick() {
|
| 1002 |
// Run accepts any checked variant β uncached ones download just-in-time.
|
| 1003 |
const variants = getCheckedVariants();
|
|
@@ -1786,6 +1824,7 @@ function wireHubHandlers() {
|
|
| 1786 |
function wireRunHandlers() {
|
| 1787 |
$('btn-download')?.addEventListener('click', onDownloadClick);
|
| 1788 |
$('btn-run')?.addEventListener('click', onRunClick);
|
|
|
|
| 1789 |
}
|
| 1790 |
|
| 1791 |
// ββββββββββββββββ Public API ββββββββββββββββ
|
|
|
|
| 738 |
// on demand. (Download button remains for the "pre-cache without running"
|
| 739 |
// workflow.)
|
| 740 |
const rn = $('btn-run'); if (rn) rn.disabled = state.running || checked.length === 0;
|
| 741 |
+
const study = $('btn-run-study'); if (study) study.disabled = state.running;
|
| 742 |
const ab = $('btn-abort'); if (ab) { ab.disabled = !state.running; ab.hidden = !state.running; }
|
| 743 |
renderBudgetMeter(checked, cachedChecked);
|
| 744 |
// Keep the Sign in / Submit buttons in sync with the running flag β they
|
|
|
|
| 999 |
|
| 1000 |
// ββββββββββββββββ Run ββββββββββββββββ
|
| 1001 |
|
| 1002 |
+
// Curated leaderboard study: Llama-3.2-1B-Instruct at four quants
|
| 1003 |
+
// (Q2_K, Q4_K_M, Q8_0, F16) for the headline-model sweep, plus every other
|
| 1004 |
+
// listed model at Q4_K_M as a single representative point. Variants that
|
| 1005 |
+
// don't fit the device's memory budget are dropped silently β same rule
|
| 1006 |
+
// the "All fit" button enforces. Selects, then triggers onRunClick.
|
| 1007 |
+
const STUDY_FOCUS_MODEL = 'Llama-3.2-1B-Instruct';
|
| 1008 |
+
const STUDY_FOCUS_QUANTS = new Set(['Q2_K', 'Q4_K_M', 'Q8_0', 'F16']);
|
| 1009 |
+
const STUDY_STANDARD_QUANT = 'Q4_K_M';
|
| 1010 |
+
|
| 1011 |
+
function isStudyVariant(v) {
|
| 1012 |
+
if (!v) return false;
|
| 1013 |
+
if (v.modelName === STUDY_FOCUS_MODEL) return STUDY_FOCUS_QUANTS.has(v.quant);
|
| 1014 |
+
return v.quant === STUDY_STANDARD_QUANT;
|
| 1015 |
+
}
|
| 1016 |
+
|
| 1017 |
+
async function onRunStudyClick() {
|
| 1018 |
+
if (state.running) return;
|
| 1019 |
+
|
| 1020 |
+
// Apply the study selection β same DOM/state plumbing as wireBatchSelect.
|
| 1021 |
+
document.querySelectorAll('.run-variant-select').forEach(cb => {
|
| 1022 |
+
const v = state.variants.find(x => cacheKey(x) === cb.dataset.key);
|
| 1023 |
+
cb.checked = !!v && isStudyVariant(v) && variantFitsDevice(v);
|
| 1024 |
+
});
|
| 1025 |
+
document.querySelectorAll('.run-family').forEach(el => {
|
| 1026 |
+
if (el.dataset.family) updateFamilySelectAllState(el.dataset.family);
|
| 1027 |
+
});
|
| 1028 |
+
updateButtons();
|
| 1029 |
+
|
| 1030 |
+
const checked = getCheckedVariants();
|
| 1031 |
+
if (checked.length === 0) {
|
| 1032 |
+
logLine('Run study: no variants matched (none of the study quants fit this device).');
|
| 1033 |
+
return;
|
| 1034 |
+
}
|
| 1035 |
+
logLine(`Run study: selected ${checked.length} variants β starting run.`);
|
| 1036 |
+
await onRunClick();
|
| 1037 |
+
}
|
| 1038 |
+
|
| 1039 |
async function onRunClick() {
|
| 1040 |
// Run accepts any checked variant β uncached ones download just-in-time.
|
| 1041 |
const variants = getCheckedVariants();
|
|
|
|
| 1824 |
function wireRunHandlers() {
|
| 1825 |
$('btn-download')?.addEventListener('click', onDownloadClick);
|
| 1826 |
$('btn-run')?.addEventListener('click', onRunClick);
|
| 1827 |
+
$('btn-run-study')?.addEventListener('click', onRunStudyClick);
|
| 1828 |
}
|
| 1829 |
|
| 1830 |
// ββββββββββββββββ Public API ββββββββββββββββ
|
run.html
CHANGED
|
@@ -168,6 +168,7 @@
|
|
| 168 |
<span id="queue-status" class="run-queue-status" hidden></span>
|
| 169 |
<div class="run-actions">
|
| 170 |
<button class="btn btn-secondary" id="btn-download" type="button" disabled>Download selected</button>
|
|
|
|
| 171 |
<button class="btn btn-primary" id="btn-run" type="button" disabled>Run benchmarks</button>
|
| 172 |
<button class="btn btn-danger" id="btn-abort" type="button" hidden>Abort</button>
|
| 173 |
<button class="btn btn-secondary" id="btn-purge" type="button" hidden>Purge OPFS cache</button>
|
|
|
|
| 168 |
<span id="queue-status" class="run-queue-status" hidden></span>
|
| 169 |
<div class="run-actions">
|
| 170 |
<button class="btn btn-secondary" id="btn-download" type="button" disabled>Download selected</button>
|
| 171 |
+
<button class="btn btn-primary" id="btn-run-study" type="button" title="Llama-3.2-1B-Instruct at Q2_K / Q4_K_M / Q8_0 / F16, plus every other model at Q4_K_M, filtered to what fits this device.">Run study</button>
|
| 172 |
<button class="btn btn-primary" id="btn-run" type="button" disabled>Run benchmarks</button>
|
| 173 |
<button class="btn btn-danger" id="btn-abort" type="button" hidden>Abort</button>
|
| 174 |
<button class="btn btn-secondary" id="btn-purge" type="button" hidden>Purge OPFS cache</button>
|