-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbenchmark_app.html
More file actions
648 lines (576 loc) · 22.5 KB
/
benchmark_app.html
File metadata and controls
648 lines (576 loc) · 22.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TurboLoader Benchmark Dashboard</title>
<script src="https://cdn.plot.ly/plotly-2.27.0.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #333;
padding: 20px;
min-height: 100vh;
}
.container {
max-width: 1400px;
margin: 0 auto;
background: white;
border-radius: 20px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
overflow: hidden;
}
header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 40px;
text-align: center;
}
h1 {
font-size: 3em;
margin-bottom: 10px;
font-weight: 700;
}
.subtitle {
font-size: 1.2em;
opacity: 0.9;
margin-bottom: 20px;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 15px;
margin-top: 30px;
}
.stat-card {
background: rgba(255, 255, 255, 0.2);
padding: 20px;
border-radius: 10px;
text-align: center;
backdrop-filter: blur(10px);
}
.stat-value {
font-size: 2em;
font-weight: bold;
margin-bottom: 5px;
}
.stat-label {
font-size: 0.9em;
opacity: 0.9;
}
.controls {
padding: 30px 40px;
background: #f8f9fa;
border-bottom: 2px solid #e9ecef;
}
.control-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
}
.control-group {
display: flex;
flex-direction: column;
}
label {
font-weight: 600;
margin-bottom: 8px;
color: #495057;
font-size: 0.9em;
}
input, select, button {
padding: 12px;
border: 2px solid #dee2e6;
border-radius: 8px;
font-size: 1em;
transition: all 0.3s;
}
input:focus, select:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
button {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
cursor: pointer;
font-weight: 600;
margin-top: 20px;
}
button:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
button:active {
transform: translateY(0);
}
.charts {
padding: 40px;
}
.chart-container {
margin-bottom: 40px;
background: white;
border-radius: 10px;
padding: 20px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.chart-title {
font-size: 1.5em;
font-weight: 600;
margin-bottom: 20px;
color: #495057;
}
.framework-comparison {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 15px;
margin: 30px 0;
}
.framework-card {
padding: 20px;
border-radius: 10px;
text-align: center;
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
transition: transform 0.3s;
}
.framework-card:hover {
transform: translateY(-5px);
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}
.framework-card.winner {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.framework-name {
font-weight: 600;
margin-bottom: 10px;
font-size: 1.1em;
}
.framework-speed {
font-size: 1.8em;
font-weight: bold;
}
.framework-speedup {
font-size: 0.9em;
opacity: 0.8;
margin-top: 5px;
}
.loading {
text-align: center;
padding: 60px;
font-size: 1.2em;
color: #6c757d;
}
.spinner {
border: 4px solid #f3f3f3;
border-top: 4px solid #667eea;
border-radius: 50%;
width: 50px;
height: 50px;
animation: spin 1s linear infinite;
margin: 20px auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.info-section {
padding: 30px 40px;
background: #f8f9fa;
margin-top: 20px;
}
.info-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin-top: 20px;
}
.info-card {
background: white;
padding: 20px;
border-radius: 10px;
border-left: 4px solid #667eea;
}
.info-title {
font-weight: 600;
margin-bottom: 10px;
color: #667eea;
}
.info-content {
line-height: 1.6;
color: #6c757d;
}
footer {
padding: 30px;
text-align: center;
background: #343a40;
color: white;
}
footer a {
color: #667eea;
text-decoration: none;
}
footer a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>TurboLoader Benchmark Dashboard</h1>
<p class="subtitle">High-Performance ML Data Loading - Real-Time Performance Analytics</p>
<div class="stats-grid">
<div class="stat-card">
<div class="stat-value" id="peak-throughput">10,146</div>
<div class="stat-label">Peak Throughput (img/s)</div>
</div>
<div class="stat-card">
<div class="stat-value" id="speedup">12x</div>
<div class="stat-label">vs PyTorch Optimized</div>
</div>
<div class="stat-card">
<div class="stat-value" id="bandwidth">52+</div>
<div class="stat-label">Gbps Local I/O</div>
</div>
<div class="stat-card">
<div class="stat-value" id="transforms">19</div>
<div class="stat-label">SIMD Transforms</div>
</div>
</div>
</header>
<div class="controls">
<h2 style="margin-bottom: 20px; color: #495057;">Benchmark Configuration</h2>
<div class="control-grid">
<div class="control-group">
<label for="num-workers">Number of Workers</label>
<input type="number" id="num-workers" value="4" min="1" max="16">
</div>
<div class="control-group">
<label for="batch-size">Batch Size</label>
<input type="number" id="batch-size" value="32" min="1" max="256">
</div>
<div class="control-group">
<label for="dataset-size">Dataset Size (images)</label>
<input type="number" id="dataset-size" value="5000" min="100" max="50000">
</div>
<div class="control-group">
<label for="image-size">Image Size</label>
<select id="image-size">
<option value="224">224x224 (ResNet)</option>
<option value="256" selected>256x256</option>
<option value="384">384x384 (ViT)</option>
<option value="512">512x512</option>
</select>
</div>
</div>
<button onclick="runBenchmark()">Run Benchmark</button>
<button onclick="loadSampleData()" style="background: linear-gradient(135deg, #28a745 0%, #20c997 100%);">Load Sample Results</button>
</div>
<div class="charts">
<div class="chart-container">
<div class="chart-title">Framework Throughput Comparison</div>
<div id="throughput-chart"></div>
</div>
<div class="framework-comparison" id="framework-cards"></div>
<div class="chart-container">
<div class="chart-title">Throughput vs Number of Workers</div>
<div id="workers-chart"></div>
</div>
<div class="chart-container">
<div class="chart-title">Throughput vs Batch Size</div>
<div id="batch-chart"></div>
</div>
<div class="chart-container">
<div class="chart-title">Memory Usage Comparison</div>
<div id="memory-chart"></div>
</div>
<div class="chart-container">
<div class="chart-title">CPU Utilization</div>
<div id="cpu-chart"></div>
</div>
</div>
<div class="info-section">
<h2 style="margin-bottom: 20px; color: #495057;">Key Features</h2>
<div class="info-grid">
<div class="info-card">
<div class="info-title">SIMD Acceleration</div>
<div class="info-content">
19 data augmentation transforms with AVX2/NEON SIMD acceleration for maximum throughput.
Includes AutoAugment policies for ImageNet, CIFAR10, and SVHN.
</div>
</div>
<div class="info-card">
<div class="info-title">Lock-Free Architecture</div>
<div class="info-content">
Custom SPSC (Single Producer Single Consumer) queues with zero-copy design.
No mutex contention for maximum parallelism.
</div>
</div>
<div class="info-card">
<div class="info-title">Multi-Format Support</div>
<div class="info-content">
Images (JPEG, PNG, WebP), video (H.264, HEVC), tabular data (CSV, Parquet).
WebDataset TAR format with remote storage (HTTP, S3, GCS).
</div>
</div>
<div class="info-card">
<div class="info-title">GPU Integration</div>
<div class="info-content">
Direct PyTorch/TensorFlow/JAX tensor conversion. Optional GPU-accelerated
JPEG decoding with nvJPEG for ultra-low latency.
</div>
</div>
</div>
</div>
<footer>
<p>TurboLoader v0.8.1 | C++20 Implementation | MIT License</p>
<p style="margin-top: 10px;">
<a href="https://github.com/arnavjain/turboloader" target="_blank">GitHub Repository</a> |
<a href="https://github.com/arnavjain/turboloader/blob/main/README.md" target="_blank">Documentation</a>
</p>
</footer>
</div>
<script>
// Sample benchmark data
const sampleData = {
frameworks: [
{ name: 'TurboLoader', throughput: 10146, memory: 245, cpu: 85 },
{ name: 'PyTorch Optimized', throughput: 842, memory: 1890, cpu: 92 },
{ name: 'PyTorch Naive', throughput: 215, memory: 2340, cpu: 78 },
{ name: 'TensorFlow', throughput: 7680, memory: 892, cpu: 88 },
{ name: 'FFCV', throughput: 8920, memory: 512, cpu: 90 },
{ name: 'DALI', throughput: 6840, memory: 678, cpu: 87 },
{ name: 'PIL Baseline', throughput: 128, memory: 3200, cpu: 65 },
{ name: 'Torchvision', throughput: 456, memory: 1560, cpu: 72 }
],
workers: {
workers: [1, 2, 4, 8, 16],
turboloader: [3421, 6234, 10146, 12340, 13120],
pytorch: [198, 356, 842, 1120, 1240],
tensorflow: [2145, 4280, 7680, 8920, 9340]
},
batchSize: {
sizes: [8, 16, 32, 64, 128, 256],
turboloader: [8234, 9456, 10146, 10890, 11120, 10980],
pytorch: [456, 678, 842, 920, 945, 890],
tensorflow: [5234, 6789, 7680, 8234, 8456, 8120]
}
};
function loadSampleData() {
updateCharts(sampleData);
updateFrameworkCards(sampleData.frameworks);
}
function updateCharts(data) {
// Throughput comparison bar chart
const throughputTrace = {
x: data.frameworks.map(f => f.name),
y: data.frameworks.map(f => f.throughput),
type: 'bar',
marker: {
color: data.frameworks.map(f =>
f.name === 'TurboLoader' ? '#667eea' : '#e9ecef'
),
line: {
color: data.frameworks.map(f =>
f.name === 'TurboLoader' ? '#764ba2' : '#dee2e6'
),
width: 2
}
},
text: data.frameworks.map(f => f.throughput.toLocaleString() + ' img/s'),
textposition: 'outside',
hovertemplate: '<b>%{x}</b><br>Throughput: %{y:,.0f} img/s<extra></extra>'
};
const throughputLayout = {
xaxis: { title: 'Framework', tickangle: -45 },
yaxis: { title: 'Throughput (images/second)' },
showlegend: false,
margin: { t: 20, b: 100 },
height: 400
};
Plotly.newPlot('throughput-chart', [throughputTrace], throughputLayout, {responsive: true});
// Workers scaling chart
const workersTraces = [
{
x: data.workers.workers,
y: data.workers.turboloader,
name: 'TurboLoader',
type: 'scatter',
mode: 'lines+markers',
line: { color: '#667eea', width: 3 },
marker: { size: 10 }
},
{
x: data.workers.workers,
y: data.workers.pytorch,
name: 'PyTorch Optimized',
type: 'scatter',
mode: 'lines+markers',
line: { color: '#dc3545', width: 3 },
marker: { size: 10 }
},
{
x: data.workers.workers,
y: data.workers.tensorflow,
name: 'TensorFlow',
type: 'scatter',
mode: 'lines+markers',
line: { color: '#ff6f00', width: 3 },
marker: { size: 10 }
}
];
const workersLayout = {
xaxis: { title: 'Number of Workers' },
yaxis: { title: 'Throughput (images/second)' },
hovermode: 'x unified',
margin: { t: 20 },
height: 400
};
Plotly.newPlot('workers-chart', workersTraces, workersLayout, {responsive: true});
// Batch size chart
const batchTraces = [
{
x: data.batchSize.sizes,
y: data.batchSize.turboloader,
name: 'TurboLoader',
type: 'scatter',
mode: 'lines+markers',
line: { color: '#667eea', width: 3 },
marker: { size: 10 }
},
{
x: data.batchSize.sizes,
y: data.batchSize.pytorch,
name: 'PyTorch Optimized',
type: 'scatter',
mode: 'lines+markers',
line: { color: '#dc3545', width: 3 },
marker: { size: 10 }
},
{
x: data.batchSize.sizes,
y: data.batchSize.tensorflow,
name: 'TensorFlow',
type: 'scatter',
mode: 'lines+markers',
line: { color: '#ff6f00', width: 3 },
marker: { size: 10 }
}
];
const batchLayout = {
xaxis: { title: 'Batch Size' },
yaxis: { title: 'Throughput (images/second)' },
hovermode: 'x unified',
margin: { t: 20 },
height: 400
};
Plotly.newPlot('batch-chart', batchTraces, batchLayout, {responsive: true});
// Memory usage chart
const memoryTrace = {
x: data.frameworks.map(f => f.name),
y: data.frameworks.map(f => f.memory),
type: 'bar',
marker: {
color: data.frameworks.map(f =>
f.name === 'TurboLoader' ? '#28a745' : '#ffc107'
)
},
text: data.frameworks.map(f => f.memory + ' MB'),
textposition: 'outside',
hovertemplate: '<b>%{x}</b><br>Memory: %{y} MB<extra></extra>'
};
const memoryLayout = {
xaxis: { title: 'Framework', tickangle: -45 },
yaxis: { title: 'Memory Usage (MB)' },
showlegend: false,
margin: { t: 20, b: 100 },
height: 400
};
Plotly.newPlot('memory-chart', [memoryTrace], memoryLayout, {responsive: true});
// CPU utilization chart
const cpuTrace = {
labels: data.frameworks.map(f => f.name),
values: data.frameworks.map(f => f.cpu),
type: 'pie',
hole: 0.4,
marker: {
colors: ['#667eea', '#dc3545', '#ffc107', '#ff6f00', '#28a745', '#17a2b8', '#6c757d', '#e83e8c']
},
textinfo: 'label+percent',
hovertemplate: '<b>%{label}</b><br>CPU: %{value}%<extra></extra>'
};
const cpuLayout = {
margin: { t: 20 },
height: 400
};
Plotly.newPlot('cpu-chart', [cpuTrace], cpuLayout, {responsive: true});
}
function updateFrameworkCards(frameworks) {
const container = document.getElementById('framework-cards');
const maxThroughput = Math.max(...frameworks.map(f => f.throughput));
container.innerHTML = frameworks
.sort((a, b) => b.throughput - a.throughput)
.map(f => {
const speedup = (f.throughput / frameworks.find(x => x.name === 'PyTorch Optimized').throughput).toFixed(1);
const isWinner = f.throughput === maxThroughput;
return `
<div class="framework-card ${isWinner ? 'winner' : ''}">
<div class="framework-name">${f.name}</div>
<div class="framework-speed">${f.throughput.toLocaleString()}</div>
<div class="framework-speedup">img/s (${speedup}x)</div>
</div>
`;
})
.join('');
}
function runBenchmark() {
const workers = document.getElementById('num-workers').value;
const batchSize = document.getElementById('batch-size').value;
const datasetSize = document.getElementById('dataset-size').value;
const imageSize = document.getElementById('image-size').value;
alert(`Running benchmark with:\n- Workers: ${workers}\n- Batch Size: ${batchSize}\n- Dataset: ${datasetSize} images\n- Image Size: ${imageSize}x${imageSize}\n\nNote: This is a demo. To run real benchmarks, use the Python scripts in the benchmarks/ directory.`);
// Simulate loading
const charts = document.querySelector('.charts');
charts.innerHTML = '<div class="loading"><div class="spinner"></div>Loading benchmark results...</div>';
setTimeout(() => {
charts.innerHTML = `
<div class="chart-container">
<div class="chart-title">Framework Throughput Comparison</div>
<div id="throughput-chart"></div>
</div>
<div class="framework-comparison" id="framework-cards"></div>
<div class="chart-container">
<div class="chart-title">Throughput vs Number of Workers</div>
<div id="workers-chart"></div>
</div>
<div class="chart-container">
<div class="chart-title">Throughput vs Batch Size</div>
<div id="batch-chart"></div>
</div>
<div class="chart-container">
<div class="chart-title">Memory Usage Comparison</div>
<div id="memory-chart"></div>
</div>
<div class="chart-container">
<div class="chart-title">CPU Utilization</div>
<div id="cpu-chart"></div>
</div>
`;
loadSampleData();
}, 1500);
}
// Load sample data on page load
window.addEventListener('load', () => {
loadSampleData();
});
</script>
</body>
</html>