com.github.asus4.onnxruntime 0.4.1 → 0.4.2

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.
Files changed (36) hide show
  1. package/Plugins/Android/onnxruntime.aar +0 -0
  2. package/Plugins/Linux/x64/libonnxruntime.so +0 -0
  3. package/Plugins/Windows/arm64/onnxruntime.dll +0 -0
  4. package/Plugins/Windows/x64/onnxruntime.dll +0 -0
  5. package/Plugins/Windows/x86/onnxruntime.dll +0 -0
  6. package/Plugins/iOS~/onnxruntime.xcframework/Info.plist +11 -5
  7. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Headers/onnxruntime_c_api.h +1307 -64
  8. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Headers/onnxruntime_cxx_api.h +425 -24
  9. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Headers/onnxruntime_cxx_inline.h +614 -6
  10. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Headers/onnxruntime_run_options_config_keys.h +3 -0
  11. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Headers/onnxruntime_session_options_config_keys.h +29 -5
  12. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Info.plist +2 -2
  13. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/onnxruntime +0 -0
  14. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A/Headers/onnxruntime_c_api.h +1307 -64
  15. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A/Headers/onnxruntime_cxx_api.h +425 -24
  16. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A/Headers/onnxruntime_cxx_inline.h +614 -6
  17. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A/Headers/onnxruntime_run_options_config_keys.h +3 -0
  18. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A/Headers/onnxruntime_session_options_config_keys.h +29 -5
  19. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A/Resources/Info.plist +2 -2
  20. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A/onnxruntime +0 -0
  21. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/Headers/onnxruntime_c_api.h +1307 -64
  22. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/Headers/onnxruntime_cxx_api.h +425 -24
  23. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/Headers/onnxruntime_cxx_inline.h +614 -6
  24. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/Headers/onnxruntime_run_options_config_keys.h +3 -0
  25. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/Headers/onnxruntime_session_options_config_keys.h +29 -5
  26. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/Info.plist +2 -2
  27. package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/onnxruntime +0 -0
  28. package/Plugins/macOS/arm64/libonnxruntime.dylib +0 -0
  29. package/Plugins/macOS/x64/libonnxruntime.dylib +0 -0
  30. package/README.md +6 -5
  31. package/Runtime/ManagedProjections.shared.cs +1 -2
  32. package/Runtime/NativeMethods.shared.cs +20 -2
  33. package/Runtime/OrtValue.shared.cs +1 -1
  34. package/Runtime/SessionOptions.shared.cs +10 -0
  35. package/Runtime/Training/NativeTrainingMethods.shared.cs +1 -1
  36. package/package.json +1 -1
@@ -43,6 +43,9 @@ static const char* const kOrtRunOptionsConfigQnnPerfModePostRun = "qnn.htp_perf_
43
43
  // Set RPC control latency for QNN HTP backend
44
44
  static const char* const kOrtRunOptionsConfigQnnRpcControlLatency = "qnn.rpc_control_latency";
45
45
 
46
+ // Set QNN Lora Config File for apply Lora in QNN context binary
47
+ static const char* const kOrtRunOptionsConfigQnnLoraConfig = "qnn.lora_config";
48
+
46
49
  // Set graph annotation id for CUDA EP. Use with enable_cuda_graph=true.
47
50
  // The value should be an integer. If the value is not set, the default value is 0 and
48
51
  // ORT session only captures one cuda graph before another capture is requested.
@@ -10,10 +10,10 @@
10
10
  * "[Area][.[SubArea1].[SubArea2]...].[Keyname]"
11
11
  * Such as "ep.cuda.use_arena"
12
12
  * The Config Key cannot be empty
13
- * The maximum length of the Config Key is 128
13
+ * The maximum length of the Config Key is 1024
14
14
  *
15
15
  * The string format of a SessionOptions Config Value is defined individually for each Config.
16
- * The maximum length of the Config Value is 1024
16
+ * The maximum length of the Config Value is 2048
17
17
  */
