Skip to content

Commit cfc9d0d

Browse files
authored
Merge pull request #66 from asus4/update-libs
Update OnnxRuntime libs
2 parents ecce1f5 + 7c91562 commit cfc9d0d

File tree

13 files changed

+52
-24
lines changed

13 files changed

+52
-24
lines changed

.github/workflows/publish-packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66
permissions:
77
contents: write
88
env:
9-
ORT_VERSION: 1.21.0
9+
ORT_VERSION: 1.22.1
1010
ORT_EXTENSIONS_VERSION: 0.14.0
11-
ORT_GENAI_VERSION: 0.7.0
11+
ORT_GENAI_VERSION: 0.8.3
1212
# Dry-run on workflow_dispatch
1313
NPM_OPTS: ${{ github.event_name == 'workflow_dispatch' && '--dry-run' || '' }}
1414
jobs:

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ Pre-built ONNX Runtime libraries for Unity.
2323
## Tested environment
2424

2525
- Unity: 6000.0.43f1 (LTS)
26-
- ONNX Runtime: [1.21.0](https://github.com/microsoft/onnxruntime/releases/tag/v1.21.0)
26+
- ONNX Runtime: [1.22.1](https://github.com/microsoft/onnxruntime/releases/tag/v1.22.1)
2727
- ONNX Runtime Extensions: [0.14.0](https://github.com/microsoft/onnxruntime-extensions/releases/tag/v0.14.0)
28+
- ONNX Runtime GenAI: [0.8.3](https://github.com/microsoft/onnxruntime-genai/releases/tag/v0.8.3)
2829

2930
### Execution Providers & Extensions
3031

@@ -70,10 +71,10 @@ Pre-built libraries are available on [NPM](https://www.npmjs.com/package/com.git
7071
}
7172
]
7273
"dependencies": {
73-
"com.github.asus4.onnxruntime": "0.4.1",
74-
"com.github.asus4.onnxruntime.unity": "0.4.1",
75-
"com.github.asus4.onnxruntime.win-x64-gpu": "0.4.1",
76-
"com.github.asus4.onnxruntime-extensions": "0.4.1",
74+
"com.github.asus4.onnxruntime": "0.4.2",
75+
"com.github.asus4.onnxruntime.unity": "0.4.2",
76+
"com.github.asus4.onnxruntime.win-x64-gpu": "0.4.2",
77+
"com.github.asus4.onnxruntime-extensions": "0.4.2",
7778
... other dependencies
7879
}
7980
```

com.github.asus4.onnxruntime-extensions/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.github.asus4.onnxruntime-extensions",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"displayName": "ONNX Runtime Extensions",
55
"description": "ONNX Runtime Extensions for Unity",
66
"keywords": [
@@ -10,7 +10,7 @@
1010
"unity": "2022.3",
1111
"unityRelease": "0f1",
1212
"dependencies": {
13-
"com.github.asus4.onnxruntime": "0.4.1"
13+
"com.github.asus4.onnxruntime": "0.4.2"
1414
},
1515
"repository": {
1616
"type": "git",

com.github.asus4.onnxruntime-genai/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.github.asus4.onnxruntime-genai",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"displayName": "ONNX Runtime GenAI",
55
"description": "ONNX Runtime Generative AI for Unity",
66
"keywords": [
@@ -10,7 +10,7 @@
1010
"unity": "2022.3",
1111
"unityRelease": "0f1",
1212
"dependencies": {
13-
"com.github.asus4.onnxruntime": "0.4.1"
13+
"com.github.asus4.onnxruntime": "0.4.2"
1414
},
1515
"repository": {
1616
"type": "git",

com.github.asus4.onnxruntime.linux-x64-gpu/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.github.asus4.onnxruntime.linux-x64-gpu",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"displayName": "ONNX Runtime - Linux x64 GPU",
55
"description": "ONNX Runtime for Unity - Linux x64 GPU Provider",
66
"keywords": [
@@ -10,7 +10,7 @@
1010
"unity": "2022.3",
1111
"unityRelease": "0f1",
1212
"dependencies": {
13-
"com.github.asus4.onnxruntime": "0.4.1"
13+
"com.github.asus4.onnxruntime": "0.4.2"
1414
},
1515
"repository": {
1616
"type": "git",

com.github.asus4.onnxruntime.unity/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.github.asus4.onnxruntime.unity",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"displayName": "ONNX Runtime Unity Utilities",
55
"description": "ONNX Runtime Utilities for Unity",
66
"keywords": [
@@ -10,7 +10,7 @@
1010
"unity": "2022.3",
1111
"unityRelease": "0f1",
1212
"dependencies": {
13-
"com.github.asus4.onnxruntime": "0.4.1"
13+
"com.github.asus4.onnxruntime": "0.4.2"
1414
},
1515
"repository": {
1616
"type": "git",

com.github.asus4.onnxruntime.win-x64-gpu/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.github.asus4.onnxruntime.win-x64-gpu",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"displayName": "ONNX Runtime - Windows x64 GPU",
55
"description": "ONNX Runtime for Unity - Windows x64 GPU Provider",
66
"keywords": [
@@ -10,7 +10,7 @@
1010
"unity": "2022.3",
1111
"unityRelease": "0f1",
1212
"dependencies": {
13-
"com.github.asus4.onnxruntime": "0.4.1"
13+
"com.github.asus4.onnxruntime": "0.4.2"
1414
},
1515
"repository": {
1616
"type": "git",

com.github.asus4.onnxruntime/Runtime/ManagedProjections.shared.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ internal class ManagedTypeProjection
2525
/// </summary>
2626
/// <param name="namedOnnxValue"></param>
2727
/// <param name="metadata"></param>
28-
/// <returns>OrtValye created accoding to the metadata</returns>
28+
/// <returns>OrtValue created according to the metadata</returns>
2929
internal static OrtValue CreateProjection(NamedOnnxValue namedOnnxValue, NodeMetadata metadata)
3030
{
3131
OrtValue result;
@@ -191,4 +191,3 @@ private static OrtValue CreateTensorProjection(NamedOnnxValue node, NodeMetadata
191191
}
192192
}
193193
}
194-

com.github.asus4.onnxruntime/Runtime/NativeMethods.shared.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
using System;
1717
using System.Runtime.InteropServices;
18+
using static Microsoft.ML.OnnxRuntime.NativeMethods;
1819

1920
namespace Microsoft.ML.OnnxRuntime
2021
{
@@ -337,6 +338,16 @@ public struct OrtApi
337338
public IntPtr CreateLoraAdapterFromArray;
338339
public IntPtr ReleaseLoraAdapter;
339340
public IntPtr RunOptionsAddActiveLoraAdapter;
341+
public IntPtr SetEpDynamicOptions;
342+
public IntPtr ReleaseValueInfo;
343+
public IntPtr ReleaseNode;
344+
public IntPtr ReleaseGraph;
345+
public IntPtr ReleaseModel;
346+
public IntPtr GetValueInfoName;
347+
public IntPtr GetValueInfoTypeInfo;
348+
public IntPtr GetModelEditorApi;
349+
public IntPtr CreateTensorWithDataAndDeleterAsOrtValue;
350+
public IntPtr SessionOptionsSetLoadCancellationFlag;
340351
}
341352

342353
internal static class NativeMethods
@@ -416,6 +427,7 @@ static NativeMethods()
416427
OrtReleaseSessionOptions = (DOrtReleaseSessionOptions)Marshal.GetDelegateForFunctionPointer(api_.ReleaseSessionOptions, typeof(DOrtReleaseSessionOptions));
417428
OrtCloneSessionOptions = (DOrtCloneSessionOptions)Marshal.GetDelegateForFunctionPointer(api_.CloneSessionOptions, typeof(DOrtCloneSessionOptions));
418429
OrtSetSessionExecutionMode = (DOrtSetSessionExecutionMode)Marshal.GetDelegateForFunctionPointer(api_.SetSessionExecutionMode, typeof(DOrtSetSessionExecutionMode));
430+
OrtSessionOptionsSetLoadCancellationFlag = (DOrtSessionOptionsSetLoadCancellationFlag)Marshal.GetDelegateForFunctionPointer(api_.SessionOptionsSetLoadCancellationFlag, typeof(DOrtSessionOptionsSetLoadCancellationFlag));
419431
OrtSetOptimizedModelFilePath = (DOrtSetOptimizedModelFilePath)Marshal.GetDelegateForFunctionPointer(api_.SetOptimizedModelFilePath, typeof(DOrtSetOptimizedModelFilePath));
420432
OrtEnableProfiling = (DOrtEnableProfiling)Marshal.GetDelegateForFunctionPointer(api_.EnableProfiling, typeof(DOrtEnableProfiling));
421433
OrtDisableProfiling = (DOrtDisableProfiling)Marshal.GetDelegateForFunctionPointer(api_.DisableProfiling, typeof(DOrtDisableProfiling));
@@ -859,7 +871,7 @@ internal class NativeLib
859871
/// Creates an instance of OrtSession with provided parameters
860872
/// </summary>
861873
/// <param name="environment">Native OrtEnv instance</param>
862-
/// <param name="modelData">Byte array correspoonding to the model</param>
874+
/// <param name="modelData">Byte array corresponding to the model</param>
863875
/// <param name="modelSize">Size of the model in bytes</param>
864876
/// <param name="sessionOptions">Native SessionOptions instance</param>
865877
/// <param name="prepackedWeightsContainer">Native OrtPrepackedWeightsContainer instance</param>
@@ -1037,6 +1049,12 @@ IntPtr[] outputValues /* An array of output value pointers. Array must be alloca
10371049
ExecutionMode execution_mode);
10381050
public static DOrtSetSessionExecutionMode OrtSetSessionExecutionMode;
10391051

1052+
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
1053+
public delegate IntPtr /*(OrtStatus*)*/ DOrtSessionOptionsSetLoadCancellationFlag(IntPtr /*(OrtSessionOptions*)*/ options,
1054+
bool value);
1055+
public static DOrtSessionOptionsSetLoadCancellationFlag OrtSessionOptionsSetLoadCancellationFlag;
1056+
1057+
10401058
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
10411059
public delegate IntPtr /*(OrtStatus*)*/ DOrtSetOptimizedModelFilePath(IntPtr /* OrtSessionOptions* */ options, byte[] optimizedModelFilepath);
10421060
public static DOrtSetOptimizedModelFilePath OrtSetOptimizedModelFilePath;
@@ -1270,7 +1288,7 @@ IntPtr[] outputValues /* An array of output value pointers. Array must be alloca
12701288
/// </summary>
12711289
/// <param name="options">Native SessionOptions instance</param>
12721290
/// <param name="name">Name of the initializer</param>
1273-
/// <param name="ortValue">Native OrtValue instnce</param>
1291+
/// <param name="ortValue">Native OrtValue instance</param>
12741292
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
12751293
public delegate IntPtr /*(OrtStatus*)*/ DOrtAddInitializer(IntPtr /*(OrtSessionOptions*)*/ options,
12761294
byte[] /*(const char*)*/ name,

com.github.asus4.onnxruntime/Runtime/OrtValue.shared.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// #define NET8_0_OR_GREATER
33
#endif // UNITY_6000_0_OR_NEWER
44

5-
// Copyright (c) Microsoft Corporation. All rights reserved.
5+
// Copyright (c) Microsoft Corporation. All rights reserved.
66
// Licensed under the MIT License.
77

88
using Microsoft.ML.OnnxRuntime.Tensors;

0 commit comments

Comments
 (0)