GitHub Actions commited on
Commit
6a35ded
·
1 Parent(s): 4748b05

sync from abhijitramesh/webgpu-bench@9cdd64f37f

Browse files
Files changed (4) hide show
  1. js/charts.js +4 -2
  2. js/dataset.js +16 -0
  3. js/filters.js +2 -1
  4. js/tables.js +4 -1
js/charts.js CHANGED
@@ -427,13 +427,15 @@ export function renderMachineChart(results, machines) {
427
 
428
  const forQuant = passed.filter(r => r.variant === targetQuant);
429
  const byMachine = groupBy(forQuant, 'machineSlug');
430
- const machineLabels = Object.keys(byMachine);
 
 
431
  const browsers = [...new Set(forQuant.map(r => r.browser))].sort();
432
 
433
  const datasets = browsers.map(browser => ({
434
  label: browser,
435
  backgroundColor: BROWSER_COLORS[browser] || '#888',
436
- data: machineLabels.map(slug => {
437
  const items = byMachine[slug].filter(r => r.browser === browser);
438
  if (!items.length) return null;
439
  return items.reduce((s, r) => s + r.decode_tok_s, 0) / items.length;
 
427
 
428
  const forQuant = passed.filter(r => r.variant === targetQuant);
429
  const byMachine = groupBy(forQuant, 'machineSlug');
430
+ const machineSlugs = Object.keys(byMachine);
431
+ const nameBySlug = new Map(machines.map(m => [m.slug, m.userMachineName || m.cpus || m.slug]));
432
+ const machineLabels = machineSlugs.map(slug => nameBySlug.get(slug) || slug);
433
  const browsers = [...new Set(forQuant.map(r => r.browser))].sort();
434
 
435
  const datasets = browsers.map(browser => ({
436
  label: browser,
437
  backgroundColor: BROWSER_COLORS[browser] || '#888',
438
+ data: machineSlugs.map(slug => {
439
  const items = byMachine[slug].filter(r => r.browser === browser);
440
  if (!items.length) return null;
441
  return items.reduce((s, r) => s + r.decode_tok_s, 0) / items.length;
js/dataset.js CHANGED
@@ -82,6 +82,9 @@ async function fetchRunsBatch(datasetRepo, files) {
82
 
83
  const records = [];
84
  const machinesBySlug = new Map();
 
 
 
85
 
86
  // Fetch in parallel — HF's CDN handles concurrent reads fine.
87
  const results = await Promise.allSettled(
@@ -106,13 +109,25 @@ async function fetchRunsBatch(datasetRepo, files) {
106
  // after the merge — leaving them as 0 here is a placeholder.
107
  resultCount: 0,
108
  passCount: 0,
 
109
  llamaCppCommit: r.llamaCppCommit ?? null,
110
  llamaCppDescribe: r.llamaCppDescribe ?? null,
111
  });
112
  }
 
 
 
 
 
 
113
  }
114
  }
115
 
 
 
 
 
 
116
  return { records, machines: [...machinesBySlug.values()], fileCount: files.length };
117
  }
118
 
@@ -169,6 +184,7 @@ function flattenForDashboard(r, slug) {
169
  llamaCppDescribe: r.llamaCppDescribe ?? null,
170
  dawnTag: r.dawnTag ?? null,
171
  submittedBy: r.submittedBy ?? null,
 
172
  iterations: r.metrics?.iterations ?? null,
173
  };
174
  }
 
82
 
83
  const records = [];
84
  const machinesBySlug = new Map();
85
+ // Most-recent userReported.machineName per slug — the same machine can be
86
+ // submitted by multiple people who'd label it differently.
87
+ const userNameBySlug = new Map(); // slug → { name, ts }
88
 
89
  // Fetch in parallel — HF's CDN handles concurrent reads fine.
90
  const results = await Promise.allSettled(
 
109
  // after the merge — leaving them as 0 here is a placeholder.
110
  resultCount: 0,
111
  passCount: 0,
112
+ userMachineName: null,
113
  llamaCppCommit: r.llamaCppCommit ?? null,
114
  llamaCppDescribe: r.llamaCppDescribe ?? null,
115
  });
116
  }
117
+ const userName = r.userReported?.machineName?.trim();
118
+ if (userName) {
119
+ const ts = r.timestamp || '';
120
+ const cur = userNameBySlug.get(slug);
121
+ if (!cur || ts > cur.ts) userNameBySlug.set(slug, { name: userName, ts });
122
+ }
123
  }
124
  }
125
 
126
+ for (const [slug, { name }] of userNameBySlug) {
127
+ const m = machinesBySlug.get(slug);
128
+ if (m) m.userMachineName = name;
129
+ }
130
+
131
  return { records, machines: [...machinesBySlug.values()], fileCount: files.length };
132
  }
133
 
 
184
  llamaCppDescribe: r.llamaCppDescribe ?? null,
185
  dawnTag: r.dawnTag ?? null,
186
  submittedBy: r.submittedBy ?? null,
187
+ userMachineName: r.userReported?.machineName?.trim() || null,
188
  iterations: r.metrics?.iterations ?? null,
189
  };
190
  }