18
18
 
19
19
  // Key for disable PrePacking,
@@ -315,11 +315,19 @@ static const char* const kOrtSessionOptionEpContextEmbedMode = "ep.context_embed
315
315
  // in case user need to merge/connect multiple EPContext nodes in one model
316
316
  static const char* const kOrtSessionOptionEpContextNodeNamePrefix = "ep.context_node_name_prefix";
317
317
 
318
- // Share EP related resources across EPs
318
+ // Share EP related resources across sessions
319
319
  static const char* const kOrtSessionOptionShareEpContexts = "ep.share_ep_contexts";
320
320
 
321
- // Use this config when dumping EP context model with an external initializers file
322
- // All initializers will be inside the external data file if specified, otherwise all in Onnx file
321
+ // Stop to share EP related resources across sessions from then on
322
+ static const char* const kOrtSessionOptionStopShareEpContexts = "ep.stop_share_ep_contexts";
323
+
324
+ // Used only for context model generation.
325
+ // This configuration is used when some nodes are partitioned on the CPU EP and those nodes have external initializers.
326
+ // When generating the EP context model, the new model should not rely on the old external data file used by the source ONNX model.
327
+ // Use this setting when dumping the EP context model with an external initializers file.
328
+ // If specified, all initializers will be placed inside the external data file.
329
+ // Otherwise, all initializers will be embedded inside the generated ONNX file.
330
+ // By default, this option is not set, meaning all initializers will be included within the ONNX file.
323
331
  static const char* const kOrtSessionOptionsEpContextModelExternalInitializersFileName =
324
332
  "ep.context_model_external_initializers_file_name";
325
333
 
@@ -340,3 +348,19 @@ static const char* const kOrtSessionOptionsQDQMatMulNBitsAccuracyLevel = "sessio
340
348
  // “Default”: OS determines the scheduling priority and processor performance to service this workload. [Default]
341
349
  // “Efficient”: OS treats this workload is efficiency oriented with low scheduling priority and efficient processor performance.
342
350
  static const char* const kOrtEpDynamicOptionsWorkloadType = "ep.dynamic.workload_type";
351
+
352
+ // Disables model compilation during session initialization.
353
+ //
354
+ // If this option is set to "1", inference session creation will fail with error code ORT_MODEL_REQUIRES_COMPILATION
355
+ // if compilation is required to run the model on any Execution Provider added to the session.
356
+ // Only the following kinds of models are valid when this option is set to "1":
357
+ // - Pre-compiled models that have EPContext nodes for the compiling Execution Providers in the session.
358
+ // - Non-compiled models that run only on non-compiling Execution Providers, like CPU EP.
359
+ //
360
+ // See \href https://onnxruntime.ai/docs/execution-providers/EP-Context-Design.html for details about
361
+ // compiled models with EPContext nodes.
362
+ //
363
+ // Option values:
364
+ // - "0": EP compile is not disabled. [DEFAULT]
365
+ // - "1": EP compile is disabled.
366
+ static const char* const kOrtSessionOptionsDisableModelCompile = "session.disable_model_compile";
@@ -9,9 +9,9 @@
9
9
  <key>CFBundleIdentifier</key>
10
10
  <string>com.microsoft.onnxruntime</string>
11
11
  <key>CFBundleVersion</key>
12
- <string>1.21.0</string>
12
+ <string>1.22.1</string>
13
13
  <key>CFBundleShortVersionString</key>
14
- <string>1.21.0</string>
14
+ <string>1.22.1</string>
15
15
  <key>CFBundleSignature</key>
16
16
  <string>????</string>
17
17
  <key>CFBundlePackageType</key>
package/README.md CHANGED
@@ -23,8 +23,9 @@ Pre-built ONNX Runtime libraries for Unity.
23
23
  ## Tested environment
24
24
 
25
25
  - 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)
27
27
  - 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)
28
29
 
