onnxruntime-node 1.16.3 → 1.17.0-dev.20240118-a63b71eadb
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/README.md +5 -1
- package/__commit.txt +1 -0
- package/bin/napi-v3/darwin/{x64/libonnxruntime.1.16.3.dylib → arm64/libonnxruntime.1.17.0.dylib} +0 -0
- package/bin/napi-v3/darwin/arm64/onnxruntime_binding.node +0 -0
- package/bin/napi-v3/darwin/{arm64/libonnxruntime.1.16.3.dylib → x64/libonnxruntime.1.17.0.dylib} +0 -0
- package/bin/napi-v3/darwin/x64/onnxruntime_binding.node +0 -0
- package/bin/napi-v3/linux/{x64/libonnxruntime.so.1.16.3 → arm64/libonnxruntime.so.1.17.0} +0 -0
- package/bin/napi-v3/linux/arm64/onnxruntime_binding.node +0 -0
- package/bin/napi-v3/linux/{arm64/libonnxruntime.so.1.16.3 → x64/libonnxruntime.so.1.17.0} +0 -0
- package/bin/napi-v3/linux/x64/onnxruntime_binding.node +0 -0
- package/bin/napi-v3/win32/arm64/onnxruntime.dll +0 -0
- package/bin/napi-v3/win32/arm64/onnxruntime_binding.node +0 -0
- package/bin/napi-v3/win32/arm64/onnxruntime_providers_shared.dll +0 -0
- package/bin/napi-v3/win32/x64/onnxruntime.dll +0 -0
- package/bin/napi-v3/win32/x64/onnxruntime_binding.node +0 -0
- package/bin/napi-v3/win32/x64/onnxruntime_providers_shared.dll +0 -0
- package/dist/backend.js +4 -3
- package/dist/backend.js.map +1 -1
- package/dist/binding.js.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/lib/backend.ts +6 -5
- package/lib/binding.ts +12 -3
- package/lib/index.ts +7 -3
- package/lib/version.ts +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -22,7 +22,11 @@ Following platforms are supported with pre-built binaries:
|
|
|
22
22
|
- Linux x64 CPU NAPI_v3
|
|
23
23
|
- MacOS x64 CPU NAPI_v3
|
|
24
24
|
|
|
25
|
-
To use on platforms without pre-built binaries, you can build Node.js binding from source and consume it by `npm install <onnxruntime_repo_root>/js/node/`. See also [instructions](https://
|
|
25
|
+
To use on platforms without pre-built binaries, you can build Node.js binding from source and consume it by `npm install <onnxruntime_repo_root>/js/node/`. See also [instructions](https://onnxruntime.ai/docs/build/inferencing.html#apis-and-language-bindings) for building ONNX Runtime Node.js binding locally.
|
|
26
|
+
|
|
27
|
+
# GPU Support
|
|
28
|
+
|
|
29
|
+
Right now, the Windows version supports only the DML provider. Linux x64 can use CUDA and TensorRT.
|
|
26
30
|
|
|
27
31
|
## License
|
|
28
32
|
|
package/__commit.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a63b71eadb56d7a75f4861d20ed50fcd6909e3ab
|
package/bin/napi-v3/darwin/{x64/libonnxruntime.1.16.3.dylib → arm64/libonnxruntime.1.17.0.dylib}
RENAMED
|
Binary file
|
|
Binary file
|
package/bin/napi-v3/darwin/{arm64/libonnxruntime.1.16.3.dylib → x64/libonnxruntime.1.17.0.dylib}
RENAMED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/backend.js
CHANGED
|
@@ -14,7 +14,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
14
14
|
};
|
|
15
15
|
var _OnnxruntimeSessionHandler_inferenceSession;
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.onnxruntimeBackend = void 0;
|
|
17
|
+
exports.listSupportedBackends = exports.onnxruntimeBackend = void 0;
|
|
18
18
|
const binding_1 = require("./binding");
|
|
19
19
|
class OnnxruntimeSessionHandler {
|
|
20
20
|
constructor(pathOrBuffer, options) {
|
|
@@ -30,7 +30,7 @@ class OnnxruntimeSessionHandler {
|
|
|
30
30
|
this.outputNames = __classPrivateFieldGet(this, _OnnxruntimeSessionHandler_inferenceSession, "f").outputNames;
|
|
31
31
|
}
|
|
32
32
|
async dispose() {
|
|
33
|
-
|
|
33
|
+
__classPrivateFieldGet(this, _OnnxruntimeSessionHandler_inferenceSession, "f").dispose();
|
|
34
34
|
}
|
|
35
35
|
startProfiling() {
|
|
36
36
|
// TODO: implement profiling
|
|
@@ -57,7 +57,7 @@ class OnnxruntimeBackend {
|
|
|
57
57
|
async init() {
|
|
58
58
|
return Promise.resolve();
|
|
59
59
|
}
|
|
60
|
-
async
|
|
60
|
+
async createInferenceSessionHandler(pathOrBuffer, options) {
|
|
61
61
|
return new Promise((resolve, reject) => {
|
|
62
62
|
process.nextTick(() => {
|
|
63
63
|
try {
|
|
@@ -72,4 +72,5 @@ class OnnxruntimeBackend {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
exports.onnxruntimeBackend = new OnnxruntimeBackend();
|
|
75
|
+
exports.listSupportedBackends = binding_1.binding.listSupportedBackends;
|
|
75
76
|
//# sourceMappingURL=backend.js.map
|
package/dist/backend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../lib/backend.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,kCAAkC;;;;;;;;;;;;;;;AAIlC,uCAA2C;AAE3C,MAAM,yBAAyB;IAG7B,YAAY,YAA+B,EAAE,OAAwC;QAFrF,8DAA4C;QAG1C,uBAAA,IAAI,+CAAqB,IAAI,iBAAO,CAAC,gBAAgB,EAAE,MAAA,CAAC;QACxD,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE;YACpC,uBAAA,IAAI,mDAAkB,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;SACzD;aAAM;YACL,uBAAA,IAAI,mDAAkB,CAAC,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,UAAU,EAA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AO,CAAC,QAAQ,CAAC,GAAG,EAAE;gBACpB,IAAI;oBACF,OAAO,CAAC,uBAAA,IAAI,mDAAkB,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;iBAC9D;gBAAC,OAAO,CAAC,EAAE;oBACV,gCAAgC;oBAChC,MAAM,CAAC,CAAC,CAAC,CAAC;iBACX;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;;AAED,MAAM,kBAAkB;IACtB,KAAK,CAAC,IAAI;QACR,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,6BAA6B,CAAC,YAA+B,EAAE,OAAyC;QAE5G,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE;gBACpB,IAAI;oBACF,OAAO,CAAC,IAAI,yBAAyB,CAAC,YAAY,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC;iBACrE;gBAAC,OAAO,CAAC,EAAE;oBACV,gCAAgC;oBAChC,MAAM,CAAC,CAAC,CAAC,CAAC;iBACX;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAEY,QAAA,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAC9C,QAAA,qBAAqB,GAAG,iBAAO,CAAC,qBAAqB,CAAC"}
|
package/dist/binding.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding.js","sourceRoot":"","sources":["../lib/binding.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,kCAAkC;;;
|
|
1
|
+
{"version":3,"file":"binding.js","sourceRoot":"","sources":["../lib/binding.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,kCAAkC;;;AA2ClC,wBAAwB;AACX,QAAA,OAAO;AAChB,qGAAqG;AACrG,OAAO,CAAC,kBAAkB,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,2BAA2B,CAIxF,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,10 +16,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.listSupportedBackends = void 0;
|
|
19
20
|
__exportStar(require("onnxruntime-common"), exports);
|
|
21
|
+
var backend_1 = require("./backend");
|
|
22
|
+
Object.defineProperty(exports, "listSupportedBackends", { enumerable: true, get: function () { return backend_1.listSupportedBackends; } });
|
|
20
23
|
const onnxruntime_common_1 = require("onnxruntime-common");
|
|
21
|
-
const backend_1 = require("./backend");
|
|
22
24
|
const version_1 = require("./version");
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
const backend_2 = require("./backend");
|
|
26
|
+
const backends = (0, backend_2.listSupportedBackends)();
|
|
27
|
+
for (const backend of backends) {
|
|
28
|
+
(0, onnxruntime_common_1.registerBackend)(backend.name, backend_2.onnxruntimeBackend, 100);
|
|
29
|
+
}
|
|
30
|
+
Object.defineProperty(onnxruntime_common_1.env.versions, 'node', { value: version_1.version, enumerable: true });
|
|
25
31
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,kCAAkC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,kCAAkC;;;;;;;;;;;;;;;;;AAElC,qDAAmC;AACnC,qCAAgD;AAAxC,gHAAA,qBAAqB,OAAA;AAC7B,2DAAwD;AACxD,uCAAkC;AAClC,uCAAoE;AAEpE,MAAM,QAAQ,GAAG,IAAA,+BAAqB,GAAE,CAAC;AACzC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;IAC9B,IAAA,oCAAe,EAAC,OAAO,CAAC,IAAI,EAAE,4BAAkB,EAAE,GAAG,CAAC,CAAC;CACxD;AAED,MAAM,CAAC,cAAc,CAAC,wBAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAC,KAAK,EAAE,iBAAO,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC,CAAC"}
|
package/dist/version.js
CHANGED
|
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.version = void 0;
|
|
6
6
|
// This file is generated by /js/scripts/update-version.ts
|
|
7
7
|
// Do not modify file content manually.
|
|
8
|
-
exports.version = '1.
|
|
8
|
+
exports.version = '1.17.0-dev.20240118-a63b71eadb';
|
|
9
9
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../lib/version.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,kCAAkC;;;AAElC,0DAA0D;AAC1D,uCAAuC;AAE1B,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../lib/version.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,kCAAkC;;;AAElC,0DAA0D;AAC1D,uCAAuC;AAE1B,QAAA,OAAO,GAAG,gCAAgC,CAAC"}
|
package/lib/backend.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import {Backend, InferenceSession, SessionHandler} from 'onnxruntime-common';
|
|
4
|
+
import {Backend, InferenceSession, InferenceSessionHandler, SessionHandler} from 'onnxruntime-common';
|
|
5
5
|
|
|
6
6
|
import {Binding, binding} from './binding';
|
|
7
7
|
|
|
8
|
-
class OnnxruntimeSessionHandler implements
|
|
8
|
+
class OnnxruntimeSessionHandler implements InferenceSessionHandler {
|
|
9
9
|
#inferenceSession: Binding.InferenceSession;
|
|
10
10
|
|
|
11
11
|
constructor(pathOrBuffer: string|Uint8Array, options: InferenceSession.SessionOptions) {
|
|
@@ -20,7 +20,7 @@ class OnnxruntimeSessionHandler implements SessionHandler {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
async dispose(): Promise<void> {
|
|
23
|
-
|
|
23
|
+
this.#inferenceSession.dispose();
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
readonly inputNames: string[];
|
|
@@ -53,8 +53,8 @@ class OnnxruntimeBackend implements Backend {
|
|
|
53
53
|
return Promise.resolve();
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
async
|
|
57
|
-
Promise<
|
|
56
|
+
async createInferenceSessionHandler(pathOrBuffer: string|Uint8Array, options?: InferenceSession.SessionOptions):
|
|
57
|
+
Promise<InferenceSessionHandler> {
|
|
58
58
|
return new Promise((resolve, reject) => {
|
|
59
59
|
process.nextTick(() => {
|
|
60
60
|
try {
|
|
@@ -69,3 +69,4 @@ class OnnxruntimeBackend implements Backend {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export const onnxruntimeBackend = new OnnxruntimeBackend();
|
|
72
|
+
export const listSupportedBackends = binding.listSupportedBackends;
|
package/lib/binding.ts
CHANGED
|
@@ -28,16 +28,25 @@ export declare namespace Binding {
|
|
|
28
28
|
readonly outputNames: string[];
|
|
29
29
|
|
|
30
30
|
run(feeds: FeedsType, fetches: FetchesType, options: RunOptions): ReturnType;
|
|
31
|
+
|
|
32
|
+
dispose(): void;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export interface InferenceSessionConstructor {
|
|
34
36
|
new(): InferenceSession;
|
|
35
37
|
}
|
|
38
|
+
|
|
39
|
+
export interface SupportedBackend {
|
|
40
|
+
name: string;
|
|
41
|
+
bundled: boolean;
|
|
42
|
+
}
|
|
36
43
|
}
|
|
37
44
|
|
|
38
45
|
// export native binding
|
|
39
46
|
export const binding =
|
|
40
47
|
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
41
|
-
require(`../bin/napi-v3/${process.platform}/${process.arch}/onnxruntime_binding.node`) as
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
require(`../bin/napi-v3/${process.platform}/${process.arch}/onnxruntime_binding.node`) as {
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
50
|
+
InferenceSession: Binding.InferenceSessionConstructor;
|
|
51
|
+
listSupportedBackends: () => Binding.SupportedBackend[];
|
|
52
|
+
};
|
package/lib/index.ts
CHANGED
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
export * from 'onnxruntime-common';
|
|
5
|
+
export {listSupportedBackends} from './backend';
|
|
5
6
|
import {registerBackend, env} from 'onnxruntime-common';
|
|
6
|
-
import {onnxruntimeBackend} from './backend';
|
|
7
7
|
import {version} from './version';
|
|
8
|
+
import {onnxruntimeBackend, listSupportedBackends} from './backend';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
const backends = listSupportedBackends();
|
|
11
|
+
for (const backend of backends) {
|
|
12
|
+
registerBackend(backend.name, onnxruntimeBackend, 100);
|
|
13
|
+
}
|
|
10
14
|
|
|
11
|
-
env.versions
|
|
15
|
+
Object.defineProperty(env.versions, 'node', {value: version, enumerable: true});
|
package/lib/version.ts
CHANGED
package/package.json
CHANGED
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
3
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
|
-
"version": "1.
|
|
16
|
+
"version": "1.17.0-dev.20240118-a63b71eadb",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"onnxruntime-common": "
|
|
18
|
+
"onnxruntime-common": "1.17.0-dev.20240116-80f274ca6f"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"buildr": "tsc && node ./script/build --config=RelWithDebInfo",
|
|
22
|
+
"preprepare": "node -e \"require('node:fs').copyFileSync('./node_modules/long/index.d.ts', './node_modules/long/umd/index.d.ts')\"",
|
|
22
23
|
"prepare": "tsc --build script test .",
|
|
23
24
|
"rebuild": "tsc && node ./script/build --rebuild",
|
|
24
25
|
"rebuildd": "tsc && node ./script/build --rebuild --config=Debug",
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
"jsonc": "^2.0.0",
|
|
40
41
|
"minimist": "^1.2.8",
|
|
41
42
|
"node-addon-api": "^6.0.0",
|
|
42
|
-
"
|
|
43
|
+
"protobufjs": "^7.2.4"
|
|
43
44
|
},
|
|
44
45
|
"main": "dist/index.js",
|
|
45
46
|
"os": [
|