flockml 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deep-profiling-report.html +119 -0
- package/dist/activations.d.ts +13 -0
- package/dist/activations.js +47 -0
- package/dist/break-test.d.ts +1 -0
- package/dist/break-test.js +249 -0
- package/dist/brutal-test.d.ts +1 -0
- package/dist/brutal-test.js +113 -0
- package/dist/client-node.d.ts +48 -0
- package/dist/client-node.js +174 -0
- package/dist/coordinator.d.ts +41 -0
- package/dist/coordinator.js +155 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +13 -0
- package/dist/matrix.d.ts +67 -0
- package/dist/matrix.js +185 -0
- package/dist/micro-benchmark.d.ts +1 -0
- package/dist/micro-benchmark.js +215 -0
- package/dist/network.d.ts +32 -0
- package/dist/network.js +127 -0
- package/dist/privacy.d.ts +17 -0
- package/dist/privacy.js +70 -0
- package/dist/quantization.d.ts +33 -0
- package/dist/quantization.js +92 -0
- package/dist/test.d.ts +1 -0
- package/dist/test.js +58 -0
- package/dist/worker.d.ts +15 -0
- package/dist/worker.js +95 -0
- package/package.json +21 -0
- package/src/activations.ts +45 -0
- package/src/break-test.ts +234 -0
- package/src/brutal-test.ts +103 -0
- package/src/client-node.ts +154 -0
- package/src/coordinator.ts +137 -0
- package/src/index.ts +5 -0
- package/src/messages.d.ts +429 -0
- package/src/messages.js +1173 -0
- package/src/messages.proto +30 -0
- package/src/micro-benchmark.ts +200 -0
- package/src/network.ts +113 -0
- package/src/privacy.ts +39 -0
- package/src/quantization.ts +82 -0
- package/src/test.ts +72 -0
- package/src/worker.ts +95 -0
- package/stress-report.html +190 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>FlockML Brutal Break Test Report</title>
|
|
8
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
9
|
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
|
10
|
+
</head>
|
|
11
|
+
<body class="bg-gray-950 text-gray-100 p-8 font-sans">
|
|
12
|
+
<div class="max-w-6xl mx-auto">
|
|
13
|
+
<h1 class="text-4xl font-bold mb-2 bg-gradient-to-r from-red-500 to-orange-500 bg-clip-text text-transparent">FlockML V2 Brutal Break Test</h1>
|
|
14
|
+
<p class="text-gray-400 mb-8">Pushing the Central Coordinator Server to its absolute limits until architecture failure.</p>
|
|
15
|
+
|
|
16
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 mb-8">
|
|
17
|
+
<div class="bg-gray-900 border border-gray-800 rounded-xl p-6 shadow-2xl">
|
|
18
|
+
<h2 class="text-xl font-semibold mb-4 text-gray-200">Server Latency (FedAvg + Protobuf)</h2>
|
|
19
|
+
<canvas id="latencyChart"></canvas>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="bg-gray-900 border border-gray-800 rounded-xl p-6 shadow-2xl">
|
|
22
|
+
<h2 class="text-xl font-semibold mb-4 text-gray-200">Server Heap Memory Usage</h2>
|
|
23
|
+
<canvas id="memoryChart"></canvas>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div class="bg-gray-900 border border-gray-800 rounded-xl overflow-hidden shadow-2xl">
|
|
28
|
+
<table class="w-full text-left border-collapse">
|
|
29
|
+
<thead>
|
|
30
|
+
<tr class="bg-gray-950 text-gray-400 text-sm uppercase tracking-wider">
|
|
31
|
+
<th class="p-4 border-b border-gray-800">Concurrent Clients</th>
|
|
32
|
+
<th class="p-4 border-b border-gray-800">Total Bandwidth</th>
|
|
33
|
+
<th class="p-4 border-b border-gray-800">Protobuf Decode</th>
|
|
34
|
+
<th class="p-4 border-b border-gray-800">FedAvg Compute</th>
|
|
35
|
+
<th class="p-4 border-b border-gray-800">Total Server Delay</th>
|
|
36
|
+
<th class="p-4 border-b border-gray-800">Heap Memory</th>
|
|
37
|
+
<th class="p-4 border-b border-gray-800">System Status</th>
|
|
38
|
+
</tr>
|
|
39
|
+
</thead>
|
|
40
|
+
<tbody>
|
|
41
|
+
|
|
42
|
+
<tr class="hover:bg-gray-800 transition-colors">
|
|
43
|
+
<td class="p-3 border-b border-gray-800 font-mono text-blue-400">100</td>
|
|
44
|
+
<td class="p-3 border-b border-gray-800">8.89 KB</td>
|
|
45
|
+
<td class="p-3 border-b border-gray-800">1.61 ms</td>
|
|
46
|
+
<td class="p-3 border-b border-gray-800">0.48 ms</td>
|
|
47
|
+
<td class="p-3 border-b border-gray-800 font-bold text-green-400">2.12 ms</td>
|
|
48
|
+
<td class="p-3 border-b border-gray-800">154.28 MB</td>
|
|
49
|
+
<td class="p-3 border-b border-gray-800">Success</td>
|
|
50
|
+
</tr>
|
|
51
|
+
|
|
52
|
+
<tr class="hover:bg-gray-800 transition-colors">
|
|
53
|
+
<td class="p-3 border-b border-gray-800 font-mono text-blue-400">1,000</td>
|
|
54
|
+
<td class="p-3 border-b border-gray-800">88.87 KB</td>
|
|
55
|
+
<td class="p-3 border-b border-gray-800">2.98 ms</td>
|
|
56
|
+
<td class="p-3 border-b border-gray-800">0.68 ms</td>
|
|
57
|
+
<td class="p-3 border-b border-gray-800 font-bold text-green-400">3.71 ms</td>
|
|
58
|
+
<td class="p-3 border-b border-gray-800">160.23 MB</td>
|
|
59
|
+
<td class="p-3 border-b border-gray-800">Success</td>
|
|
60
|
+
</tr>
|
|
61
|
+
|
|
62
|
+
<tr class="hover:bg-gray-800 transition-colors">
|
|
63
|
+
<td class="p-3 border-b border-gray-800 font-mono text-blue-400">5,000</td>
|
|
64
|
+
<td class="p-3 border-b border-gray-800">444.34 KB</td>
|
|
65
|
+
<td class="p-3 border-b border-gray-800">13.05 ms</td>
|
|
66
|
+
<td class="p-3 border-b border-gray-800">8.10 ms</td>
|
|
67
|
+
<td class="p-3 border-b border-gray-800 font-bold text-green-400">21.20 ms</td>
|
|
68
|
+
<td class="p-3 border-b border-gray-800">189.19 MB</td>
|
|
69
|
+
<td class="p-3 border-b border-gray-800">Success</td>
|
|
70
|
+
</tr>
|
|
71
|
+
|
|
72
|
+
<tr class="hover:bg-gray-800 transition-colors">
|
|
73
|
+
<td class="p-3 border-b border-gray-800 font-mono text-blue-400">10,000</td>
|
|
74
|
+
<td class="p-3 border-b border-gray-800">888.67 KB</td>
|
|
75
|
+
<td class="p-3 border-b border-gray-800">25.78 ms</td>
|
|
76
|
+
<td class="p-3 border-b border-gray-800">16.06 ms</td>
|
|
77
|
+
<td class="p-3 border-b border-gray-800 font-bold text-green-400">41.90 ms</td>
|
|
78
|
+
<td class="p-3 border-b border-gray-800">185.04 MB</td>
|
|
79
|
+
<td class="p-3 border-b border-gray-800">Success</td>
|
|
80
|
+
</tr>
|
|
81
|
+
|
|
82
|
+
<tr class="hover:bg-gray-800 transition-colors">
|
|
83
|
+
<td class="p-3 border-b border-gray-800 font-mono text-blue-400">50,000</td>
|
|
84
|
+
<td class="p-3 border-b border-gray-800">4443.36 KB</td>
|
|
85
|
+
<td class="p-3 border-b border-gray-800">143.71 ms</td>
|
|
86
|
+
<td class="p-3 border-b border-gray-800">29.40 ms</td>
|
|
87
|
+
<td class="p-3 border-b border-gray-800 font-bold text-green-400">173.18 ms</td>
|
|
88
|
+
<td class="p-3 border-b border-gray-800">231.64 MB</td>
|
|
89
|
+
<td class="p-3 border-b border-gray-800">Success</td>
|
|
90
|
+
</tr>
|
|
91
|
+
|
|
92
|
+
<tr class="hover:bg-gray-800 transition-colors">
|
|
93
|
+
<td class="p-3 border-b border-gray-800 font-mono text-blue-400">100,000</td>
|
|
94
|
+
<td class="p-3 border-b border-gray-800">8886.72 KB</td>
|
|
95
|
+
<td class="p-3 border-b border-gray-800">305.70 ms</td>
|
|
96
|
+
<td class="p-3 border-b border-gray-800">60.12 ms</td>
|
|
97
|
+
<td class="p-3 border-b border-gray-800 font-bold text-green-400">365.91 ms</td>
|
|
98
|
+
<td class="p-3 border-b border-gray-800">365.91 MB</td>
|
|
99
|
+
<td class="p-3 border-b border-gray-800">Success</td>
|
|
100
|
+
</tr>
|
|
101
|
+
|
|
102
|
+
<tr class="hover:bg-gray-800 transition-colors">
|
|
103
|
+
<td class="p-3 border-b border-gray-800 font-mono text-blue-400">250,000</td>
|
|
104
|
+
<td class="p-3 border-b border-gray-800">22216.80 KB</td>
|
|
105
|
+
<td class="p-3 border-b border-gray-800">962.69 ms</td>
|
|
106
|
+
<td class="p-3 border-b border-gray-800">147.59 ms</td>
|
|
107
|
+
<td class="p-3 border-b border-gray-800 font-bold text-green-400">1110.43 ms</td>
|
|
108
|
+
<td class="p-3 border-b border-gray-800">514.95 MB</td>
|
|
109
|
+
<td class="p-3 border-b border-gray-800">Success</td>
|
|
110
|
+
</tr>
|
|
111
|
+
|
|
112
|
+
<tr class="hover:bg-gray-800 transition-colors">
|
|
113
|
+
<td class="p-3 border-b border-gray-800 font-mono text-blue-400">500,000</td>
|
|
114
|
+
<td class="p-3 border-b border-gray-800">44433.59 KB</td>
|
|
115
|
+
<td class="p-3 border-b border-gray-800">1757.62 ms</td>
|
|
116
|
+
<td class="p-3 border-b border-gray-800">452.53 ms</td>
|
|
117
|
+
<td class="p-3 border-b border-gray-800 font-bold text-yellow-400">2210.48 ms</td>
|
|
118
|
+
<td class="p-3 border-b border-gray-800">1171.08 MB</td>
|
|
119
|
+
<td class="p-3 border-b border-gray-800">Success</td>
|
|
120
|
+
</tr>
|
|
121
|
+
|
|
122
|
+
<tr class="bg-red-900/50 text-red-200">
|
|
123
|
+
<td class="p-3 border-b border-gray-800 font-mono text-blue-400">1,000,000</td>
|
|
124
|
+
<td class="p-3 border-b border-gray-800">88867.19 KB</td>
|
|
125
|
+
<td class="p-3 border-b border-gray-800">5531.10 ms</td>
|
|
126
|
+
<td class="p-3 border-b border-gray-800">1242.68 ms</td>
|
|
127
|
+
<td class="p-3 border-b border-gray-800 font-bold text-yellow-400">6774.17 ms</td>
|
|
128
|
+
<td class="p-3 border-b border-gray-800">1484.56 MB</td>
|
|
129
|
+
<td class="p-3 border-b border-gray-800">Broken: Latency Timeout (>5s)</td>
|
|
130
|
+
</tr>
|
|
131
|
+
|
|
132
|
+
</tbody>
|
|
133
|
+
</table>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<div class="mt-8 p-6 bg-gray-900 border-l-4 border-blue-500 rounded-r-xl">
|
|
137
|
+
<h3 class="text-lg font-bold text-blue-400 mb-2">Architectural Conclusion</h3>
|
|
138
|
+
<p class="text-gray-300">
|
|
139
|
+
This test simulates extreme real-world thundering herd conditions. The breaking point indicates where the single-threaded Node.js Coordinator reaches hardware limits. To scale beyond the breaking point, horizontal scaling (Load Balancers + Redis pub/sub) or migrating the backend math to PyTorch (C++) is required.
|
|
140
|
+
</p>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<script>
|
|
145
|
+
const data = [{"scale":100,"payloadSizeKB":8.88671875,"receiveTime":1.6131659999999783,"aggTime":0.478458000000046,"totalTime":2.119957999999997,"memBefore":153.44232940673828,"memAfter":154.28350830078125,"status":"Success"},{"scale":1000,"payloadSizeKB":88.8671875,"receiveTime":2.9810830000000124,"aggTime":0.679416999999944,"totalTime":3.7100419999999303,"memBefore":154.6480484008789,"memAfter":160.2291488647461,"status":"Success"},{"scale":5000,"payloadSizeKB":444.3359375,"receiveTime":13.046290999999997,"aggTime":8.103542000000061,"totalTime":21.204624999999965,"memBefore":161.44041442871094,"memAfter":189.18659210205078,"status":"Success"},{"scale":10000,"payloadSizeKB":888.671875,"receiveTime":25.78058299999998,"aggTime":16.05779199999995,"totalTime":41.904083000000014,"memBefore":191.42191314697266,"memAfter":185.03966522216797,"status":"Success"},{"scale":50000,"payloadSizeKB":4443.359375,"receiveTime":143.70729199999994,"aggTime":29.396875000000136,"totalTime":173.17645800000003,"memBefore":195.8952865600586,"memAfter":231.64044189453125,"status":"Success"},{"scale":100000,"payloadSizeKB":8886.71875,"receiveTime":305.70008299999995,"aggTime":60.120166000000154,"totalTime":365.906708,"memBefore":253.44234466552734,"memAfter":365.9073715209961,"status":"Success"},{"scale":250000,"payloadSizeKB":22216.796875,"receiveTime":962.6942919999999,"aggTime":147.58687499999996,"totalTime":1110.42775,"memBefore":389.22953033447266,"memAfter":514.9524993896484,"status":"Success"},{"scale":500000,"payloadSizeKB":44433.59375,"receiveTime":1757.616375,"aggTime":452.52641700000004,"totalTime":2210.4800840000003,"memBefore":575.1996383666992,"memAfter":1171.0813369750977,"status":"Success"},{"scale":1000000,"payloadSizeKB":88867.1875,"receiveTime":5531.097334,"aggTime":1242.6770410000008,"totalTime":6774.172875,"memBefore":343.72398376464844,"memAfter":1484.5562591552734,"status":"Broken: Latency Timeout (>5s)"}];
|
|
146
|
+
const labels = data.map(d => d.scale.toLocaleString());
|
|
147
|
+
|
|
148
|
+
// Latency Chart
|
|
149
|
+
new Chart(document.getElementById('latencyChart'), {
|
|
150
|
+
type: 'line',
|
|
151
|
+
data: {
|
|
152
|
+
labels,
|
|
153
|
+
datasets: [{
|
|
154
|
+
label: 'Total Delay (ms)',
|
|
155
|
+
data: data.map(d => d.totalTime),
|
|
156
|
+
borderColor: '#3b82f6',
|
|
157
|
+
backgroundColor: 'rgba(59, 130, 246, 0.1)',
|
|
158
|
+
borderWidth: 2,
|
|
159
|
+
fill: true,
|
|
160
|
+
tension: 0.4
|
|
161
|
+
}]
|
|
162
|
+
},
|
|
163
|
+
options: {
|
|
164
|
+
responsive: true,
|
|
165
|
+
scales: { y: { beginAtZero: true, grid: { color: '#1f2937' } }, x: { grid: { color: '#1f2937' } } },
|
|
166
|
+
plugins: { legend: { display: false } }
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// Memory Chart
|
|
171
|
+
new Chart(document.getElementById('memoryChart'), {
|
|
172
|
+
type: 'bar',
|
|
173
|
+
data: {
|
|
174
|
+
labels,
|
|
175
|
+
datasets: [{
|
|
176
|
+
label: 'Heap Usage (MB)',
|
|
177
|
+
data: data.map(d => d.memAfter),
|
|
178
|
+
backgroundColor: '#f97316',
|
|
179
|
+
borderRadius: 4
|
|
180
|
+
}]
|
|
181
|
+
},
|
|
182
|
+
options: {
|
|
183
|
+
responsive: true,
|
|
184
|
+
scales: { y: { beginAtZero: true, grid: { color: '#1f2937' } }, x: { grid: { color: '#1f2937' } } },
|
|
185
|
+
plugins: { legend: { display: false } }
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
</script>
|
|
189
|
+
</body>
|
|
190
|
+
</html>
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2022",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": false,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*"]
|
|
14
|
+
}
|