js/filters.js CHANGED
@@ -12,7 +12,8 @@ export function initFilters(meta, onChangeCallback) {
12
  for (const m of meta.machines) {
13
  const opt = document.createElement('option');
14
  opt.value = m.slug;
15
- opt.textContent = `${m.cpus} (${m.totalMemoryGB}GB)`;
 
16
  machineSelect.appendChild(opt);
17
  }
18
 
 
12
  for (const m of meta.machines) {
13
  const opt = document.createElement('option');
14
  opt.value = m.slug;
15
+ const label = m.userMachineName || m.cpus;
16
+ opt.textContent = `${label} (${m.totalMemoryGB}GB)`;
17
  machineSelect.appendChild(opt);
18
  }
19
 
js/tables.js CHANGED
@@ -296,13 +296,16 @@ export function renderMachineInfo(machines) {
296
  let html = '<div class="machine-grid">';
297
  for (const m of machines) {
298
  const failCount = m.resultCount - m.passCount;
 
 
299
  html += `
300
  <div class="machine-card">
301
  <div class="machine-card-header">
302
  <svg class="machine-card-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="8" rx="2" ry="2"/><rect x="2" y="14" width="20" height="8" rx="2" ry="2"/><line x1="6" y1="6" x2="6.01" y2="6"/><line x1="6" y1="18" x2="6.01" y2="18"/></svg>
303
- <h3>${escapeHtml(m.cpus)}</h3>
304
  </div>
305
  <div class="machine-card-specs">
 
306
  <div class="spec-row"><span class="spec-label">Platform</span><span class="spec-value">${m.platform}</span></div>
307
  <div class="spec-row"><span class="spec-label">Arch</span><span class="spec-value">${m.arch}</span></div>
308
  <div class="spec-row"><span class="spec-label">RAM</span><span class="spec-value">${m.totalMemoryGB} GB</span></div>
 
296
  let html = '<div class="machine-grid">';
297
  for (const m of machines) {
298
  const failCount = m.resultCount - m.passCount;
299
+ const title = m.userMachineName || m.cpus;
300
+ const showHardwareRow = m.userMachineName && m.userMachineName !== m.cpus;
301
  html += `
302
  <div class="machine-card">
303
  <div class="machine-card-header">
304
  <svg class="machine-card-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="8" rx="2" ry="2"/><rect x="2" y="14" width="20" height="8" rx="2" ry="2"/><line x1="6" y1="6" x2="6.01" y2="6"/><line x1="6" y1="18" x2="6.01" y2="18"/></svg>
305
+ <h3>${escapeHtml(title)}</h3>
306
  </div>
307
  <div class="machine-card-specs">
308
+ ${showHardwareRow ? `<div class="spec-row"><span class="spec-label">Hardware</span><span class="spec-value">${escapeHtml(m.cpus)}</span></div>` : ''}
309
  <div class="spec-row"><span class="spec-label">Platform</span><span class="spec-value">${m.platform}</span></div>
310
  <div class="spec-row"><span class="spec-label">Arch</span><span class="spec-value">${m.arch}</span></div>
311
  <div class="spec-row"><span class="spec-label">RAM</span><span class="spec-value">${m.totalMemoryGB} GB</span></div>