29
30
  ### Execution Providers & Extensions
30
31
 
@@ -70,10 +71,10 @@ Pre-built libraries are available on [NPM](https://www.npmjs.com/package/com.git
70
71
  }
71
72
  ]
72
73
  "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",
77
78
  ... other dependencies
78
79
  }
79
80
  ```
@@ -25,7 +25,7 @@ namespace Microsoft.ML.OnnxRuntime
25
25
  /// </summary>
26
26
  /// <param name="namedOnnxValue"></param>
27
27
  /// <param name="metadata"></param>
28
- /// <returns>OrtValye created accoding to the metadata</returns>
28
+ /// <returns>OrtValue created according to the metadata</returns>
29
29
  internal static OrtValue CreateProjection(NamedOnnxValue namedOnnxValue, NodeMetadata metadata)
30
30
  {
31
31
  OrtValue result;
@@ -191,4 +191,3 @@ namespace Microsoft.ML.OnnxRuntime
191
191
  }
192
192
  }
193
193
  }
194
-
@@ -15,6 +15,7 @@
15
15
 
16
16
  using System;
17
17
  using System.Runtime.InteropServices;
18
+ using static Microsoft.ML.OnnxRuntime.NativeMethods;
18
19
 
19
20
  namespace Microsoft.ML.OnnxRuntime
20
21
  {
@@ -337,6 +338,16 @@ namespace Microsoft.ML.OnnxRuntime
337
338
  public IntPtr CreateLoraAdapterFromArray;
338
339
  public IntPtr ReleaseLoraAdapter;
339
340
  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;
340
351
  }
341
352
 
342
353
  internal static class NativeMethods
@@ -416,6 +427,7 @@ namespace Microsoft.ML.OnnxRuntime
416
427
  OrtReleaseSessionOptions = (DOrtReleaseSessionOptions)Marshal.GetDelegateForFunctionPointer(api_.ReleaseSessionOptions, typeof(DOrtReleaseSessionOptions));
417
428
  OrtCloneSessionOptions = (DOrtCloneSessionOptions)Marshal.GetDelegateForFunctionPointer(api_.CloneSessionOptions, typeof(DOrtCloneSessionOptions));
418
429
  OrtSetSessionExecutionMode = (DOrtSetSessionExecutionMode)Marshal.GetDelegateForFunctionPointer(api_.SetSessionExecutionMode, typeof(DOrtSetSessionExecutionMode));
430
+ OrtSessionOptionsSetLoadCancellationFlag = (DOrtSessionOptionsSetLoadCancellationFlag)Marshal.GetDelegateForFunctionPointer(api_.SessionOptionsSetLoadCancellationFlag, typeof(DOrtSessionOptionsSetLoadCancellationFlag));
419
431
  OrtSetOptimizedModelFilePath = (DOrtSetOptimizedModelFilePath)Marshal.GetDelegateForFunctionPointer(api_.SetOptimizedModelFilePath, typeof(DOrtSetOptimizedModelFilePath));
420
432
  OrtEnableProfiling = (DOrtEnableProfiling)Marshal.GetDelegateForFunctionPointer(api_.EnableProfiling, typeof(DOrtEnableProfiling));
421
433
  OrtDisableProfiling = (DOrtDisableProfiling)Marshal.GetDelegateForFunctionPointer(api_.DisableProfiling, typeof(DOrtDisableProfiling));
@@ -859,7 +871,7 @@ namespace Microsoft.ML.OnnxRuntime
859
871
  /// Creates an instance of OrtSession with provided parameters
860
872
  /// </summary>
861
873
  /// <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>
863
875
  /// <param name="modelSize">Size of the model in bytes</param>
864
876
  /// <param name="sessionOptions">Native SessionOptions instance</param>
865
877
  /// <param name="prepackedWeightsContainer">Native OrtPrepackedWeightsContainer instance</param>
@@ -1037,6 +1049,12 @@ namespace Microsoft.ML.OnnxRuntime
1037
1049
  ExecutionMode execution_mode);
1038
1050
  public static DOrtSetSessionExecutionMode OrtSetSessionExecutionMode;
1039
1051
 
1052
+ [UnmanagedFunctionPointer(CallingConvention.Winapi)]
1053
+ public delegate IntPtr /*(OrtStatus*)*/ DOrtSessionOptionsSetLoadCancellationFlag(IntPtr /*(OrtSessionOptions*)*/ options,
1054
+ bool value);
1055
+ public static DOrtSessionOptionsSetLoadCancellationFlag OrtSessionOptionsSetLoadCancellationFlag;
1056
+
1057
+
1040
1058
  [UnmanagedFunctionPointer(CallingConvention.Winapi)]
1041
1059
  public delegate IntPtr /*(OrtStatus*)*/ DOrtSetOptimizedModelFilePath(IntPtr /* OrtSessionOptions* */ options, byte[] optimizedModelFilepath);
1042
1060
  public static DOrtSetOptimizedModelFilePath OrtSetOptimizedModelFilePath;
@@ -1270,7 +1288,7 @@ namespace Microsoft.ML.OnnxRuntime
1270
1288
  /// </summary>
1271
1289
  /// <param name="options">Native SessionOptions instance</param>
1272
1290
  /// <param name="name">Name of the initializer</param>
1273
- /// <param name="ortValue">Native OrtValue instnce</param>
1291
+ /// <param name="ortValue">Native OrtValue instance</param>
1274
1292
  [UnmanagedFunctionPointer(CallingConvention.Winapi)]
1275
1293
  public delegate IntPtr /*(OrtStatus*)*/ DOrtAddInitializer(IntPtr /*(OrtSessionOptions*)*/ options,
1276
1294
  byte[] /*(const char*)*/ name,
@@ -2,7 +2,7 @@
2
2
  // #define NET8_0_OR_GREATER
3
3
  #endif // UNITY_6000_0_OR_NEWER
4
4
 
5
- // Copyright (c) Microsoft Corporation. All rights reserved.
5
+ // Copyright (c) Microsoft Corporation. All rights reserved.
6
6
  // Licensed under the MIT License.
7
7
 
8
8
  using Microsoft.ML.OnnxRuntime.Tensors;
@@ -814,6 +814,16 @@ namespace Microsoft.ML.OnnxRuntime
814
814
  }
815
815
  private ExecutionMode _executionMode = ExecutionMode.ORT_SEQUENTIAL;
816
816
 
817
+ /// <summary>
818
+ /// Sets the load cancellation flag for the session. Default is set to false.
819
+ /// Provides an opportunity for the user to cancel model loading.
820
+ /// </summary>
821
+ /// <param name="value">true to request cancellation, false to proceed</param>
822
+ public void SetLoadCancellationFlag(bool value)
823
+ {
824
+ NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionOptionsSetLoadCancellationFlag(handle, value));
825
+ }
826
+
817
827
  #endregion
818
828
 
819
829
  #region Private Methods
@@ -76,7 +76,7 @@ namespace Microsoft.ML.OnnxRuntime
76
76
  DOrtGetApi OrtGetApi = (DOrtGetApi)Marshal.GetDelegateForFunctionPointer(NativeMethods.OrtGetApiBase().GetApi, typeof(DOrtGetApi));
77
77
  #endif
78
78
 
79
- const uint ORT_API_VERSION = 21;
79
+ const uint ORT_API_VERSION = 22;
80
80
  #if NETSTANDARD2_0
81
81
  IntPtr ortApiPtr = OrtGetApi(ORT_API_VERSION);
82
82
  api_ = (OrtApi)Marshal.PtrToStructure(ortApiPtr, typeof(OrtApi));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.github.asus4.onnxruntime",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "displayName": "ONNX Runtime",
5
5
  "description": "ONNX Runtime Plugin for Unity",
6
6
  "keywords": [