@camstack/types 1.2.594 → 1.2.596
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/CHANGELOG.md +20 -0
- package/dist/addon.d.ts +1 -0
- package/dist/addon.js +156 -155
- package/dist/addon.mjs +3 -3
- package/dist/capabilities/index.d.ts +1 -1
- package/dist/capabilities/platform-probe.cap.d.ts +28 -0
- package/dist/capabilities/power-meter.cap.d.ts +16 -5
- package/dist/client.js +5 -1
- package/dist/client.mjs +5 -1
- package/dist/{composed-stable-id-BNTaDZEh.mjs → composed-stable-id-DIeNz933.mjs} +3 -0
- package/dist/{composed-stable-id-BdeYe5dD.js → composed-stable-id-DkF5-kuf.js} +3 -0
- package/dist/device/device-context.d.ts +5 -1
- package/dist/device/device-icon.d.ts +1 -0
- package/dist/device/device-type.d.ts +4 -1
- package/dist/device/hero/hero-look.d.ts +1 -0
- package/dist/device/hero/hero-scene.d.ts +1 -0
- package/dist/device/index.d.ts +1 -1
- package/dist/device/state-refresh.d.ts +15 -1
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/customize-catalog.d.ts +4 -4
- package/dist/{implemented-methods-Dj_2fX8-.js → implemented-methods-DnfgAfI6.js} +1 -1
- package/dist/{implemented-methods-DXeNAPAS.mjs → implemented-methods-wFScvZ40.mjs} +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3926 -4219
- package/dist/index.mjs +81 -379
- package/dist/inference/runtime-capabilities.d.ts +13 -2
- package/dist/interfaces/addon.d.ts +9 -3
- package/dist/interfaces/platform.d.ts +32 -0
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/dist/pipeline/second-pass/motion-crop-plan.d.ts +2 -3
- package/dist/{sleep-C9eelFbV.mjs → runtime-capabilities-Bgt5QBvO.mjs} +400 -2
- package/dist/{sleep-Bgzv_TCG.js → runtime-capabilities-wOKNm9iz.js} +495 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_event_category = require("./event-category-CMA0-jGW.js");
|
|
2
|
-
const require_composed_stable_id = require("./composed-stable-id-
|
|
2
|
+
const require_composed_stable_id = require("./composed-stable-id-DkF5-kuf.js");
|
|
3
3
|
let zod = require("zod");
|
|
4
4
|
//#region src/audio/audio-chunk-format.ts
|
|
5
5
|
/**
|
|
@@ -20031,6 +20031,10 @@ var CAP_STATE_LEAVES = Object.freeze({
|
|
|
20031
20031
|
"path": "power",
|
|
20032
20032
|
"valueType": "number"
|
|
20033
20033
|
},
|
|
20034
|
+
{
|
|
20035
|
+
"path": "deliveredPower",
|
|
20036
|
+
"valueType": "number"
|
|
20037
|
+
},
|
|
20034
20038
|
{
|
|
20035
20039
|
"path": "energy",
|
|
20036
20040
|
"valueType": "number"
|
|
@@ -22748,6 +22752,72 @@ function maskUrlCredentials(rawUrl) {
|
|
|
22748
22752
|
}
|
|
22749
22753
|
}
|
|
22750
22754
|
//#endregion
|
|
22755
|
+
//#region src/utils/runtime-mapping.ts
|
|
22756
|
+
/**
|
|
22757
|
+
* DEVICE-POOL backend → model format — the SSOT for the multi-device inference
|
|
22758
|
+
* DESCRIPTOR path (Python per-device pools), distinct from the former BACKEND_TO_FORMAT,
|
|
22759
|
+
* which was the removed NODE runtime map (where `coreml → onnx` because
|
|
22760
|
+
* onnxruntime-node's CoreML EP loaded `.onnx`). A device pool runs the
|
|
22761
|
+
* backend NATIVELY, so `coreml → coreml` and `edgetpu → tflite`. Consumed by
|
|
22762
|
+
* `resolveDeviceEngine` (addon-pipeline) and the orchestrator's
|
|
22763
|
+
* `parseDeviceKey`/`getNodeInferenceDevices` — the previously-duplicated
|
|
22764
|
+
* `BACKEND_FORMAT` maps (R3/node-F2). `cpu`/`cuda` floor to onnx.
|
|
22765
|
+
*/
|
|
22766
|
+
var DEVICE_BACKEND_TO_FORMAT = {
|
|
22767
|
+
openvino: "openvino",
|
|
22768
|
+
edgetpu: "tflite",
|
|
22769
|
+
coreml: "coreml",
|
|
22770
|
+
onnx: "onnx",
|
|
22771
|
+
cpu: "onnx",
|
|
22772
|
+
cuda: "onnx"
|
|
22773
|
+
};
|
|
22774
|
+
/**
|
|
22775
|
+
* Resolve a DEVICE-POOL backend to its model format via {@link DEVICE_BACKEND_TO_FORMAT},
|
|
22776
|
+
* flooring unknown backends to `onnx`. The single entry point both addons call.
|
|
22777
|
+
*/
|
|
22778
|
+
function deviceBackendToFormat(backend) {
|
|
22779
|
+
return DEVICE_BACKEND_TO_FORMAT[backend] ?? "onnx";
|
|
22780
|
+
}
|
|
22781
|
+
/**
|
|
22782
|
+
* Map DetectionRuntime to ModelFormat.
|
|
22783
|
+
* Used when the addon receives an explicit runtime (not 'auto').
|
|
22784
|
+
*/
|
|
22785
|
+
var RUNTIME_TO_FORMAT = {
|
|
22786
|
+
onnx: "onnx",
|
|
22787
|
+
coreml: "coreml",
|
|
22788
|
+
openvino: "openvino",
|
|
22789
|
+
tflite: "tflite",
|
|
22790
|
+
pytorch: "pt"
|
|
22791
|
+
};
|
|
22792
|
+
/**
|
|
22793
|
+
* Map a Python backend to the Python inference script name.
|
|
22794
|
+
*/
|
|
22795
|
+
var PYTHON_SCRIPT = {
|
|
22796
|
+
coreml: "coreml_inference.py",
|
|
22797
|
+
pytorch: "pytorch_inference.py",
|
|
22798
|
+
openvino: "openvino_inference.py"
|
|
22799
|
+
};
|
|
22800
|
+
/**
|
|
22801
|
+
* Get the model format for a given DetectionRuntime.
|
|
22802
|
+
*/
|
|
22803
|
+
function formatForRuntime(runtime) {
|
|
22804
|
+
return RUNTIME_TO_FORMAT[runtime];
|
|
22805
|
+
}
|
|
22806
|
+
/**
|
|
22807
|
+
* Get the Python inference script name for a backend.
|
|
22808
|
+
* Returns undefined if no Python script is needed (e.g., 'cpu' uses ONNX).
|
|
22809
|
+
*/
|
|
22810
|
+
function pythonScriptForBackend(backend) {
|
|
22811
|
+
return PYTHON_SCRIPT[backend];
|
|
22812
|
+
}
|
|
22813
|
+
/**
|
|
22814
|
+
* Check if a DetectionRuntime requires a Python binary.
|
|
22815
|
+
* 'coreml', 'pytorch', 'openvino' need Python; 'onnx' and 'tflite' don't.
|
|
22816
|
+
*/
|
|
22817
|
+
function requiresPython(runtime) {
|
|
22818
|
+
return runtime === "coreml" || runtime === "pytorch" || runtime === "openvino";
|
|
22819
|
+
}
|
|
22820
|
+
//#endregion
|
|
22751
22821
|
//#region src/utils/sleep.ts
|
|
22752
22822
|
/**
|
|
22753
22823
|
* Promise-based timer helpers — used everywhere the codebase needs to
|
|
@@ -22801,6 +22871,334 @@ function sleepCancellable(ms, signal) {
|
|
|
22801
22871
|
});
|
|
22802
22872
|
}
|
|
22803
22873
|
//#endregion
|
|
22874
|
+
//#region src/inference/coral-units.ts
|
|
22875
|
+
/** Bus order of the enumeration: USB first (the historical key), then PCIe. */
|
|
22876
|
+
var BUS_ORDER = ["usb", "pci"];
|
|
22877
|
+
function unitDevice(bus, index) {
|
|
22878
|
+
return index === 0 ? bus : `${bus}:${index}`;
|
|
22879
|
+
}
|
|
22880
|
+
function countOn(coral, bus) {
|
|
22881
|
+
if (coral.units !== void 0) return coral.units.filter((u) => u.bus === bus).reduce((n, u) => n + Math.max(0, u.count), 0);
|
|
22882
|
+
return bus === (coral.bus === "pci" ? "pci" : "usb") ? Math.max(1, coral.count ?? 1) : 0;
|
|
22883
|
+
}
|
|
22884
|
+
/** Every usable Coral unit on a node, USB first then PCIe, in ordinal order. */
|
|
22885
|
+
function coralUsableUnits(coral) {
|
|
22886
|
+
if (coral == null) return [];
|
|
22887
|
+
const out = [];
|
|
22888
|
+
for (const bus of BUS_ORDER) {
|
|
22889
|
+
const count = countOn(coral, bus);
|
|
22890
|
+
for (let index = 0; index < count; index++) out.push({
|
|
22891
|
+
bus,
|
|
22892
|
+
index,
|
|
22893
|
+
device: unitDevice(bus, index)
|
|
22894
|
+
});
|
|
22895
|
+
}
|
|
22896
|
+
return out;
|
|
22897
|
+
}
|
|
22898
|
+
var KEY_DEVICE = /^(usb|pci)(?::(\d+))?$/;
|
|
22899
|
+
/**
|
|
22900
|
+
* Map an edgetpu key suffix (`usb`, `usb:1`, `pci`, `pci:1`) to the explicit
|
|
22901
|
+
* libedgetpu device string (`usb:0`, `usb:1`, `pci:0`, `pci:1`). Throws on any
|
|
22902
|
+
* other string — a pool must never open "whichever Edge TPU comes first".
|
|
22903
|
+
*/
|
|
22904
|
+
function edgetpuDelegateDevice(device) {
|
|
22905
|
+
const match = KEY_DEVICE.exec(device.trim());
|
|
22906
|
+
if (match === null) throw new Error(`edgetpu device "${device}" is not usb[:N] or pci[:N]`);
|
|
22907
|
+
const [, bus, ordinal] = match;
|
|
22908
|
+
return `${bus}:${ordinal ?? "0"}`;
|
|
22909
|
+
}
|
|
22910
|
+
//#endregion
|
|
22911
|
+
//#region src/inference/runtime-capabilities.ts
|
|
22912
|
+
var AUTO = {
|
|
22913
|
+
value: "auto",
|
|
22914
|
+
label: "Auto"
|
|
22915
|
+
};
|
|
22916
|
+
var CPU = {
|
|
22917
|
+
value: "cpu",
|
|
22918
|
+
label: "CPU"
|
|
22919
|
+
};
|
|
22920
|
+
var USB = {
|
|
22921
|
+
value: "usb",
|
|
22922
|
+
label: "Coral USB"
|
|
22923
|
+
};
|
|
22924
|
+
function coralUnitOption(unit) {
|
|
22925
|
+
const bus = unit.bus === "pci" ? "PCIe" : "USB";
|
|
22926
|
+
const label = unit.index === 0 ? `Coral ${bus}` : `Coral ${bus} ${unit.index + 1}`;
|
|
22927
|
+
return {
|
|
22928
|
+
value: unit.device,
|
|
22929
|
+
label
|
|
22930
|
+
};
|
|
22931
|
+
}
|
|
22932
|
+
var ONNX_CUDA_EP = "CUDAExecutionProvider";
|
|
22933
|
+
/**
|
|
22934
|
+
* The `HardwareInfo.nvidia` slot for a found card. Usable only when the node's
|
|
22935
|
+
* ONNX Runtime lists the CUDA execution provider (`ort.get_available_providers()`,
|
|
22936
|
+
* the signal the inference pool binds on); `null` = not reported = not usable.
|
|
22937
|
+
*/
|
|
22938
|
+
function describeNvidia(probe, onnxExecutionProviders) {
|
|
22939
|
+
const base = {
|
|
22940
|
+
type: "nvidia",
|
|
22941
|
+
name: probe.name,
|
|
22942
|
+
...probe.memoryMB === void 0 ? {} : { memoryMB: probe.memoryMB }
|
|
22943
|
+
};
|
|
22944
|
+
return onnxExecutionProviders?.includes(ONNX_CUDA_EP) === true ? {
|
|
22945
|
+
...base,
|
|
22946
|
+
usable: true
|
|
22947
|
+
} : {
|
|
22948
|
+
...base,
|
|
22949
|
+
usable: false,
|
|
22950
|
+
reason: "no-cuda-execution-provider"
|
|
22951
|
+
};
|
|
22952
|
+
}
|
|
22953
|
+
/**
|
|
22954
|
+
* CUDA is offered only for a USABLE NVIDIA slot. An NVIDIA GPU alone is not
|
|
22955
|
+
* enough: without the EP the pool binds the CPU provider and a `cuda` device
|
|
22956
|
+
* would be the CPU under another name. `gpu.type === 'nvidia'` (older nodes)
|
|
22957
|
+
* never counts.
|
|
22958
|
+
*/
|
|
22959
|
+
function onnxCudaAvailable(hw) {
|
|
22960
|
+
return hw?.nvidia?.usable === true;
|
|
22961
|
+
}
|
|
22962
|
+
var RUNTIMES = [
|
|
22963
|
+
{
|
|
22964
|
+
id: "onnx",
|
|
22965
|
+
supports: () => true,
|
|
22966
|
+
devices: (hw) => {
|
|
22967
|
+
if (!hw) return [CPU];
|
|
22968
|
+
const out = [CPU];
|
|
22969
|
+
if (onnxCudaAvailable(hw)) out.push({
|
|
22970
|
+
value: "cuda",
|
|
22971
|
+
label: "CUDA"
|
|
22972
|
+
});
|
|
22973
|
+
if (hw.gpu?.type === "amd" && hw.platform === "linux") out.push({
|
|
22974
|
+
value: "webgpu",
|
|
22975
|
+
label: "WebGPU (AMD iGPU)"
|
|
22976
|
+
});
|
|
22977
|
+
if (hw.npu?.type === "apple-ane") out.push({
|
|
22978
|
+
value: "coreml",
|
|
22979
|
+
label: "CoreML EP"
|
|
22980
|
+
});
|
|
22981
|
+
return out;
|
|
22982
|
+
},
|
|
22983
|
+
defaultDevice: "cpu"
|
|
22984
|
+
},
|
|
22985
|
+
{
|
|
22986
|
+
id: "openvino",
|
|
22987
|
+
supports: (hw) => hw?.arch === "x64" && hw.platform !== "darwin" && (hw.gpu?.type === "intel" || hw.gpu?.type === "amd"),
|
|
22988
|
+
devices: (hw) => {
|
|
22989
|
+
if (!hw) return [AUTO];
|
|
22990
|
+
if (hw.gpu?.type === "amd") return [CPU];
|
|
22991
|
+
const out = [AUTO, CPU];
|
|
22992
|
+
if (hw.gpu?.type === "intel") out.push({
|
|
22993
|
+
value: "gpu",
|
|
22994
|
+
label: "GPU"
|
|
22995
|
+
});
|
|
22996
|
+
if (hw.npu?.type === "intel-npu") out.push({
|
|
22997
|
+
value: "npu",
|
|
22998
|
+
label: "NPU"
|
|
22999
|
+
});
|
|
23000
|
+
return out;
|
|
23001
|
+
},
|
|
23002
|
+
defaultDevice: "auto"
|
|
23003
|
+
},
|
|
23004
|
+
{
|
|
23005
|
+
id: "coreml",
|
|
23006
|
+
supports: (hw) => hw?.platform === "darwin",
|
|
23007
|
+
devices: (hw) => {
|
|
23008
|
+
const all = {
|
|
23009
|
+
value: "all",
|
|
23010
|
+
label: "All (ANE + GPU + CPU)"
|
|
23011
|
+
};
|
|
23012
|
+
if (!hw) return [all];
|
|
23013
|
+
const out = [all];
|
|
23014
|
+
if (hw.npu?.type === "apple-ane") out.push({
|
|
23015
|
+
value: "ane",
|
|
23016
|
+
label: "Apple Neural Engine"
|
|
23017
|
+
});
|
|
23018
|
+
out.push({
|
|
23019
|
+
value: "gpu",
|
|
23020
|
+
label: "GPU"
|
|
23021
|
+
}, CPU);
|
|
23022
|
+
return out;
|
|
23023
|
+
},
|
|
23024
|
+
defaultDevice: "all"
|
|
23025
|
+
},
|
|
23026
|
+
{
|
|
23027
|
+
id: "edgetpu",
|
|
23028
|
+
supports: (hw) => coralUsableUnits(hw?.coral).length > 0,
|
|
23029
|
+
devices: (hw) => {
|
|
23030
|
+
const units = coralUsableUnits(hw?.coral);
|
|
23031
|
+
return units.length > 0 ? units.map(coralUnitOption) : [USB];
|
|
23032
|
+
},
|
|
23033
|
+
defaultDevice: "usb"
|
|
23034
|
+
}
|
|
23035
|
+
];
|
|
23036
|
+
function def(id) {
|
|
23037
|
+
const d = RUNTIMES.find((r) => r.id === id);
|
|
23038
|
+
if (!d) throw new Error(`Unknown runtime: ${id}`);
|
|
23039
|
+
return d;
|
|
23040
|
+
}
|
|
23041
|
+
/**
|
|
23042
|
+
* Returns the list of supported runtime IDs for given hardware.
|
|
23043
|
+
* onnx is always included (universal floor); accelerators added when hw matches.
|
|
23044
|
+
*/
|
|
23045
|
+
function supportedRuntimes(hw) {
|
|
23046
|
+
return RUNTIMES.filter((r) => r.supports(hw)).map((r) => r.id);
|
|
23047
|
+
}
|
|
23048
|
+
/**
|
|
23049
|
+
* Returns the device options for a given runtime and hardware probe.
|
|
23050
|
+
*/
|
|
23051
|
+
function runtimeDevices(id, hw) {
|
|
23052
|
+
return def(id).devices(hw);
|
|
23053
|
+
}
|
|
23054
|
+
/**
|
|
23055
|
+
* Returns the default device string for a given runtime.
|
|
23056
|
+
* onnx → 'cpu', openvino → 'auto', coreml → 'all'
|
|
23057
|
+
*/
|
|
23058
|
+
function defaultDeviceFor(id) {
|
|
23059
|
+
return def(id).defaultDevice;
|
|
23060
|
+
}
|
|
23061
|
+
/**
|
|
23062
|
+
* Returns the model format required for a given runtime.
|
|
23063
|
+
* Delegates to `formatForRuntime` from runtime-mapping.ts.
|
|
23064
|
+
*/
|
|
23065
|
+
function modelFormatForRuntime(id) {
|
|
23066
|
+
if (id === "edgetpu") return "tflite";
|
|
23067
|
+
return formatForRuntime(id);
|
|
23068
|
+
}
|
|
23069
|
+
/**
|
|
23070
|
+
* Scores all applicable inference backends for the given hardware.
|
|
23071
|
+
*
|
|
23072
|
+
* Rules (hardware-driven only — no Python import probes):
|
|
23073
|
+
* - coreml: score 95, darwin+arm64
|
|
23074
|
+
* - cuda: score 85, only for a usable `nvidia` slot (the CUDA EP exists)
|
|
23075
|
+
* - openvino: score 90 if intel-npu present, else 80 if intel gpu
|
|
23076
|
+
* - edgetpu: score 70, a usable Coral unit (USB or PCIe)
|
|
23077
|
+
* - cpu: score 50 (universal floor, always included)
|
|
23078
|
+
*
|
|
23079
|
+
* All hardware-matched entries are `available: true`.
|
|
23080
|
+
* Scores are sorted descending; `best` is the first available entry
|
|
23081
|
+
* (or last entry as fallback).
|
|
23082
|
+
*/
|
|
23083
|
+
function scoreRuntimes(hw) {
|
|
23084
|
+
const scores = [];
|
|
23085
|
+
if (hw.platform === "darwin" && hw.arch === "arm64") scores.push({
|
|
23086
|
+
runtime: "python",
|
|
23087
|
+
backend: "coreml",
|
|
23088
|
+
format: "coreml",
|
|
23089
|
+
score: 95,
|
|
23090
|
+
reason: "Apple Neural Engine (Python CoreML)",
|
|
23091
|
+
available: true
|
|
23092
|
+
});
|
|
23093
|
+
if (onnxCudaAvailable(hw)) scores.push({
|
|
23094
|
+
runtime: "python",
|
|
23095
|
+
backend: "cuda",
|
|
23096
|
+
format: "onnx",
|
|
23097
|
+
score: 85,
|
|
23098
|
+
reason: "NVIDIA CUDA (Python ONNX Runtime)",
|
|
23099
|
+
available: true
|
|
23100
|
+
});
|
|
23101
|
+
if (hw.gpu?.type === "intel") {
|
|
23102
|
+
const score = hw.npu?.type === "intel-npu" ? 90 : 80;
|
|
23103
|
+
scores.push({
|
|
23104
|
+
runtime: "python",
|
|
23105
|
+
backend: "openvino",
|
|
23106
|
+
format: "openvino",
|
|
23107
|
+
score,
|
|
23108
|
+
reason: "Intel OpenVINO",
|
|
23109
|
+
available: true
|
|
23110
|
+
});
|
|
23111
|
+
}
|
|
23112
|
+
if (hw.gpu?.type === "amd") {
|
|
23113
|
+
if (hw.platform === "linux") scores.push({
|
|
23114
|
+
runtime: "python",
|
|
23115
|
+
backend: "onnx",
|
|
23116
|
+
format: "onnx",
|
|
23117
|
+
score: 75,
|
|
23118
|
+
reason: "ONNX WebGPU (AMD iGPU)",
|
|
23119
|
+
available: true
|
|
23120
|
+
});
|
|
23121
|
+
scores.push({
|
|
23122
|
+
runtime: "python",
|
|
23123
|
+
backend: "openvino",
|
|
23124
|
+
format: "openvino",
|
|
23125
|
+
score: 65,
|
|
23126
|
+
reason: "OpenVINO CPU (AMD x64)",
|
|
23127
|
+
available: true
|
|
23128
|
+
});
|
|
23129
|
+
}
|
|
23130
|
+
if (coralUsableUnits(hw.coral).length > 0) scores.push({
|
|
23131
|
+
runtime: "python",
|
|
23132
|
+
backend: "edgetpu",
|
|
23133
|
+
format: "tflite",
|
|
23134
|
+
score: 70,
|
|
23135
|
+
reason: "Coral Edge TPU (Python LiteRT)",
|
|
23136
|
+
available: true
|
|
23137
|
+
});
|
|
23138
|
+
scores.push({
|
|
23139
|
+
runtime: "python",
|
|
23140
|
+
backend: "cpu",
|
|
23141
|
+
format: "onnx",
|
|
23142
|
+
score: 50,
|
|
23143
|
+
reason: "CPU (Python ONNX Runtime)",
|
|
23144
|
+
available: true
|
|
23145
|
+
});
|
|
23146
|
+
const sorted = scores.toSorted((a, b) => b.score - a.score);
|
|
23147
|
+
return {
|
|
23148
|
+
scores: sorted,
|
|
23149
|
+
best: sorted.find((s) => s.available) ?? sorted[sorted.length - 1]
|
|
23150
|
+
};
|
|
23151
|
+
}
|
|
23152
|
+
var DEVICE_FOR_BACKEND = {
|
|
23153
|
+
cuda: "gpu",
|
|
23154
|
+
edgetpu: "usb",
|
|
23155
|
+
coreml: "all",
|
|
23156
|
+
cpu: "cpu"
|
|
23157
|
+
};
|
|
23158
|
+
function device(backend, dev, format, score) {
|
|
23159
|
+
return {
|
|
23160
|
+
key: backend === "cpu" ? "cpu" : `${backend}:${dev}`,
|
|
23161
|
+
backend,
|
|
23162
|
+
device: dev,
|
|
23163
|
+
format,
|
|
23164
|
+
runtime: "python",
|
|
23165
|
+
score,
|
|
23166
|
+
available: true
|
|
23167
|
+
};
|
|
23168
|
+
}
|
|
23169
|
+
/**
|
|
23170
|
+
* Enumerate every usable inference device on a node — one descriptor PER PHYSICAL
|
|
23171
|
+
* ACCELERATOR, so the orchestrator can run and balance across all of them
|
|
23172
|
+
* CONCURRENTLY (each device is its own pool). Critically, OpenVINO is expanded
|
|
23173
|
+
* into its distinct devices (NPU / iGPU / CPU) rather than a single AUTO entry:
|
|
23174
|
+
* the Intel NPU ("AI Boost") and the iGPU are separate accelerators and run in
|
|
23175
|
+
* parallel — collapsing them to AUTO would leave one idle. NPU is scored above
|
|
23176
|
+
* the iGPU (faster for int8 detection AND frees the GPU).
|
|
23177
|
+
*/
|
|
23178
|
+
function enumerateInferenceDevices(hw) {
|
|
23179
|
+
const { scores } = scoreRuntimes(hw);
|
|
23180
|
+
const out = [];
|
|
23181
|
+
for (const s of scores) {
|
|
23182
|
+
if (s.backend === "openvino") {
|
|
23183
|
+
if (hw.npu?.type === "intel-npu") out.push(device("openvino", "npu", s.format, s.score + 2));
|
|
23184
|
+
if (hw.gpu?.type === "intel") out.push(device("openvino", "gpu", s.format, s.score));
|
|
23185
|
+
if (hw.gpu?.type === "amd") out.push(device("openvino", "cpu", s.format, s.score));
|
|
23186
|
+
continue;
|
|
23187
|
+
}
|
|
23188
|
+
if (s.backend === "edgetpu") {
|
|
23189
|
+
for (const unit of coralUsableUnits(hw.coral)) out.push(device("edgetpu", unit.device, s.format, s.score));
|
|
23190
|
+
continue;
|
|
23191
|
+
}
|
|
23192
|
+
if (s.backend === "onnx" && s.reason.startsWith("ONNX WebGPU")) {
|
|
23193
|
+
out.push(device("onnx", "webgpu", s.format, s.score));
|
|
23194
|
+
continue;
|
|
23195
|
+
}
|
|
23196
|
+
const dev = DEVICE_FOR_BACKEND[s.backend] ?? s.backend;
|
|
23197
|
+
out.push(device(s.backend, dev, s.format, s.score));
|
|
23198
|
+
}
|
|
23199
|
+
return out;
|
|
23200
|
+
}
|
|
23201
|
+
//#endregion
|
|
22804
23202
|
Object.defineProperty(exports, "AUDIO_CHUNK_FORMATS", {
|
|
22805
23203
|
enumerable: true,
|
|
22806
23204
|
get: function() {
|
|
@@ -23023,6 +23421,12 @@ Object.defineProperty(exports, "DEFAULT_TOKEN_EXPIRY", {
|
|
|
23023
23421
|
return DEFAULT_TOKEN_EXPIRY;
|
|
23024
23422
|
}
|
|
23025
23423
|
});
|
|
23424
|
+
Object.defineProperty(exports, "DEVICE_BACKEND_TO_FORMAT", {
|
|
23425
|
+
enumerable: true,
|
|
23426
|
+
get: function() {
|
|
23427
|
+
return DEVICE_BACKEND_TO_FORMAT;
|
|
23428
|
+
}
|
|
23429
|
+
});
|
|
23026
23430
|
Object.defineProperty(exports, "DEVICE_CHILDREN_BATCH_MAX", {
|
|
23027
23431
|
enumerable: true,
|
|
23028
23432
|
get: function() {
|
|
@@ -23245,6 +23649,12 @@ Object.defineProperty(exports, "PROVIDER_PIN_FIELD", {
|
|
|
23245
23649
|
return PROVIDER_PIN_FIELD;
|
|
23246
23650
|
}
|
|
23247
23651
|
});
|
|
23652
|
+
Object.defineProperty(exports, "PYTHON_SCRIPT", {
|
|
23653
|
+
enumerable: true,
|
|
23654
|
+
get: function() {
|
|
23655
|
+
return PYTHON_SCRIPT;
|
|
23656
|
+
}
|
|
23657
|
+
});
|
|
23248
23658
|
Object.defineProperty(exports, "PeerBytesTicketSchema", {
|
|
23249
23659
|
enumerable: true,
|
|
23250
23660
|
get: function() {
|
|
@@ -23407,6 +23817,12 @@ Object.defineProperty(exports, "RUNTIME_DEFAULTS", {
|
|
|
23407
23817
|
return RUNTIME_DEFAULTS;
|
|
23408
23818
|
}
|
|
23409
23819
|
});
|
|
23820
|
+
Object.defineProperty(exports, "RUNTIME_TO_FORMAT", {
|
|
23821
|
+
enumerable: true,
|
|
23822
|
+
get: function() {
|
|
23823
|
+
return RUNTIME_TO_FORMAT;
|
|
23824
|
+
}
|
|
23825
|
+
});
|
|
23410
23826
|
Object.defineProperty(exports, "RawStateResultSchema", {
|
|
23411
23827
|
enumerable: true,
|
|
23412
23828
|
get: function() {
|
|
@@ -23845,6 +24261,12 @@ Object.defineProperty(exports, "commandOrigin", {
|
|
|
23845
24261
|
return commandOrigin;
|
|
23846
24262
|
}
|
|
23847
24263
|
});
|
|
24264
|
+
Object.defineProperty(exports, "coralUsableUnits", {
|
|
24265
|
+
enumerable: true,
|
|
24266
|
+
get: function() {
|
|
24267
|
+
return coralUsableUnits;
|
|
24268
|
+
}
|
|
24269
|
+
});
|
|
23848
24270
|
Object.defineProperty(exports, "createDebugEmitter", {
|
|
23849
24271
|
enumerable: true,
|
|
23850
24272
|
get: function() {
|
|
@@ -23917,6 +24339,12 @@ Object.defineProperty(exports, "declarationsOf", {
|
|
|
23917
24339
|
return declarationsOf;
|
|
23918
24340
|
}
|
|
23919
24341
|
});
|
|
24342
|
+
Object.defineProperty(exports, "defaultDeviceFor", {
|
|
24343
|
+
enumerable: true,
|
|
24344
|
+
get: function() {
|
|
24345
|
+
return defaultDeviceFor;
|
|
24346
|
+
}
|
|
24347
|
+
});
|
|
23920
24348
|
Object.defineProperty(exports, "defaultIntegrationDepsOver", {
|
|
23921
24349
|
enumerable: true,
|
|
23922
24350
|
get: function() {
|
|
@@ -23965,6 +24393,18 @@ Object.defineProperty(exports, "describeCustomActions", {
|
|
|
23965
24393
|
return describeCustomActions;
|
|
23966
24394
|
}
|
|
23967
24395
|
});
|
|
24396
|
+
Object.defineProperty(exports, "describeNvidia", {
|
|
24397
|
+
enumerable: true,
|
|
24398
|
+
get: function() {
|
|
24399
|
+
return describeNvidia;
|
|
24400
|
+
}
|
|
24401
|
+
});
|
|
24402
|
+
Object.defineProperty(exports, "deviceBackendToFormat", {
|
|
24403
|
+
enumerable: true,
|
|
24404
|
+
get: function() {
|
|
24405
|
+
return deviceBackendToFormat;
|
|
24406
|
+
}
|
|
24407
|
+
});
|
|
23968
24408
|
Object.defineProperty(exports, "deviceCustomAction", {
|
|
23969
24409
|
enumerable: true,
|
|
23970
24410
|
get: function() {
|
|
@@ -23983,6 +24423,12 @@ Object.defineProperty(exports, "displayUnitFor", {
|
|
|
23983
24423
|
return displayUnitFor;
|
|
23984
24424
|
}
|
|
23985
24425
|
});
|
|
24426
|
+
Object.defineProperty(exports, "edgetpuDelegateDevice", {
|
|
24427
|
+
enumerable: true,
|
|
24428
|
+
get: function() {
|
|
24429
|
+
return edgetpuDelegateDevice;
|
|
24430
|
+
}
|
|
24431
|
+
});
|
|
23986
24432
|
Object.defineProperty(exports, "effectConditionHolds", {
|
|
23987
24433
|
enumerable: true,
|
|
23988
24434
|
get: function() {
|
|
@@ -24007,6 +24453,12 @@ Object.defineProperty(exports, "entryBody", {
|
|
|
24007
24453
|
return entryBody;
|
|
24008
24454
|
}
|
|
24009
24455
|
});
|
|
24456
|
+
Object.defineProperty(exports, "enumerateInferenceDevices", {
|
|
24457
|
+
enumerable: true,
|
|
24458
|
+
get: function() {
|
|
24459
|
+
return enumerateInferenceDevices;
|
|
24460
|
+
}
|
|
24461
|
+
});
|
|
24010
24462
|
Object.defineProperty(exports, "event", {
|
|
24011
24463
|
enumerable: true,
|
|
24012
24464
|
get: function() {
|
|
@@ -24049,6 +24501,12 @@ Object.defineProperty(exports, "forgetKnownSecret", {
|
|
|
24049
24501
|
return forgetKnownSecret;
|
|
24050
24502
|
}
|
|
24051
24503
|
});
|
|
24504
|
+
Object.defineProperty(exports, "formatForRuntime", {
|
|
24505
|
+
enumerable: true,
|
|
24506
|
+
get: function() {
|
|
24507
|
+
return formatForRuntime;
|
|
24508
|
+
}
|
|
24509
|
+
});
|
|
24052
24510
|
Object.defineProperty(exports, "formatSecretScope", {
|
|
24053
24511
|
enumerable: true,
|
|
24054
24512
|
get: function() {
|
|
@@ -24283,6 +24741,12 @@ Object.defineProperty(exports, "migrationSet", {
|
|
|
24283
24741
|
return migrationSet;
|
|
24284
24742
|
}
|
|
24285
24743
|
});
|
|
24744
|
+
Object.defineProperty(exports, "modelFormatForRuntime", {
|
|
24745
|
+
enumerable: true,
|
|
24746
|
+
get: function() {
|
|
24747
|
+
return modelFormatForRuntime;
|
|
24748
|
+
}
|
|
24749
|
+
});
|
|
24286
24750
|
Object.defineProperty(exports, "moveRegistrySwitchToBody", {
|
|
24287
24751
|
enumerable: true,
|
|
24288
24752
|
get: function() {
|
|
@@ -24379,6 +24843,12 @@ Object.defineProperty(exports, "parseSecretStatePath", {
|
|
|
24379
24843
|
return parseSecretStatePath;
|
|
24380
24844
|
}
|
|
24381
24845
|
});
|
|
24846
|
+
Object.defineProperty(exports, "pythonScriptForBackend", {
|
|
24847
|
+
enumerable: true,
|
|
24848
|
+
get: function() {
|
|
24849
|
+
return pythonScriptForBackend;
|
|
24850
|
+
}
|
|
24851
|
+
});
|
|
24382
24852
|
Object.defineProperty(exports, "readCommandOrigin", {
|
|
24383
24853
|
enumerable: true,
|
|
24384
24854
|
get: function() {
|
|
@@ -24463,6 +24933,12 @@ Object.defineProperty(exports, "registrySwitchToBodyMigration", {
|
|
|
24463
24933
|
return registrySwitchToBodyMigration;
|
|
24464
24934
|
}
|
|
24465
24935
|
});
|
|
24936
|
+
Object.defineProperty(exports, "requiresPython", {
|
|
24937
|
+
enumerable: true,
|
|
24938
|
+
get: function() {
|
|
24939
|
+
return requiresPython;
|
|
24940
|
+
}
|
|
24941
|
+
});
|
|
24466
24942
|
Object.defineProperty(exports, "resolveCapMount", {
|
|
24467
24943
|
enumerable: true,
|
|
24468
24944
|
get: function() {
|
|
@@ -24523,6 +24999,12 @@ Object.defineProperty(exports, "runAddonMigrations", {
|
|
|
24523
24999
|
return runAddonMigrations;
|
|
24524
25000
|
}
|
|
24525
25001
|
});
|
|
25002
|
+
Object.defineProperty(exports, "runtimeDevices", {
|
|
25003
|
+
enumerable: true,
|
|
25004
|
+
get: function() {
|
|
25005
|
+
return runtimeDevices;
|
|
25006
|
+
}
|
|
25007
|
+
});
|
|
24526
25008
|
Object.defineProperty(exports, "schemaDeclaresAnyField", {
|
|
24527
25009
|
enumerable: true,
|
|
24528
25010
|
get: function() {
|
|
@@ -24535,6 +25017,12 @@ Object.defineProperty(exports, "scopeKey", {
|
|
|
24535
25017
|
return scopeKey;
|
|
24536
25018
|
}
|
|
24537
25019
|
});
|
|
25020
|
+
Object.defineProperty(exports, "scoreRuntimes", {
|
|
25021
|
+
enumerable: true,
|
|
25022
|
+
get: function() {
|
|
25023
|
+
return scoreRuntimes;
|
|
25024
|
+
}
|
|
25025
|
+
});
|
|
24538
25026
|
Object.defineProperty(exports, "scrubKnownSecrets", {
|
|
24539
25027
|
enumerable: true,
|
|
24540
25028
|
get: function() {
|
|
@@ -24595,6 +25083,12 @@ Object.defineProperty(exports, "sleepCancellable", {
|
|
|
24595
25083
|
return sleepCancellable;
|
|
24596
25084
|
}
|
|
24597
25085
|
});
|
|
25086
|
+
Object.defineProperty(exports, "supportedRuntimes", {
|
|
25087
|
+
enumerable: true,
|
|
25088
|
+
get: function() {
|
|
25089
|
+
return supportedRuntimes;
|
|
25090
|
+
}
|
|
25091
|
+
});
|
|
24598
25092
|
Object.defineProperty(exports, "switchRecordsOverMigrationApi", {
|
|
24599
25093
|
enumerable: true,
|
|
24600
25094
|
get: function() {
|