@camstack/types 1.2.398 → 1.2.400
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/dist/capabilities/pipeline-orchestrator.cap.d.ts +0 -16
- package/dist/index.js +225 -96
- package/dist/index.mjs +222 -97
- package/dist/pipeline/auto-tune/detector-performance.d.ts +2 -1
- package/dist/pipeline/auto-tune/plan-schemas.d.ts +0 -28
- package/dist/pipeline/auto-tune/recommend.d.ts +9 -1
- package/dist/pipeline/load-balancing/capacity-shares.d.ts +27 -0
- package/dist/pipeline/load-balancing/share-election.d.ts +7 -0
- package/dist/pipeline/node-benchmark/results.d.ts +16 -2
- package/package.json +1 -1
|
@@ -1401,8 +1401,6 @@ export declare const pipelineOrchestratorCapability: {
|
|
|
1401
1401
|
modelId: z.ZodString;
|
|
1402
1402
|
}, z.core.$strip>, z.ZodObject<{
|
|
1403
1403
|
kind: z.ZodLiteral<"cpu-device">;
|
|
1404
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1405
|
-
kind: z.ZodLiteral<"coral-untouched">;
|
|
1406
1404
|
}, z.core.$strip>, z.ZodObject<{
|
|
1407
1405
|
kind: z.ZodLiteral<"device-disabled">;
|
|
1408
1406
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1459,8 +1457,6 @@ export declare const pipelineOrchestratorCapability: {
|
|
|
1459
1457
|
modelId: z.ZodString;
|
|
1460
1458
|
}, z.core.$strip>, z.ZodObject<{
|
|
1461
1459
|
kind: z.ZodLiteral<"cpu-device">;
|
|
1462
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1463
|
-
kind: z.ZodLiteral<"coral-untouched">;
|
|
1464
1460
|
}, z.core.$strip>, z.ZodObject<{
|
|
1465
1461
|
kind: z.ZodLiteral<"device-disabled">;
|
|
1466
1462
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1531,10 +1527,6 @@ export declare const pipelineOrchestratorCapability: {
|
|
|
1531
1527
|
}, z.core.$strip>, z.ZodObject<{
|
|
1532
1528
|
kind: z.ZodLiteral<"detector-store-unreadable">;
|
|
1533
1529
|
error: z.ZodString;
|
|
1534
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1535
|
-
kind: z.ZodLiteral<"coral-enabled">;
|
|
1536
|
-
nodeId: z.ZodString;
|
|
1537
|
-
deviceKey: z.ZodString;
|
|
1538
1530
|
}, z.core.$strip>, z.ZodObject<{
|
|
1539
1531
|
kind: z.ZodLiteral<"custom-pin-kept">;
|
|
1540
1532
|
nodeId: z.ZodString;
|
|
@@ -1660,8 +1652,6 @@ export declare const pipelineOrchestratorCapability: {
|
|
|
1660
1652
|
modelId: z.ZodString;
|
|
1661
1653
|
}, z.core.$strip>, z.ZodObject<{
|
|
1662
1654
|
kind: z.ZodLiteral<"cpu-device">;
|
|
1663
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1664
|
-
kind: z.ZodLiteral<"coral-untouched">;
|
|
1665
1655
|
}, z.core.$strip>, z.ZodObject<{
|
|
1666
1656
|
kind: z.ZodLiteral<"device-disabled">;
|
|
1667
1657
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1718,8 +1708,6 @@ export declare const pipelineOrchestratorCapability: {
|
|
|
1718
1708
|
modelId: z.ZodString;
|
|
1719
1709
|
}, z.core.$strip>, z.ZodObject<{
|
|
1720
1710
|
kind: z.ZodLiteral<"cpu-device">;
|
|
1721
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1722
|
-
kind: z.ZodLiteral<"coral-untouched">;
|
|
1723
1711
|
}, z.core.$strip>, z.ZodObject<{
|
|
1724
1712
|
kind: z.ZodLiteral<"device-disabled">;
|
|
1725
1713
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1790,10 +1778,6 @@ export declare const pipelineOrchestratorCapability: {
|
|
|
1790
1778
|
}, z.core.$strip>, z.ZodObject<{
|
|
1791
1779
|
kind: z.ZodLiteral<"detector-store-unreadable">;
|
|
1792
1780
|
error: z.ZodString;
|
|
1793
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1794
|
-
kind: z.ZodLiteral<"coral-enabled">;
|
|
1795
|
-
nodeId: z.ZodString;
|
|
1796
|
-
deviceKey: z.ZodString;
|
|
1797
1781
|
}, z.core.$strip>, z.ZodObject<{
|
|
1798
1782
|
kind: z.ZodLiteral<"custom-pin-kept">;
|
|
1799
1783
|
nodeId: z.ZodString;
|
package/dist/index.js
CHANGED
|
@@ -51332,7 +51332,6 @@ var RecommendationReasonSchema = zod.z.discriminatedUnion("kind", [
|
|
|
51332
51332
|
modelId: zod.z.string()
|
|
51333
51333
|
}),
|
|
51334
51334
|
zod.z.object({ kind: zod.z.literal("cpu-device") }),
|
|
51335
|
-
zod.z.object({ kind: zod.z.literal("coral-untouched") }),
|
|
51336
51335
|
zod.z.object({ kind: zod.z.literal("device-disabled") }),
|
|
51337
51336
|
zod.z.object({ kind: zod.z.literal("device-unavailable") }),
|
|
51338
51337
|
zod.z.object({ kind: zod.z.literal("node-offline") }),
|
|
@@ -51430,11 +51429,6 @@ var AutoTuneWarningSchema = zod.z.discriminatedUnion("kind", [
|
|
|
51430
51429
|
kind: zod.z.literal("detector-store-unreadable"),
|
|
51431
51430
|
error: zod.z.string()
|
|
51432
51431
|
}),
|
|
51433
|
-
zod.z.object({
|
|
51434
|
-
kind: zod.z.literal("coral-enabled"),
|
|
51435
|
-
nodeId: zod.z.string(),
|
|
51436
|
-
deviceKey: zod.z.string()
|
|
51437
|
-
}),
|
|
51438
51432
|
zod.z.object({
|
|
51439
51433
|
kind: zod.z.literal("custom-pin-kept"),
|
|
51440
51434
|
nodeId: zod.z.string(),
|
|
@@ -100715,7 +100709,12 @@ var DETECTOR_PERF = {
|
|
|
100715
100709
|
fps: 19,
|
|
100716
100710
|
measured: true
|
|
100717
100711
|
}
|
|
100718
|
-
}
|
|
100712
|
+
},
|
|
100713
|
+
coral: { "yolov9s-320-edgetpu": {
|
|
100714
|
+
p50Ms: 32,
|
|
100715
|
+
fps: 31,
|
|
100716
|
+
measured: false
|
|
100717
|
+
} }
|
|
100719
100718
|
},
|
|
100720
100719
|
"intel-n-series": {
|
|
100721
100720
|
"intel-igpu": {
|
|
@@ -100841,7 +100840,12 @@ var DETECTOR_PERF = {
|
|
|
100841
100840
|
fps: 3,
|
|
100842
100841
|
measured: true
|
|
100843
100842
|
}
|
|
100844
|
-
}
|
|
100843
|
+
},
|
|
100844
|
+
coral: { "yolov9s-320-edgetpu": {
|
|
100845
|
+
p50Ms: 32,
|
|
100846
|
+
fps: 31,
|
|
100847
|
+
measured: false
|
|
100848
|
+
} }
|
|
100845
100849
|
},
|
|
100846
100850
|
"amd-phoenix": {
|
|
100847
100851
|
"x86-cpu": {
|
|
@@ -100908,96 +100912,120 @@ var DETECTOR_PERF = {
|
|
|
100908
100912
|
},
|
|
100909
100913
|
"amd-igpu": {
|
|
100910
100914
|
"yolov9t-320": {
|
|
100911
|
-
p50Ms:
|
|
100912
|
-
fps:
|
|
100915
|
+
p50Ms: 40,
|
|
100916
|
+
fps: 25,
|
|
100913
100917
|
measured: true
|
|
100914
100918
|
},
|
|
100915
100919
|
"yolov9t-640": {
|
|
100916
|
-
p50Ms:
|
|
100917
|
-
fps:
|
|
100920
|
+
p50Ms: 89,
|
|
100921
|
+
fps: 11,
|
|
100918
100922
|
measured: true
|
|
100919
100923
|
},
|
|
100920
100924
|
"yolov9s-320": {
|
|
100921
|
-
p50Ms:
|
|
100922
|
-
fps:
|
|
100925
|
+
p50Ms: 65,
|
|
100926
|
+
fps: 15,
|
|
100923
100927
|
measured: true
|
|
100924
100928
|
},
|
|
100925
100929
|
"yolov9s-640": {
|
|
100926
|
-
p50Ms:
|
|
100927
|
-
fps:
|
|
100930
|
+
p50Ms: 125,
|
|
100931
|
+
fps: 8,
|
|
100928
100932
|
measured: true
|
|
100929
100933
|
},
|
|
100930
100934
|
"yolov9m-320": {
|
|
100931
|
-
p50Ms:
|
|
100932
|
-
fps:
|
|
100935
|
+
p50Ms: 85,
|
|
100936
|
+
fps: 12,
|
|
100937
|
+
measured: true
|
|
100938
|
+
},
|
|
100939
|
+
"yolov9m-640": {
|
|
100940
|
+
p50Ms: 228,
|
|
100941
|
+
fps: 4,
|
|
100933
100942
|
measured: true
|
|
100934
100943
|
}
|
|
100935
|
-
}
|
|
100936
|
-
},
|
|
100937
|
-
"apple-m-pro": { "apple-ane": {
|
|
100938
|
-
"yolov9t-320": {
|
|
100939
|
-
p50Ms: 1.1,
|
|
100940
|
-
fps: 952,
|
|
100941
|
-
measured: true
|
|
100942
|
-
},
|
|
100943
|
-
"yolov9t-640": {
|
|
100944
|
-
p50Ms: 3,
|
|
100945
|
-
fps: 333,
|
|
100946
|
-
measured: true
|
|
100947
|
-
},
|
|
100948
|
-
"yolov9s-320": {
|
|
100949
|
-
p50Ms: 1.5,
|
|
100950
|
-
fps: 667,
|
|
100951
|
-
measured: true
|
|
100952
100944
|
},
|
|
100953
|
-
"yolov9s-
|
|
100954
|
-
p50Ms:
|
|
100955
|
-
fps:
|
|
100956
|
-
measured: true
|
|
100957
|
-
},
|
|
100958
|
-
"yolov9m-320": {
|
|
100959
|
-
p50Ms: 3.2,
|
|
100960
|
-
fps: 312,
|
|
100945
|
+
coral: { "yolov9s-320-edgetpu": {
|
|
100946
|
+
p50Ms: 32,
|
|
100947
|
+
fps: 31,
|
|
100961
100948
|
measured: true
|
|
100949
|
+
} }
|
|
100950
|
+
},
|
|
100951
|
+
"apple-m-pro": {
|
|
100952
|
+
"apple-ane": {
|
|
100953
|
+
"yolov9t-320": {
|
|
100954
|
+
p50Ms: 1.1,
|
|
100955
|
+
fps: 952,
|
|
100956
|
+
measured: true
|
|
100957
|
+
},
|
|
100958
|
+
"yolov9t-640": {
|
|
100959
|
+
p50Ms: 3,
|
|
100960
|
+
fps: 333,
|
|
100961
|
+
measured: true
|
|
100962
|
+
},
|
|
100963
|
+
"yolov9s-320": {
|
|
100964
|
+
p50Ms: 1.5,
|
|
100965
|
+
fps: 667,
|
|
100966
|
+
measured: true
|
|
100967
|
+
},
|
|
100968
|
+
"yolov9s-640": {
|
|
100969
|
+
p50Ms: 5.1,
|
|
100970
|
+
fps: 196,
|
|
100971
|
+
measured: true
|
|
100972
|
+
},
|
|
100973
|
+
"yolov9m-320": {
|
|
100974
|
+
p50Ms: 3.2,
|
|
100975
|
+
fps: 312,
|
|
100976
|
+
measured: true
|
|
100977
|
+
},
|
|
100978
|
+
"yolov9m-640": {
|
|
100979
|
+
p50Ms: 10.2,
|
|
100980
|
+
fps: 98,
|
|
100981
|
+
measured: true
|
|
100982
|
+
}
|
|
100962
100983
|
},
|
|
100963
|
-
"
|
|
100964
|
-
p50Ms:
|
|
100965
|
-
fps:
|
|
100966
|
-
measured: true
|
|
100967
|
-
}
|
|
100968
|
-
} },
|
|
100969
|
-
"apple-m-base": { "apple-ane": {
|
|
100970
|
-
"yolov9t-320": {
|
|
100971
|
-
p50Ms: 1.32,
|
|
100972
|
-
fps: 758,
|
|
100984
|
+
coral: { "yolov9s-320-edgetpu": {
|
|
100985
|
+
p50Ms: 32,
|
|
100986
|
+
fps: 31,
|
|
100973
100987
|
measured: false
|
|
100988
|
+
} }
|
|
100989
|
+
},
|
|
100990
|
+
"apple-m-base": {
|
|
100991
|
+
"apple-ane": {
|
|
100992
|
+
"yolov9t-320": {
|
|
100993
|
+
p50Ms: 1.32,
|
|
100994
|
+
fps: 758,
|
|
100995
|
+
measured: false
|
|
100996
|
+
},
|
|
100997
|
+
"yolov9t-640": {
|
|
100998
|
+
p50Ms: 3.45,
|
|
100999
|
+
fps: 290,
|
|
101000
|
+
measured: true
|
|
101001
|
+
},
|
|
101002
|
+
"yolov9s-320": {
|
|
101003
|
+
p50Ms: 1.8,
|
|
101004
|
+
fps: 556,
|
|
101005
|
+
measured: false
|
|
101006
|
+
},
|
|
101007
|
+
"yolov9s-640": {
|
|
101008
|
+
p50Ms: 5.46,
|
|
101009
|
+
fps: 183,
|
|
101010
|
+
measured: true
|
|
101011
|
+
},
|
|
101012
|
+
"yolov9m-320": {
|
|
101013
|
+
p50Ms: 3.79,
|
|
101014
|
+
fps: 264,
|
|
101015
|
+
measured: true
|
|
101016
|
+
},
|
|
101017
|
+
"yolov9m-640": {
|
|
101018
|
+
p50Ms: 10.34,
|
|
101019
|
+
fps: 97,
|
|
101020
|
+
measured: true
|
|
101021
|
+
}
|
|
100974
101022
|
},
|
|
100975
|
-
"
|
|
100976
|
-
p50Ms:
|
|
100977
|
-
fps:
|
|
100978
|
-
measured: true
|
|
100979
|
-
},
|
|
100980
|
-
"yolov9s-320": {
|
|
100981
|
-
p50Ms: 1.8,
|
|
100982
|
-
fps: 556,
|
|
101023
|
+
coral: { "yolov9s-320-edgetpu": {
|
|
101024
|
+
p50Ms: 32,
|
|
101025
|
+
fps: 31,
|
|
100983
101026
|
measured: false
|
|
100984
|
-
}
|
|
100985
|
-
|
|
100986
|
-
p50Ms: 5.46,
|
|
100987
|
-
fps: 183,
|
|
100988
|
-
measured: true
|
|
100989
|
-
},
|
|
100990
|
-
"yolov9m-320": {
|
|
100991
|
-
p50Ms: 3.79,
|
|
100992
|
-
fps: 264,
|
|
100993
|
-
measured: true
|
|
100994
|
-
},
|
|
100995
|
-
"yolov9m-640": {
|
|
100996
|
-
p50Ms: 10.34,
|
|
100997
|
-
fps: 97,
|
|
100998
|
-
measured: true
|
|
100999
|
-
}
|
|
101000
|
-
} }
|
|
101027
|
+
} }
|
|
101028
|
+
}
|
|
101001
101029
|
};
|
|
101002
101030
|
var DETECTOR_ACCURACY = {
|
|
101003
101031
|
"yolov9m-320": {
|
|
@@ -101053,6 +101081,11 @@ var DETECTOR_ACCURACY = {
|
|
|
101053
101081
|
//#region src/pipeline/auto-tune/recommend.ts
|
|
101054
101082
|
/** The family the cluster runs. */
|
|
101055
101083
|
var AUTO_TUNE_FAMILY = "yolov9";
|
|
101084
|
+
/**
|
|
101085
|
+
* The model a Coral runs by default (D908) and the only one Auto tune sizes it
|
|
101086
|
+
* at (D912). Auto tune never enables a device; it sizes the enabled ones.
|
|
101087
|
+
*/
|
|
101088
|
+
var CORAL_DEFAULT_MODEL_ID = "yolov9s-320-edgetpu";
|
|
101056
101089
|
/** Recall within this of the best counts as a tie — the faster one wins. */
|
|
101057
101090
|
var RECALL_TIE = .02;
|
|
101058
101091
|
/** Default share of an accelerator's throughput kept free. */
|
|
@@ -101212,12 +101245,9 @@ function recommendNode(input) {
|
|
|
101212
101245
|
const devices = node.devices.toSorted((a, b) => a.key.localeCompare(b.key));
|
|
101213
101246
|
const contexts = /* @__PURE__ */ new Map();
|
|
101214
101247
|
const early = /* @__PURE__ */ new Map();
|
|
101248
|
+
const corals = [];
|
|
101215
101249
|
for (const device of devices) {
|
|
101216
101250
|
const accelerator = acceleratorKindOf(device.key, hardware);
|
|
101217
|
-
if (accelerator === "coral") {
|
|
101218
|
-
early.set(device.key, device.enabled ? [{ kind: "coral-untouched" }] : []);
|
|
101219
|
-
continue;
|
|
101220
|
-
}
|
|
101221
101251
|
if (!device.enabled) {
|
|
101222
101252
|
early.set(device.key, [{ kind: "device-disabled" }]);
|
|
101223
101253
|
continue;
|
|
@@ -101226,6 +101256,23 @@ function recommendNode(input) {
|
|
|
101226
101256
|
early.set(device.key, [{ kind: "device-unavailable" }]);
|
|
101227
101257
|
continue;
|
|
101228
101258
|
}
|
|
101259
|
+
if (accelerator === "coral") {
|
|
101260
|
+
const column = overlayMeasured(classTable.coral, measured[device.key]);
|
|
101261
|
+
const builds = node.formatsByModel["yolov9s-320-edgetpu"] ?? [];
|
|
101262
|
+
if (column?.["yolov9s-320-edgetpu"] === void 0 || !builds.includes(device.format)) {
|
|
101263
|
+
early.set(device.key, [{
|
|
101264
|
+
kind: "no-family-build",
|
|
101265
|
+
format: device.format
|
|
101266
|
+
}]);
|
|
101267
|
+
continue;
|
|
101268
|
+
}
|
|
101269
|
+
corals.push({
|
|
101270
|
+
device,
|
|
101271
|
+
accelerator,
|
|
101272
|
+
column
|
|
101273
|
+
});
|
|
101274
|
+
continue;
|
|
101275
|
+
}
|
|
101229
101276
|
const column = accelerator === null ? void 0 : overlayMeasured(classTable[accelerator], measured[device.key]);
|
|
101230
101277
|
if (accelerator === null || column === void 0) {
|
|
101231
101278
|
early.set(device.key, [{
|
|
@@ -101276,6 +101323,12 @@ function recommendNode(input) {
|
|
|
101276
101323
|
kind: "no-family-build",
|
|
101277
101324
|
format: ctx.device.format
|
|
101278
101325
|
}]);
|
|
101326
|
+
for (const ctx of corals) {
|
|
101327
|
+
const choice = choiceOn(ctx, CORAL_DEFAULT_MODEL_ID, sizing);
|
|
101328
|
+
if (choice === null) continue;
|
|
101329
|
+
chosenByKey.set(ctx.device.key, choice);
|
|
101330
|
+
reasonsByKey.set(ctx.device.key, deviceReasonsFor(choice, sizing));
|
|
101331
|
+
}
|
|
101279
101332
|
for (const ctx of cpus) {
|
|
101280
101333
|
const pick = pickForGroup([ctx], node.formatsByModel, sizing);
|
|
101281
101334
|
const choice = pick === null ? null : choiceOn(ctx, pick.modelId, sizing);
|
|
@@ -101326,10 +101379,11 @@ function spareOf(c) {
|
|
|
101326
101379
|
function electByShare(candidates) {
|
|
101327
101380
|
if (candidates.length === 0) return { kind: "none" };
|
|
101328
101381
|
const shareSum = candidates.reduce((s, c) => s + Math.max(c.share, 0), 0);
|
|
101329
|
-
const
|
|
101382
|
+
const loadOf = (c) => Math.max(c.running, 0) + Math.max(c.recent ?? 0, 0);
|
|
101383
|
+
const running = candidates.reduce((s, c) => s + loadOf(c), 0);
|
|
101330
101384
|
const scored = candidates.map((candidate) => ({
|
|
101331
101385
|
candidate,
|
|
101332
|
-
deficit: (shareSum > 0 ? Math.max(candidate.share, 0) / shareSum : 1 / candidates.length) * (running + 1) - candidate
|
|
101386
|
+
deficit: (shareSum > 0 ? Math.max(candidate.share, 0) / shareSum : 1 / candidates.length) * (running + 1) - loadOf(candidate)
|
|
101333
101387
|
})).toSorted(byDeficit);
|
|
101334
101388
|
const turn = scored[0].candidate;
|
|
101335
101389
|
if (!turn.capped && !turn.saturated) return {
|
|
@@ -101441,6 +101495,39 @@ function resolveEffectiveShares(input) {
|
|
|
101441
101495
|
* every enabled device it would be sized on is sized from `hardware`
|
|
101442
101496
|
* instead, and the answer says so per node — never a silent mix.
|
|
101443
101497
|
*/
|
|
101498
|
+
/**
|
|
101499
|
+
* The measured capacity of `deviceKey` for the model it runs NOW, or
|
|
101500
|
+
* undefined. A cell measured for another model says nothing about this one
|
|
101501
|
+
* (a failed load of a heavier build is not this build's capacity), and a cell
|
|
101502
|
+
* that names no model cannot be matched. The ONE predicate behind both the
|
|
101503
|
+
* automatic shares and the automatic benchmark's "has results".
|
|
101504
|
+
*/
|
|
101505
|
+
function capacityForModel(node, deviceKey, modelId) {
|
|
101506
|
+
if (node === void 0 || modelId === null) return void 0;
|
|
101507
|
+
return node.devices.filter((d) => d.deviceKey === deviceKey && d.modelId === modelId).toSorted((a, b) => b.measuredAtMs - a.measuredAtMs)[0];
|
|
101508
|
+
}
|
|
101509
|
+
/**
|
|
101510
|
+
* Every measured (device × model) cell that no device runs now — what
|
|
101511
|
+
* {@link capacityForModel} skips, so the caller can say so once.
|
|
101512
|
+
*/
|
|
101513
|
+
function foreignCapacityCells(recommendations, measured) {
|
|
101514
|
+
const out = [];
|
|
101515
|
+
for (const rec of recommendations) {
|
|
101516
|
+
const node = measured.get(rec.nodeId);
|
|
101517
|
+
if (node === void 0) continue;
|
|
101518
|
+
for (const cell of node.devices) {
|
|
101519
|
+
const runs = rec.devices.find((d) => d.deviceKey === cell.deviceKey)?.chosen?.modelId ?? null;
|
|
101520
|
+
if (cell.modelId === null || cell.modelId === runs) continue;
|
|
101521
|
+
out.push({
|
|
101522
|
+
nodeId: rec.nodeId,
|
|
101523
|
+
deviceKey: cell.deviceKey,
|
|
101524
|
+
measuredModelId: cell.modelId,
|
|
101525
|
+
runsModelId: runs
|
|
101526
|
+
});
|
|
101527
|
+
}
|
|
101528
|
+
}
|
|
101529
|
+
return out;
|
|
101530
|
+
}
|
|
101444
101531
|
/** A source that has no results — the benchmark store before it exists. */
|
|
101445
101532
|
var NO_MEASURED_CAPACITY = { readMeasuredCapacity: async () => /* @__PURE__ */ new Map() };
|
|
101446
101533
|
/** Integer shares summing to 100 (largest remainder); ties broken by key. */
|
|
@@ -101494,7 +101581,11 @@ function sizeNode(rec, input) {
|
|
|
101494
101581
|
if (input.source === "hardware") return fromHardware(null);
|
|
101495
101582
|
if (!rec.reachable) return fromHardware(null);
|
|
101496
101583
|
const results = input.measured.get(rec.nodeId);
|
|
101497
|
-
const byKey = new Map(
|
|
101584
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
101585
|
+
for (const d of rec.devices) {
|
|
101586
|
+
const row = capacityForModel(results, d.deviceKey, d.chosen?.modelId ?? null);
|
|
101587
|
+
if (row !== void 0) byKey.set(d.deviceKey, row);
|
|
101588
|
+
}
|
|
101498
101589
|
const usable = rec.devices.filter((d) => d.enabled && d.available);
|
|
101499
101590
|
const mustCover = rec.devices.filter((d) => d.enabled && d.available && d.chosen !== null);
|
|
101500
101591
|
const covered = usable.filter((d) => byKey.has(d.deviceKey));
|
|
@@ -101748,16 +101839,34 @@ function measuredDetectorCells(rows, nodeId, ctx) {
|
|
|
101748
101839
|
return out;
|
|
101749
101840
|
}
|
|
101750
101841
|
/**
|
|
101751
|
-
*
|
|
101752
|
-
*
|
|
101842
|
+
* Parallel sessions a `device`-phase cell stands for.
|
|
101843
|
+
*
|
|
101844
|
+
* Both numbers are "streams at the camera rate the hardware carried inside
|
|
101845
|
+
* the frame interval" (`kMax` for the detector alone, `maxSessions` for the
|
|
101846
|
+
* detector plus its enrichment steps) and the benchmark page already shows
|
|
101847
|
+
* `kMax` as "streams", so the unit is the same and the conversion is the
|
|
101848
|
+
* identity. It is an UPPER bound for a session that also runs enrichment —
|
|
101849
|
+
* which is why a `pipeline` cell for the same model always wins over it.
|
|
101850
|
+
*/
|
|
101851
|
+
function sessionsOfDeviceCell(kMax) {
|
|
101852
|
+
return Math.max(0, Math.floor(kMax));
|
|
101853
|
+
}
|
|
101854
|
+
/**
|
|
101855
|
+
* Per node, every (device × model) at its best fresh measurement: the newest
|
|
101856
|
+
* `pipeline` cell, else the newest `device` cell read as
|
|
101857
|
+
* {@link sessionsOfDeviceCell}. Several models of one device are kept apart —
|
|
101858
|
+
* the caller picks the one the device runs NOW (a cell for another model says
|
|
101859
|
+
* nothing about it).
|
|
101753
101860
|
*/
|
|
101754
101861
|
function measuredCapacityFromResults(rows, nodeIds, ctx) {
|
|
101755
101862
|
const byNode = /* @__PURE__ */ new Map();
|
|
101756
101863
|
for (const row of freshResults(rows, ctx)) {
|
|
101757
|
-
if (!nodeIds.includes(row.nodeId)
|
|
101864
|
+
if (!nodeIds.includes(row.nodeId)) continue;
|
|
101865
|
+
const candidate = capacityOfRow(row);
|
|
101758
101866
|
const devices = byNode.get(row.nodeId) ?? /* @__PURE__ */ new Map();
|
|
101759
|
-
const
|
|
101760
|
-
|
|
101867
|
+
const key = `${candidate.deviceKey}\u0000${candidate.modelId ?? ""}`;
|
|
101868
|
+
const held = devices.get(key);
|
|
101869
|
+
if (held === void 0 || betterCapacityCell(candidate, held)) devices.set(key, candidate);
|
|
101761
101870
|
byNode.set(row.nodeId, devices);
|
|
101762
101871
|
}
|
|
101763
101872
|
const out = /* @__PURE__ */ new Map();
|
|
@@ -101766,16 +101875,32 @@ function measuredCapacityFromResults(rows, nodeIds, ctx) {
|
|
|
101766
101875
|
if (devices === void 0) continue;
|
|
101767
101876
|
out.set(nodeId, {
|
|
101768
101877
|
nodeId,
|
|
101769
|
-
devices: [...devices.values()].toSorted((a, b) => a.
|
|
101770
|
-
deviceKey: r.cell.deviceKey,
|
|
101771
|
-
maxSessions: r.cell.phase === "pipeline" ? r.cell.maxSessions : 0,
|
|
101772
|
-
modelId: r.cell.modelId,
|
|
101773
|
-
measuredAtMs: r.measuredAtMs
|
|
101774
|
-
}))
|
|
101878
|
+
devices: [...devices.values()].toSorted((a, b) => a.deviceKey.localeCompare(b.deviceKey) || (a.modelId ?? "").localeCompare(b.modelId ?? ""))
|
|
101775
101879
|
});
|
|
101776
101880
|
}
|
|
101777
101881
|
return out;
|
|
101778
101882
|
}
|
|
101883
|
+
function capacityOfRow(row) {
|
|
101884
|
+
const { cell } = row;
|
|
101885
|
+
return cell.phase === "pipeline" ? {
|
|
101886
|
+
deviceKey: cell.deviceKey,
|
|
101887
|
+
maxSessions: cell.maxSessions,
|
|
101888
|
+
modelId: cell.modelId,
|
|
101889
|
+
measuredAtMs: row.measuredAtMs,
|
|
101890
|
+
phase: "pipeline"
|
|
101891
|
+
} : {
|
|
101892
|
+
deviceKey: cell.deviceKey,
|
|
101893
|
+
maxSessions: sessionsOfDeviceCell(cell.kMax),
|
|
101894
|
+
modelId: cell.modelId,
|
|
101895
|
+
measuredAtMs: row.measuredAtMs,
|
|
101896
|
+
phase: "device"
|
|
101897
|
+
};
|
|
101898
|
+
}
|
|
101899
|
+
/** A pipeline cell beats a device cell; within a phase the newer one wins. */
|
|
101900
|
+
function betterCapacityCell(a, b) {
|
|
101901
|
+
if (a.phase !== b.phase) return a.phase === "pipeline";
|
|
101902
|
+
return a.measuredAtMs > b.measuredAtMs;
|
|
101903
|
+
}
|
|
101779
101904
|
//#endregion
|
|
101780
101905
|
//#region src/pipeline/node-benchmark/step-tree.ts
|
|
101781
101906
|
var BENCH_ROOT_STEP_ID = "object-detection";
|
|
@@ -104355,6 +104480,7 @@ exports.COMPOSITION_ITEM_ARRAY_PATH = require_composition.COMPOSITION_ITEM_ARRAY
|
|
|
104355
104480
|
exports.COMPOSITION_ITEM_KEY_RE = require_composition.COMPOSITION_ITEM_KEY_RE;
|
|
104356
104481
|
exports.CONNECTION_TEST_TIMEOUT_MS = CONNECTION_TEST_TIMEOUT_MS;
|
|
104357
104482
|
exports.CONTAINER_CHILD_PRIORITY = CONTAINER_CHILD_PRIORITY;
|
|
104483
|
+
exports.CORAL_DEFAULT_MODEL_ID = CORAL_DEFAULT_MODEL_ID;
|
|
104358
104484
|
exports.CORE_BLOCKS_ADDON_ID = CORE_BLOCKS_ADDON_ID;
|
|
104359
104485
|
exports.CORE_BLOCK_ADDON_PREFIX = CORE_BLOCK_ADDON_PREFIX;
|
|
104360
104486
|
exports.CREDENTIAL_TOKEN_AUDIENCE = CREDENTIAL_TOKEN_AUDIENCE;
|
|
@@ -106173,6 +106299,7 @@ exports.canonicalEgressPlan = canonicalEgressPlan;
|
|
|
106173
106299
|
exports.canonicalIconKey = canonicalIconKey;
|
|
106174
106300
|
exports.canonicalizeAppCallback = canonicalizeAppCallback;
|
|
106175
106301
|
exports.capabilityScopesOf = capabilityScopesOf;
|
|
106302
|
+
exports.capacityForModel = capacityForModel;
|
|
106176
106303
|
exports.capacitySessionsOf = capacitySessionsOf;
|
|
106177
106304
|
exports.carbonMonoxideCapability = carbonMonoxideCapability;
|
|
106178
106305
|
exports.cellsToRects = cellsToRects;
|
|
@@ -106401,6 +106528,7 @@ exports.findCompositionCycles = findCompositionCycles;
|
|
|
106401
106528
|
exports.findTimezone = findTimezone;
|
|
106402
106529
|
exports.floodCapability = floodCapability;
|
|
106403
106530
|
exports.foldSnapshotByFunction = foldSnapshotByFunction;
|
|
106531
|
+
exports.foreignCapacityCells = foreignCapacityCells;
|
|
106404
106532
|
exports.forgetKnownSecret = require_sleep.forgetKnownSecret;
|
|
106405
106533
|
exports.formatDeviceRevoker = formatDeviceRevoker;
|
|
106406
106534
|
exports.formatForRuntime = formatForRuntime;
|
|
@@ -106832,6 +106960,7 @@ exports.sensorTransitionNeverFires = sensorTransitionNeverFires;
|
|
|
106832
106960
|
exports.sensorTransitionOffered = sensorTransitionOffered;
|
|
106833
106961
|
exports.servedTemplateVars = servedTemplateVars;
|
|
106834
106962
|
exports.serverManagementCapability = serverManagementCapability;
|
|
106963
|
+
exports.sessionsOfDeviceCell = sessionsOfDeviceCell;
|
|
106835
106964
|
exports.setByPath = setByPath;
|
|
106836
106965
|
exports.settingValuesEqual = settingValuesEqual;
|
|
106837
106966
|
exports.settingsBelow = settingsBelow;
|