From e50a807b93252f8c8019d9af048fa03566f9f031 Mon Sep 17 00:00:00 2001 From: sunnycase Date: Tue, 5 Sep 2023 18:46:50 +0800 Subject: [PATCH] Add import ncnn api --- Directory.Packages.props | 2 +- .../Nncase.Modules.StackVM/packages.lock.json | 12 +- src/Nncase.Cli/Commands/Compile.cs | 6 +- src/Nncase.Cli/packages.lock.json | 12 +- src/Nncase.CodeGen/packages.lock.json | 12 +- src/Nncase.Compiler/Compiler.cs | 64 +- src/Nncase.Compiler/CompilerExtensions.cs | 34 + src/Nncase.Compiler/Interop/CApi.cs | 31 +- src/Nncase.Compiler/packages.lock.json | 12 +- src/Nncase.Core/ICompiler.cs | 19 +- src/Nncase.Core/packages.lock.json | 12 +- src/Nncase.Diagnostics/packages.lock.json | 12 +- src/Nncase.EGraph/packages.lock.json | 12 +- src/Nncase.Evaluator/packages.lock.json | 12 +- src/Nncase.Graph/packages.lock.json | 12 +- src/Nncase.IO/packages.lock.json | 12 +- src/Nncase.Importer/Importers.cs | 15 + src/Nncase.Importer/Ncnn/NcnnImporter.cs | 157 +++++ src/Nncase.Importer/Ncnn/NcnnModel.cs | 108 +++ src/Nncase.Importer/Ncnn/ParamDict.cs | 106 +++ src/Nncase.Importer/packages.lock.json | 12 +- .../Rules/ShapeBucket/MergeCallToFusion.cs | 1 + src/Nncase.Passes/packages.lock.json | 12 +- src/Nncase.Quantization/packages.lock.json | 12 +- src/Nncase.Schedule/packages.lock.json | 12 +- src/Nncase.Simulator/packages.lock.json | 12 +- src/Nncase.Targets/packages.lock.json | 12 +- src/Nncase.Tests.TestFixture/ModelRunner.cs | 6 +- .../Nncase.Tests.TestFixture.csproj | 1 + .../packages.lock.json | 628 +++++++++++++----- src/Nncase.Tests/packages.lock.json | 13 +- third_party/onnx/packages.lock.json | 12 +- third_party/tflite/packages.lock.json | 12 +- .../Nncase.SourceGenerator/packages.lock.json | 12 +- tools/stackvm_gen/IsaGen/packages.lock.json | 12 +- 35 files changed, 1097 insertions(+), 334 deletions(-) create mode 100644 src/Nncase.Compiler/CompilerExtensions.cs create mode 100644 src/Nncase.Importer/Ncnn/NcnnImporter.cs create mode 100644 src/Nncase.Importer/Ncnn/NcnnModel.cs create mode 100644 src/Nncase.Importer/Ncnn/ParamDict.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 1aad575e5f..68ef98f319 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -49,7 +49,7 @@ - + diff --git a/modules/Nncase.Modules.StackVM/packages.lock.json b/modules/Nncase.Modules.StackVM/packages.lock.json index 3f4ecb96a0..b69bdc40f8 100644 --- a/modules/Nncase.Modules.StackVM/packages.lock.json +++ b/modules/Nncase.Modules.StackVM/packages.lock.json @@ -4,11 +4,11 @@ "net7.0": { "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "Google.OrTools.runtime.linux-arm64": { @@ -103,8 +103,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.Cli/Commands/Compile.cs b/src/Nncase.Cli/Commands/Compile.cs index 3110b7dcf7..c546a7e3d8 100644 --- a/src/Nncase.Cli/Commands/Compile.cs +++ b/src/Nncase.Cli/Commands/Compile.cs @@ -144,11 +144,7 @@ private async Task RunAsync(CliCompileOptions cliOptions, IHost host) var target = CompilerServices.GetTarget(cliOptions.Target); using var compileSession = CompileSession.Create(target, compileOptions); var compiler = compileSession.Compiler; - IRModule module; - using (var model_stream = File.OpenRead(compileOptions.InputFile)) - { - module = await compiler.ImportModuleAsync(model_stream); - } + var module = await compiler.ImportModuleAsync(compileOptions.InputFormat, compileOptions.InputFile); // 3. create the calib dataset if (compileOptions.QuantizeOptions.ModelQuantMode == Quantization.ModelQuantMode.UsePTQ) diff --git a/src/Nncase.Cli/packages.lock.json b/src/Nncase.Cli/packages.lock.json index e44016380c..b438ba9cc6 100644 --- a/src/Nncase.Cli/packages.lock.json +++ b/src/Nncase.Cli/packages.lock.json @@ -33,11 +33,11 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "System.CommandLine.Hosting": { @@ -344,8 +344,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.CodeGen/packages.lock.json b/src/Nncase.CodeGen/packages.lock.json index b6602bf240..b618b5504c 100644 --- a/src/Nncase.CodeGen/packages.lock.json +++ b/src/Nncase.CodeGen/packages.lock.json @@ -10,11 +10,11 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "Microsoft.Extensions.Configuration.Abstractions": { @@ -53,8 +53,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.Compiler/Compiler.cs b/src/Nncase.Compiler/Compiler.cs index 74eccd2190..9a6ed86957 100644 --- a/src/Nncase.Compiler/Compiler.cs +++ b/src/Nncase.Compiler/Compiler.cs @@ -47,27 +47,22 @@ public Compiler(CompileSession compileSession, IModelBuilder modelBuilder, IDump /// public void ImportIRModule(IRModule module) => _module = module; - public async Task ImportModuleAsync(Stream content) + public Task ImportTFLiteModuleAsync(Stream content) { - var module = ImportModel(content); - if (_dumpper.IsEnabled(DumpFlags.Compile)) - { - _dumpper.DumpModule(module, "IRImport"); - } - - var preprocess_option = _compileSession.CompileOptions; - - await RunPassAsync(pmg => BroadcastOutputNamesAfterImportPass(pmg), "BroadcastOutputNamesAfterImport"); - await RunPassAsync(pmg => pmg.Add(), "ShapeInferAfterImport"); - await RunPassAsync(pmg => AddPreAndPostProcess(pmg), "AddPreAndPostProcessAfterImport"); + var module = Importers.ImportTFLite(content, _compileSession); + return InitializeModuleAsync(module); + } - var inferSucc = CompilerServices.InferenceType(module.Entry!); - if (!inferSucc) - { - throw new InvalidOperationException("InferShape Failed For This Model!"); - } + public Task ImportOnnxModuleAsync(Stream content) + { + var module = Importers.ImportOnnx(content, _compileSession); + return InitializeModuleAsync(module); + } - return module; + public Task ImportNcnnModuleAsync(Stream ncnnParam, Stream ncnnBin) + { + var module = Importers.ImportNcnn(ncnnParam, ncnnBin, _compileSession); + return InitializeModuleAsync(module); } public void BroadcastOutputNamesAfterImportPass(IPassManager passManager) @@ -248,6 +243,28 @@ public void Gencode(Stream output) linkedModel.Serialize(output); } + private async Task InitializeModuleAsync(IRModule module) + { + if (_dumpper.IsEnabled(DumpFlags.Compile)) + { + _dumpper.DumpModule(module, "IRImport"); + } + + var preprocess_option = _compileSession.CompileOptions; + + await RunPassAsync(pmg => BroadcastOutputNamesAfterImportPass(pmg), "BroadcastOutputNamesAfterImport"); + await RunPassAsync(pmg => pmg.Add(), "ShapeInferAfterImport"); + await RunPassAsync(pmg => AddPreAndPostProcess(pmg), "AddPreAndPostProcessAfterImport"); + + var inferSucc = CompilerServices.InferenceType(module.Entry!); + if (!inferSucc) + { + throw new InvalidOperationException("InferShape Failed For This Model!"); + } + + return module; + } + private void RegisterTargetIndependQuantPass(IPassManager passManager) { var quantMode = _compileSession.CompileOptions.QuantizeOptions.ModelQuantMode; @@ -261,17 +278,6 @@ private void RegisterTargetIndependQuantPass(IPassManager passManager) } } - private IRModule ImportModel(Stream content) - { - _module = _compileSession.CompileOptions.InputFormat switch - { - "tflite" => Importers.ImportTFLite(content, _compileSession), - "onnx" => Importers.ImportOnnx(content, _compileSession), - var inputFormat => throw new NotImplementedException($"Not Implement {inputFormat} Importer!"), - }; - return _module; - } - private async Task RunPassAsync(Action register, string name) { var newName = $"{_runPassCount++}_" + name; diff --git a/src/Nncase.Compiler/CompilerExtensions.cs b/src/Nncase.Compiler/CompilerExtensions.cs new file mode 100644 index 0000000000..7963707638 --- /dev/null +++ b/src/Nncase.Compiler/CompilerExtensions.cs @@ -0,0 +1,34 @@ +// Copyright (c) Canaan Inc. All rights reserved. +// Licensed under the Apache license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Nncase.IR; + +namespace Nncase; + +public static class CompilerExtensions +{ + public static async Task ImportModuleAsync(this ICompiler compiler, string modelFormat, string fileName) + { + using var fileStream = File.OpenRead(fileName); + switch (modelFormat.ToUpperInvariant()) + { + case "TFLITE": + return await compiler.ImportTFLiteModuleAsync(fileStream); + case "ONNX": + return await compiler.ImportOnnxModuleAsync(fileStream); + case "NCNN": + { + using var binStream = File.OpenRead(Path.ChangeExtension(fileName, "bin")); + return await compiler.ImportNcnnModuleAsync(fileStream, binStream); + } + + default: + throw new NotSupportedException($"Unsupported model format: {modelFormat}"); + } + } +} diff --git a/src/Nncase.Compiler/Interop/CApi.cs b/src/Nncase.Compiler/Interop/CApi.cs index 88032210b3..3ce2d0e289 100644 --- a/src/Nncase.Compiler/Interop/CApi.cs +++ b/src/Nncase.Compiler/Interop/CApi.cs @@ -63,7 +63,9 @@ public unsafe struct CApiMT public delegate* unmanaged CompileSessionCreatePtr; public delegate* unmanaged CompileSessionGetCompilerPtr; public delegate* unmanaged CompilerInitializePtr; - public delegate* unmanaged CompilerImportModulePtr; + public delegate* unmanaged CompilerImportTFLiteModulePtr; + public delegate* unmanaged CompilerImportOnnxModulePtr; + public delegate* unmanaged CompilerImportNcnnModulePtr; public delegate* unmanaged CompilerCompilePtr; public delegate* unmanaged CompilerGencodePtr; public delegate* unmanaged DataTypeFromTypeCodePtr; @@ -131,7 +133,9 @@ public static void Initialize(CApiMT* mt) mt->CompileSessionCreatePtr = &CompileSessionCreate; mt->CompileSessionGetCompilerPtr = &CompileSessionGetCompiler; mt->CompilerInitializePtr = &CompilerInitialize; - mt->CompilerImportModulePtr = &CompilerImportModule; + mt->CompilerImportTFLiteModulePtr = &CompilerImportTFLiteModule; + mt->CompilerImportOnnxModulePtr = &CompilerImportOnnxModule; + mt->CompilerImportNcnnModulePtr = &CompilerImportNcnnModule; mt->CompilerCompilePtr = &CompilerCompile; mt->CompilerGencodePtr = &CompilerGencode; mt->DataTypeFromTypeCodePtr = &DataTypeFromTypeCode; @@ -395,11 +399,30 @@ private static void CompilerInitialize() } [UnmanagedCallersOnly] - private static IntPtr CompilerImportModule(IntPtr compilerHandle, IntPtr streamHandle) + private static IntPtr CompilerImportTFLiteModule(IntPtr compilerHandle, IntPtr streamHandle) { var compiler = Get(compilerHandle); var stream = Get(streamHandle); - var module = compiler.ImportModuleAsync(stream).Result; + var module = compiler.ImportTFLiteModuleAsync(stream).Result; + return GCHandle.ToIntPtr(GCHandle.Alloc(module)); + } + + [UnmanagedCallersOnly] + private static IntPtr CompilerImportOnnxModule(IntPtr compilerHandle, IntPtr streamHandle) + { + var compiler = Get(compilerHandle); + var stream = Get(streamHandle); + var module = compiler.ImportOnnxModuleAsync(stream).Result; + return GCHandle.ToIntPtr(GCHandle.Alloc(module)); + } + + [UnmanagedCallersOnly] + private static IntPtr CompilerImportNcnnModule(IntPtr compilerHandle, IntPtr ncnnParamHandle, IntPtr ncnnBinHandle) + { + var compiler = Get(compilerHandle); + var ncnnParam = Get(ncnnParamHandle); + var ncnnBin = Get(ncnnBinHandle); + var module = compiler.ImportNcnnModuleAsync(ncnnParam, ncnnBin).Result; return GCHandle.ToIntPtr(GCHandle.Alloc(module)); } diff --git a/src/Nncase.Compiler/packages.lock.json b/src/Nncase.Compiler/packages.lock.json index 5e1125683e..639bb6a9bc 100644 --- a/src/Nncase.Compiler/packages.lock.json +++ b/src/Nncase.Compiler/packages.lock.json @@ -49,11 +49,11 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "Google.OrTools.runtime.linux-arm64": { @@ -350,8 +350,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.Core/ICompiler.cs b/src/Nncase.Core/ICompiler.cs index e49afabf9d..2368b4a7df 100644 --- a/src/Nncase.Core/ICompiler.cs +++ b/src/Nncase.Core/ICompiler.cs @@ -16,11 +16,26 @@ namespace Nncase; public interface ICompiler { /// - /// Import DL model as ir module. + /// Import TFLite model as ir module. /// /// Model content. /// Imported ir module. - Task ImportModuleAsync(Stream content); + Task ImportTFLiteModuleAsync(Stream content); + + /// + /// Import Onnx model as ir module. + /// + /// Model content. + /// Imported ir module. + Task ImportOnnxModuleAsync(Stream content); + + /// + /// Import Ncnn model as ir module. + /// + /// Ncnn param stream. + /// Ncnn bin stream. + /// Imported ir module. + Task ImportNcnnModuleAsync(Stream ncnnParam, Stream ncnnBin); /// /// import ir module into compiler. diff --git a/src/Nncase.Core/packages.lock.json b/src/Nncase.Core/packages.lock.json index 6d48777d94..b2543377b5 100644 --- a/src/Nncase.Core/packages.lock.json +++ b/src/Nncase.Core/packages.lock.json @@ -60,11 +60,11 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "System.Reactive": { @@ -109,8 +109,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.Diagnostics/packages.lock.json b/src/Nncase.Diagnostics/packages.lock.json index b3f4cb2588..93fabe1e48 100644 --- a/src/Nncase.Diagnostics/packages.lock.json +++ b/src/Nncase.Diagnostics/packages.lock.json @@ -4,11 +4,11 @@ "net7.0": { "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "Microsoft.Extensions.Configuration.Abstractions": { @@ -47,8 +47,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.EGraph/packages.lock.json b/src/Nncase.EGraph/packages.lock.json index 7004606929..83470253e5 100644 --- a/src/Nncase.EGraph/packages.lock.json +++ b/src/Nncase.EGraph/packages.lock.json @@ -41,11 +41,11 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "Google.OrTools.runtime.linux-arm64": { @@ -140,8 +140,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.Evaluator/packages.lock.json b/src/Nncase.Evaluator/packages.lock.json index 78887df6a5..78fc35c9da 100644 --- a/src/Nncase.Evaluator/packages.lock.json +++ b/src/Nncase.Evaluator/packages.lock.json @@ -13,11 +13,11 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "libortki": { @@ -87,8 +87,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.Graph/packages.lock.json b/src/Nncase.Graph/packages.lock.json index 4ece9f52bb..a439ce21fd 100644 --- a/src/Nncase.Graph/packages.lock.json +++ b/src/Nncase.Graph/packages.lock.json @@ -4,11 +4,11 @@ "net7.0": { "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "libortki": { @@ -78,8 +78,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.IO/packages.lock.json b/src/Nncase.IO/packages.lock.json index ef24cbccbb..eb0c4a8b7c 100644 --- a/src/Nncase.IO/packages.lock.json +++ b/src/Nncase.IO/packages.lock.json @@ -4,17 +4,17 @@ "net7.0": { "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" } } } diff --git a/src/Nncase.Importer/Importers.cs b/src/Nncase.Importer/Importers.cs index dabfef37a9..1c3cce1459 100644 --- a/src/Nncase.Importer/Importers.cs +++ b/src/Nncase.Importer/Importers.cs @@ -8,6 +8,7 @@ using System.Text; using System.Threading.Tasks; using Nncase.Importer; +using Nncase.Importer.Ncnn; using Nncase.Importer.TFLite; using Nncase.IR; @@ -45,4 +46,18 @@ public static IRModule ImportOnnx(Stream onnx, CompileSession compileSession) var importer = new OnnxImporter(onnx, compileSession); return importer.Import(); } + + /// + /// Import ncnn model. + /// + /// Ncnn param stream. + /// Ncnn bin stream. + /// compile session. + /// Imported IR module. + public static IRModule ImportNcnn(Stream ncnnParam, Stream ncnnBin, CompileSession compileSession) + { + compileSession.CompileOptions.ModelLayout = "NCHW"; + var importer = new NcnnImporter(ncnnParam, ncnnBin, compileSession); + return importer.Import(); + } } diff --git a/src/Nncase.Importer/Ncnn/NcnnImporter.cs b/src/Nncase.Importer/Ncnn/NcnnImporter.cs new file mode 100644 index 0000000000..d5a2b8add7 --- /dev/null +++ b/src/Nncase.Importer/Ncnn/NcnnImporter.cs @@ -0,0 +1,157 @@ +// Copyright (c) Canaan Inc. All rights reserved. +// Licensed under the Apache license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using FlatBuffers; +using NetFabric.Hyperlinq; +using Nncase.IR; +using Nncase.IR.F; +using Nncase.IR.Math; +using Nncase.IR.Tensors; +using Math = System.Math; +using Tuple = Nncase.IR.Tuple; + +namespace Nncase.Importer.Ncnn; + +/// +/// Ncnn importer. +/// +public sealed partial class NcnnImporter : BaseImporter +{ + private static readonly Dictionary _typeMap = new() + { + { tflite.TensorType.BOOL, DataTypes.Boolean }, + { tflite.TensorType.FLOAT16, DataTypes.Float16 }, + { tflite.TensorType.FLOAT32, DataTypes.Float32 }, + { tflite.TensorType.FLOAT64, DataTypes.Float64 }, + { tflite.TensorType.INT16, DataTypes.Int16 }, + { tflite.TensorType.INT32, DataTypes.Int32 }, + { tflite.TensorType.INT64, DataTypes.Int64 }, + { tflite.TensorType.INT8, DataTypes.Int8 }, + { tflite.TensorType.STRING, DataTypes.Utf8Char }, + { tflite.TensorType.UINT32, DataTypes.UInt32 }, + { tflite.TensorType.UINT64, DataTypes.UInt64 }, + { tflite.TensorType.UINT8, DataTypes.UInt8 }, + }; + + private readonly NcnnModel _model; + private readonly Dictionary _outputTensors = new Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// Ncnn param stream. + /// Ncnn bin stream. + /// Compile session. + public NcnnImporter(Stream ncnnParam, Stream ncnnBin, CompileSession compileSession) + : base(compileSession) + { + _model = NcnnModel.ParseFromStream(ncnnParam); + } + + /// + protected override (IEnumerable Inputs, Dictionary VarMap) CreateInputs() + { + throw new NotImplementedException(); + } + + protected override void ConvertOp() + { + throw new NotImplementedException(); + } + + protected override Expr CreateOutputs() + { + throw new NotImplementedException(); + } + + /// + /// Create IR type from tflite shape and tensor type. + /// + /// Tensor. + /// Created IR type. + private static TensorType GetIRType(tflite.Tensor tensor) + { + var shape = GetShapeArray(tensor); + var dataType = GetDataType(tensor.Type); + if (shape.Length == 0) + { + return TensorType.Scalar(dataType); + } + else + { + return new TensorType(dataType, new Shape(shape)); + } + } + + private static DataType GetDataType(tflite.TensorType type) + { + if (_typeMap.TryGetValue(type, out var dataType)) + { + return dataType; + } + + throw new NotSupportedException($"Unsupported tflite tensor type: {type}."); + } + + private static Dimension[] GetShapeArray(tflite.Tensor tensor) + { + if (tensor.ShapeSignatureLength == 0) + { + return tensor.GetShapeArray().Select(x => new Dimension(x)).ToArray(); + } + + return Enumerable.Range(0, tensor.ShapeLength).Select(i => + tensor.ShapeSignature(i) < 0 ? Dimension.Unknown : tensor.Shape(i)).ToArray(); + } + + private void Visit(in tflite.Operator op) + { + throw new NotImplementedException(); + } + + private List? GetInputQuantParams(in tflite.Operator op, int index) + { + throw new NotImplementedException(); + } + + private List? GetOutputQuantParams(in tflite.Operator op, int index) + { + throw new NotImplementedException(); + } + + private Expr GetInputExprs(in tflite.Operator op, int index) + { + throw new NotImplementedException(); + } + + private (Expr Expr0, Expr Expr1) GetInputExprs(in tflite.Operator op, int index0, int index1) => + (GetInputExprs(op, index0), GetInputExprs(op, index1)); + + private tflite.Tensor GetTfliteTensor(int id) + { + throw new NotImplementedException(); + } + + private tflite.Tensor GetInputTensor(in tflite.Operator op, int index) + { + return GetTfliteTensor(op.Inputs(index)); + } + + private tflite.Tensor GetOutputTensor(in tflite.Operator op, int index) + { + return GetTfliteTensor(op.Outputs(index)); + } + + private Shape GetTensorShape(in tflite.Tensor tensor) + { + return GetShapeArray(tensor); + } +} diff --git a/src/Nncase.Importer/Ncnn/NcnnModel.cs b/src/Nncase.Importer/Ncnn/NcnnModel.cs new file mode 100644 index 0000000000..488e191ad4 --- /dev/null +++ b/src/Nncase.Importer/Ncnn/NcnnModel.cs @@ -0,0 +1,108 @@ +// Copyright (c) Canaan Inc. All rights reserved. +// Licensed under the Apache license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Nncase.IR; + +namespace Nncase.Importer.Ncnn; + +internal class NcnnTensor +{ + public string Name { get; set; } = string.Empty; + + public Shape ShapeHint { get; set; } = Shape.Unranked; + + public override string ToString() => $"{Name}: {ShapeHint}"; +} + +internal class NcnnLayer +{ + public NcnnLayer(string type, string name, int bottomCount, int topCount) + { + Type = type; + Name = name; + Bottoms = new NcnnTensor[bottomCount]; + Tops = new NcnnTensor[topCount]; + } + + public string Type { get; } + + public string Name { get; } + + public NcnnTensor[] Bottoms { get; } + + public NcnnTensor[] Tops { get; } + + public ParamDict ParamDict { get; } = new(); + + public override string ToString() => $"[{Type}] {Name}"; +} + +internal class NcnnModel +{ + public static readonly int ExpectedMagic = 7767517; + + public NcnnModel(int magic, IReadOnlyList layers) + { + Magic = magic; + Layers = layers; + } + + public int Magic { get; } + + public IReadOnlyList Layers { get; } + + public static NcnnModel ParseFromStream(Stream stream) + { + using var reader = new StreamReader(stream, leaveOpen: true); + if (reader.ReadLine() is not string magicStr) + { + throw new InvalidDataException("parse magic failed"); + } + + if (reader.ReadLine()?.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries) is not [var layerCountStr, var blobCountStr]) + { + throw new InvalidDataException("parse layer_count or blob_count failed"); + } + + var magic = int.Parse(magicStr); + if (magic != ExpectedMagic) + { + throw new InvalidDataException("param is too old, please regenerate"); + } + + var layerCount = int.Parse(layerCountStr); + var blobCount = int.Parse(blobCountStr); + if (layerCount <= 0 || blobCount <= 0) + { + throw new InvalidDataException("invalid layer_count or blob_count"); + } + + var layers = new NcnnLayer[layerCount]; + foreach (ref var layer in layers.AsSpan()) + { + var fields = reader.ReadLine()!.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); + layer = new NcnnLayer(fields[0], fields[1], int.Parse(fields[2]), int.Parse(fields[3])); + + int cntFieldIndex = 4; + foreach (ref var bottom in layer.Bottoms.AsSpan()) + { + bottom = new NcnnTensor { Name = fields[cntFieldIndex++] }; + } + + foreach (ref var top in layer.Tops.AsSpan()) + { + top = new NcnnTensor { Name = fields[cntFieldIndex++] }; + } + + layer.ParamDict.LoadFrom(fields.AsSpan(cntFieldIndex)); + } + + return new NcnnModel(magic, layers); + } +} diff --git a/src/Nncase.Importer/Ncnn/ParamDict.cs b/src/Nncase.Importer/Ncnn/ParamDict.cs new file mode 100644 index 0000000000..ca957c77ce --- /dev/null +++ b/src/Nncase.Importer/Ncnn/ParamDict.cs @@ -0,0 +1,106 @@ +// Copyright (c) Canaan Inc. All rights reserved. +// Licensed under the Apache license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Google.Protobuf.WellKnownTypes; +using Nncase.IR; + +namespace Nncase.Importer.Ncnn; + +internal enum ParamKind +{ + Null, + IntOrFloat, + Int, + Float, + ArrayOfIntOrFloat, + ArrayOfInt, + ArrayOfFloat, +} + +internal struct ParamValue +{ + public ParamKind Kind; + + public int IntValue; + + public float FloatValue; + + public Tensor? TensorValue; +} + +internal class ParamDict +{ + public static readonly int NcnnMaxParamCount = 32; + + public void LoadFrom(ReadOnlySpan fields) + { + foreach (var field in fields) + { + if (field.Split('=', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries) is not [var idStr, var valueStr]) + { + break; + } + + var id = int.Parse(idStr); + if (id >= NcnnMaxParamCount) + { + throw new InvalidDataException($"id < NCNN_MAX_PARAM_COUNT failed (id={id}, NCNN_MAX_PARAM_COUNT={NcnnMaxParamCount})"); + } + + var paramValue = default(ParamValue); + var isArray = id <= -23300; + var isFloat = valueStr.AsSpan().IndexOfAny('.', 'e', 'E') != -1; + if (isArray) + { + var elements = valueStr.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); + if (elements == null || elements.Length == 0) + { + throw new InvalidDataException("ParamDict read array length failed"); + } + + var length = int.Parse(elements[0]); + if (isFloat) + { + var value = new Tensor(length); + for (var i = 1; i < length; i++) + { + value[i] = float.Parse(elements[i + 1]); + } + + paramValue.Kind = ParamKind.ArrayOfFloat; + paramValue.TensorValue = value; + } + else + { + var value = new Tensor(length); + for (var i = 1; i < length; i++) + { + value[i] = int.Parse(elements[i + 1]); + } + + paramValue.Kind = ParamKind.ArrayOfInt; + paramValue.TensorValue = value; + } + } + else + { + if (isFloat) + { + paramValue.Kind = ParamKind.Float; + paramValue.FloatValue = float.Parse(valueStr); + } + else + { + paramValue.Kind = ParamKind.Int; + paramValue.IntValue = int.Parse(valueStr); + } + } + } + } +} diff --git a/src/Nncase.Importer/packages.lock.json b/src/Nncase.Importer/packages.lock.json index e903580b70..845d535c0e 100644 --- a/src/Nncase.Importer/packages.lock.json +++ b/src/Nncase.Importer/packages.lock.json @@ -22,11 +22,11 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "Microsoft.Bcl.AsyncInterfaces": { @@ -85,8 +85,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.Passes/Rules/ShapeBucket/MergeCallToFusion.cs b/src/Nncase.Passes/Rules/ShapeBucket/MergeCallToFusion.cs index 5118cb44e9..c0c1446bf9 100644 --- a/src/Nncase.Passes/Rules/ShapeBucket/MergeCallToFusion.cs +++ b/src/Nncase.Passes/Rules/ShapeBucket/MergeCallToFusion.cs @@ -15,6 +15,7 @@ using static Nncase.Utilities.ReplaceUtility; namespace Nncase.Passes.Rules.ShapeBucket; + public abstract class MergeFusionBase : RewriteRule { protected int Counter { get; set; } diff --git a/src/Nncase.Passes/packages.lock.json b/src/Nncase.Passes/packages.lock.json index 4ceb9735d5..a910d30fa5 100644 --- a/src/Nncase.Passes/packages.lock.json +++ b/src/Nncase.Passes/packages.lock.json @@ -4,11 +4,11 @@ "net7.0": { "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "Google.OrTools.runtime.linux-arm64": { @@ -103,8 +103,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.Quantization/packages.lock.json b/src/Nncase.Quantization/packages.lock.json index b128fc2fc3..ccc991e111 100644 --- a/src/Nncase.Quantization/packages.lock.json +++ b/src/Nncase.Quantization/packages.lock.json @@ -19,11 +19,11 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "System.Linq.Async": { @@ -132,8 +132,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.Schedule/packages.lock.json b/src/Nncase.Schedule/packages.lock.json index b3f4cb2588..93fabe1e48 100644 --- a/src/Nncase.Schedule/packages.lock.json +++ b/src/Nncase.Schedule/packages.lock.json @@ -4,11 +4,11 @@ "net7.0": { "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "Microsoft.Extensions.Configuration.Abstractions": { @@ -47,8 +47,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.Simulator/packages.lock.json b/src/Nncase.Simulator/packages.lock.json index b3f4cb2588..93fabe1e48 100644 --- a/src/Nncase.Simulator/packages.lock.json +++ b/src/Nncase.Simulator/packages.lock.json @@ -4,11 +4,11 @@ "net7.0": { "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "Microsoft.Extensions.Configuration.Abstractions": { @@ -47,8 +47,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.Targets/packages.lock.json b/src/Nncase.Targets/packages.lock.json index 5d676dd547..4a17a6364e 100644 --- a/src/Nncase.Targets/packages.lock.json +++ b/src/Nncase.Targets/packages.lock.json @@ -4,11 +4,11 @@ "net7.0": { "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "Microsoft.Extensions.Configuration.Abstractions": { @@ -47,8 +47,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/src/Nncase.Tests.TestFixture/ModelRunner.cs b/src/Nncase.Tests.TestFixture/ModelRunner.cs index 76f61721ca..f11934abf0 100644 --- a/src/Nncase.Tests.TestFixture/ModelRunner.cs +++ b/src/Nncase.Tests.TestFixture/ModelRunner.cs @@ -42,9 +42,9 @@ public async Task TestRunner() CompileOptions.QuantizeOptions.UseSquant = false; CompileOptions.DumpFlags = DumpFlags.Rewrite; - using var file = File.OpenRead(ModelPath()); - CompileOptions.InputFormat = Path.GetExtension(file.Name).Trim('.'); - var m = await CompileSession.Compiler.ImportModuleAsync(file); + var modelPath = ModelPath(); + CompileOptions.InputFormat = Path.GetExtension(modelPath).Trim('.'); + var m = await CompileSession.Compiler.ImportModuleAsync(CompileOptions.InputFormat, modelPath); var types = m.Entry!.ParameterTypes.Select(type => (TensorType)type!).ToArray(); var shapes = types.Select(x => x.Shape).ToArray(); var isDynamic = shapes.Any(shape => !shape.IsFixed); diff --git a/src/Nncase.Tests.TestFixture/Nncase.Tests.TestFixture.csproj b/src/Nncase.Tests.TestFixture/Nncase.Tests.TestFixture.csproj index 3e1336e99c..f5e1c990e7 100644 --- a/src/Nncase.Tests.TestFixture/Nncase.Tests.TestFixture.csproj +++ b/src/Nncase.Tests.TestFixture/Nncase.Tests.TestFixture.csproj @@ -23,6 +23,7 @@ + diff --git a/src/Nncase.Tests.TestFixture/packages.lock.json b/src/Nncase.Tests.TestFixture/packages.lock.json index a42ac54c45..6a4a5d525d 100644 --- a/src/Nncase.Tests.TestFixture/packages.lock.json +++ b/src/Nncase.Tests.TestFixture/packages.lock.json @@ -19,11 +19,11 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "System.Linq.Async": { @@ -134,12 +134,18 @@ "resolved": "6.0.0", "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==" }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" + }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "SS8ce1GYQTkZoOq5bskqQ+m7xiXQjnKRiGfVNZkkX2SX0HpXNRsKnSUaywRRuCje3v2KT9xeacsM3J9/G2exsQ==", + "resolved": "6.0.0", + "contentHash": "tq2wXyh3fL17EMF2bXgRhU7JrbO3on93MRKYxzz4JzzvuGSA1l0W3GI9/tl8EO89TH+KWEymP7bcFway6z9fXg==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "2.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { @@ -152,18 +158,72 @@ }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "Fls0O54Ielz1DiVYpcmiUpeizN1iKGGI5yAWAoShfmUvMcQ8jAGOK1a+DaflHA5hN9IOKvmSos0yewDYAIY0ZA==", + "resolved": "6.0.0", + "contentHash": "b3ErKzND8LIC7o08QAVlKfaEIYEvLJbtmVbFZVBRXeu9YkKfSSzLZfR1SUfQPBIy9mKLhEtJgGYImkcMNaKE0A==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0" + } + }, + "Microsoft.Extensions.Configuration.CommandLine": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "3nL1qCkZ1Oxx14ZTzgo4MmlO7tso7F+TtMZAY2jUAtTLyAcDp+EDjk3RqafoKiNaePyPvvlleEcBxh3b2Hzl1g==", + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0" + } + }, + "Microsoft.Extensions.Configuration.EnvironmentVariables": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "DjYkzqvhiHCq38LW71PcIxXk6nhtV6VySP9yDcSO0goPl7YCU1VG1f2Wbgy58lkA10pWkjHCblZPUyboCB93ZA==", + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0" + } + }, + "Microsoft.Extensions.Configuration.FileExtensions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "V4Dth2cYMZpw3HhGw9XUDIijpI6gN+22LDt0AhufIgOppCUfpWX4483OmN+dFXRJkJLc8Tv0Q8QK+1ingT2+KQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Physical": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + } + }, + "Microsoft.Extensions.Configuration.Json": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "GJGery6QytCzS/BxJ96klgG9in3uH26KcUBbiVG/coNDXCRq6LGVVlUT4vXq34KPuM+R2av+LeYdX9h4IZOCUg==", "dependencies": { - "Microsoft.Extensions.Configuration": "2.1.0" + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.FileExtensions": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "System.Text.Json": "6.0.0" + } + }, + "Microsoft.Extensions.Configuration.UserSecrets": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "lB0Hb2V4+RUHy+LjEcqEr4EcV4RWc9EnjAV2GdtWQEdljQX+R4hGREftI7sInU9okP93pDrJiaj6QUJ6ZsslOA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.Json": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Physical": "6.0.0" } }, "Microsoft.Extensions.DependencyInjection": { "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "gqQviLfuA31PheEGi+XJoZc1bc9H9RsPa9Gq9XuDct7XGWSR9eVXjK5Sg7CSUPhTFHSuxUFY12wcTYLZ4zM1hg==", + "resolved": "6.0.0", + "contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "2.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { @@ -181,27 +241,105 @@ }, "Microsoft.Extensions.FileProviders.Physical": { "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "A9xLomqD4tNFqDfleapx2C14ZcSjCTzn/4Od0W/wBYdlLF2tYDJ204e75HjpWDVTkr03kgdZbM3QZ6ZeDsrBYg==", + "resolved": "6.0.0", + "contentHash": "QvkL7l0nM8udt3gfyu0Vw8bbCXblxaKOl7c2oBfgGy4LCURRaL9XWZX1FWJrQc43oMokVneVxH38iz+bY1sbhg==", "dependencies": { - "Microsoft.Extensions.FileProviders.Abstractions": "2.1.0", - "Microsoft.Extensions.FileSystemGlobbing": "2.1.0" + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileSystemGlobbing": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" } }, "Microsoft.Extensions.FileSystemGlobbing": { "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "JEwwhwbVTEXJu4W4l/FFx7FG9Fh5R8999mZl6qJImjM/LY4DxQsFYzpSkziMdY022n7TQpNUxJlH9bKZc7TqWw==" + "resolved": "6.0.0", + "contentHash": "ip8jnL1aPiaPeKINCqaTEbvBFDmVx9dXQEBZ2HOBRXPD1eabGNqP/bKlsIcp7U2lGxiXd5xIhoFcmY8nM4Hdiw==" }, "Microsoft.Extensions.Logging": { "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "kuZbZMMHb7ibzhLdn9/R1+PAAFKntlF10tOw4loB8VuQkHvSrBE6IzW1rhBLsEdmLXOgi2zFbwcXFrxzSM6ybA==", + "resolved": "6.0.0", + "contentHash": "eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "2.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "2.1.0", - "Microsoft.Extensions.Logging.Abstractions": "2.1.0", - "Microsoft.Extensions.Options": "2.1.0" + "Microsoft.Extensions.DependencyInjection": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "System.Diagnostics.DiagnosticSource": "6.0.0" + } + }, + "Microsoft.Extensions.Logging.Configuration": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "ZDskjagmBAbv+K8rYW9VhjPplhbOE63xUD0DiuydZJwt15dRyoqicYklLd86zzeintUc7AptDkHn+YhhYkYo8A==", + "dependencies": { + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.Binder": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "Microsoft.Extensions.Options.ConfigurationExtensions": "6.0.0" + } + }, + "Microsoft.Extensions.Logging.Console": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "gsqKzOEdsvq28QiXFxagmn1oRB9GeI5GgYCkoybZtQA0IUb7QPwf1WmN3AwJeNIsadTvIFQCiVK0OVIgKfOBGg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging.Configuration": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "System.Text.Json": "6.0.0" + } + }, + "Microsoft.Extensions.Logging.Debug": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "M9g/JixseSZATJE9tcMn9uzoD4+DbSglivFqVx8YkRJ7VVPmnvCEbOZ0AAaxsL1EKyI4cz07DXOOJExxNsUOHw==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0" + } + }, + "Microsoft.Extensions.Logging.EventLog": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "rlo0RxlMd0WtLG3CHI0qOTp6fFn7MvQjlrCjucA31RqmiMFCZkF8CHNbe8O7tbBIyyoLGWB1he9CbaA5iyHthg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "System.Diagnostics.EventLog": "6.0.0" + } + }, + "Microsoft.Extensions.Logging.EventSource": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "BeDyyqt7nkm/nr+Gdk+L8n1tUT/u33VkbXAOesgYSNsxDM9hJ1NOBGoZfj9rCbeD2+9myElI6JOVVFmnzgeWQA==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Json": "6.0.0" + } + }, + "Microsoft.Extensions.Options.ConfigurationExtensions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "bXWINbTn0vC0FYc9GaQTISbxhQLAMrvtbuvD9N6JelEaIS/Pr62wUCinrq5bf1WRBGczt1v4wDhxFtVFNcMdUQ==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.Binder": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" } }, "Microsoft.Extensions.Primitives": { @@ -214,13 +352,13 @@ }, "Microsoft.NETCore.Platforms": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ==" + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" }, "Microsoft.NETCore.Targets": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==" + "resolved": "1.1.0", + "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" }, "Microsoft.Win32.Primitives": { "type": "Transitive", @@ -326,8 +464,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.AppContext": { "type": "Transitive", @@ -344,12 +482,12 @@ }, "System.Collections": { "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "resolved": "4.3.0", + "contentHash": "3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" } }, "System.Collections.Concurrent": { @@ -386,14 +524,22 @@ "System.Text.Encoding": "4.0.11" } }, + "System.Diagnostics.Contracts": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "eelRRbnm+OloiQvp9CXS0ixjNQldjjkHO4iIkR5XH2VIP8sUB/SIpa1TdUW6/+HDcQ+MlhP3pNa1u5SbzYuWGA==", + "dependencies": { + "System.Runtime": "4.3.0" + } + }, "System.Diagnostics.Debug": { "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "resolved": "4.3.0", + "contentHash": "ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" } }, "System.Diagnostics.DiagnosticSource": { @@ -404,6 +550,11 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, + "System.Diagnostics.EventLog": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==" + }, "System.Diagnostics.Tools": { "type": "Transitive", "resolved": "4.0.1", @@ -426,12 +577,12 @@ }, "System.Globalization": { "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "resolved": "4.3.0", + "contentHash": "kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" } }, "System.Globalization.Calendars": { @@ -460,14 +611,14 @@ }, "System.IO": { "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "resolved": "4.3.0", + "contentHash": "3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0", - "System.Text.Encoding": "4.0.11", - "System.Threading.Tasks": "4.0.11" + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" } }, "System.IO.Compression": { @@ -532,38 +683,53 @@ }, "System.Linq": { "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "resolved": "4.3.0", + "contentHash": "5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0" + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" } }, "System.Linq.Expressions": { "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Globalization": "4.0.11", - "System.IO": "4.1.0", - "System.Linq": "4.1.0", - "System.ObjectModel": "4.0.12", - "System.Reflection": "4.1.0", - "System.Reflection.Emit": "4.0.1", - "System.Reflection.Emit.ILGeneration": "4.0.1", - "System.Reflection.Emit.Lightweight": "4.0.1", - "System.Reflection.Extensions": "4.0.1", - "System.Reflection.Primitives": "4.0.1", - "System.Reflection.TypeExtensions": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Threading": "4.0.11" + "resolved": "4.3.0", + "contentHash": "PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Linq.Queryable": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "In1Bmmvl/j52yPu3xgakQSI0YIckPUr870w4K5+Lak3JCCa8hl+my65lABOuKfYs4ugmZy25ScFerC4nz8+b6g==", + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" } }, "System.Memory": { @@ -630,110 +796,110 @@ }, "System.ObjectModel": { "type": "Transitive", - "resolved": "4.0.12", - "contentHash": "tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "resolved": "4.3.0", + "contentHash": "bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Threading": "4.0.11" + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" } }, "System.Reflection": { "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "resolved": "4.3.0", + "contentHash": "KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.IO": "4.1.0", - "System.Reflection.Primitives": "4.0.1", - "System.Runtime": "4.1.0" + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" } }, "System.Reflection.Emit": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "resolved": "4.3.0", + "contentHash": "228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", "dependencies": { - "System.IO": "4.1.0", - "System.Reflection": "4.1.0", - "System.Reflection.Emit.ILGeneration": "4.0.1", - "System.Reflection.Primitives": "4.0.1", - "System.Runtime": "4.1.0" + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" } }, "System.Reflection.Emit.ILGeneration": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "resolved": "4.3.0", + "contentHash": "59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", "dependencies": { - "System.Reflection": "4.1.0", - "System.Reflection.Primitives": "4.0.1", - "System.Runtime": "4.1.0" + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" } }, "System.Reflection.Emit.Lightweight": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "resolved": "4.3.0", + "contentHash": "oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", "dependencies": { - "System.Reflection": "4.1.0", - "System.Reflection.Emit.ILGeneration": "4.0.1", - "System.Reflection.Primitives": "4.0.1", - "System.Runtime": "4.1.0" + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" } }, "System.Reflection.Extensions": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "resolved": "4.3.0", + "contentHash": "rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Reflection": "4.1.0", - "System.Runtime": "4.1.0" + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" } }, "System.Reflection.Primitives": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "resolved": "4.3.0", + "contentHash": "5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" } }, "System.Reflection.TypeExtensions": { "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "resolved": "4.3.0", + "contentHash": "7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", "dependencies": { - "System.Reflection": "4.1.0", - "System.Runtime": "4.1.0" + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" } }, "System.Resources.ResourceManager": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "resolved": "4.3.0", + "contentHash": "/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Globalization": "4.0.11", - "System.Reflection": "4.1.0", - "System.Runtime": "4.1.0" + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" } }, "System.Runtime": { "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==", + "resolved": "4.3.0", + "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1" + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0" } }, "System.Runtime.CompilerServices.Unsafe": { @@ -743,12 +909,12 @@ }, "System.Runtime.Extensions": { "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "resolved": "4.3.0", + "contentHash": "guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" } }, "System.Runtime.Handles": { @@ -944,12 +1110,12 @@ }, "System.Text.Encoding": { "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "resolved": "4.3.0", + "contentHash": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" } }, "System.Text.Encoding.Extensions": { @@ -963,6 +1129,23 @@ "System.Text.Encoding": "4.0.11" } }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "zaJsHfESQvJ11vbXnNlkrR46IaMULk/gHxYsJphzSF+07kTjPHv+Oc14w6QEOfo3Q4hqLJgStUaYB9DBl0TmWg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "6.0.0" + } + }, "System.Text.RegularExpressions": { "type": "Transitive", "resolved": "4.1.0", @@ -978,21 +1161,21 @@ }, "System.Threading": { "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "resolved": "4.3.0", + "contentHash": "VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", "dependencies": { - "System.Runtime": "4.1.0", - "System.Threading.Tasks": "4.0.11" + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" } }, "System.Threading.Tasks": { "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "resolved": "4.3.0", + "contentHash": "LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" } }, "System.Threading.Tasks.Extensions": { @@ -1010,6 +1193,11 @@ "System.Runtime": "4.1.0" } }, + "System.ValueTuple": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==" + }, "System.Xml.ReaderWriter": { "type": "Transitive", "resolved": "4.0.11", @@ -1085,6 +1273,25 @@ "Nncase.IO": "[1.0.0, )" } }, + "nncase.compiler": { + "type": "Project", + "dependencies": { + "DryIoc.Microsoft.DependencyInjection": "[6.1.0, )", + "DryIoc.dll": "[5.3.1, )", + "Microsoft.Extensions.Hosting": "[6.0.0, )", + "Nncase.CodeGen": "[1.0.0, )", + "Nncase.Core": "[1.0.0, )", + "Nncase.Diagnostics": "[1.0.0, )", + "Nncase.EGraph": "[1.0.0, )", + "Nncase.Evaluator": "[1.0.0, )", + "Nncase.Graph": "[1.0.0, )", + "Nncase.Importer": "[1.0.0, )", + "Nncase.Modules.StackVM": "[1.0.0, )", + "Nncase.Passes": "[1.0.0, )", + "Nncase.Quantization": "[1.0.0, )", + "Nncase.Simulator": "[1.0.0, )" + } + }, "nncase.core": { "type": "Project", "dependencies": { @@ -1098,6 +1305,12 @@ "System.Reactive": "[5.0.0, )" } }, + "nncase.diagnostics": { + "type": "Project", + "dependencies": { + "Nncase.Core": "[1.0.0, )" + } + }, "nncase.egraph": { "type": "Project", "dependencies": { @@ -1123,6 +1336,15 @@ "Nncase.Evaluator": "[1.0.0, )" } }, + "nncase.importer": { + "type": "Project", + "dependencies": { + "LanguageExt.Core": "[4.4.0, )", + "Nncase.Core": "[1.0.0, )", + "Onnx.Protobuf": "[1.0.0, )", + "TFLite.Schema": "[1.0.0, )" + } + }, "nncase.io": { "type": "Project" }, @@ -1142,18 +1364,50 @@ "Nncase.Graph": "[1.0.0, )" } }, + "nncase.quantization": { + "type": "Project", + "dependencies": { + "Newtonsoft.Json": "[13.0.3, )", + "Nncase.Core": "[1.0.0, )", + "Nncase.Passes": "[1.0.0, )", + "OrtKISharp": "[0.0.2, )", + "System.Linq.Async": "[6.0.1, )" + } + }, "nncase.simulator": { "type": "Project", "dependencies": { "Nncase.Core": "[1.0.0, )" } }, + "onnx.protobuf": { + "type": "Project", + "dependencies": { + "Google.Protobuf": "[3.19.4, )" + } + }, + "tflite.schema": { + "type": "Project", + "dependencies": { + "Nncase.FlatBuffers": "[2.0.0, )" + } + }, "DryIoc.dll": { "type": "CentralTransitive", "requested": "[5.3.1, )", "resolved": "5.3.1", "contentHash": "E3zclUh2CIBks1t2uBD1k18pyGFJ1YSKCrbCDbB7qCdl2RAB+k68AyDpjeplhF1ot2XPV82AgyCWBXMf0ggL1g==" }, + "DryIoc.Microsoft.DependencyInjection": { + "type": "CentralTransitive", + "requested": "[6.1.0, )", + "resolved": "6.1.0", + "contentHash": "GJtCx0XgvdRXmZDtJH5FW7vMhaN2nPwOlwV7EIWN+f4+Rw2+eRCfHihtR8l9ozfgVaHkA8+zmA8PpHGKKIflcw==", + "dependencies": { + "DryIoc.dll": "5.2.2", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0" + } + }, "Extension.Mathematics": { "type": "CentralTransitive", "requested": "[1.2.12, )", @@ -1186,17 +1440,51 @@ "resolved": "3.19.4", "contentHash": "fd07/ykL4O4FhqrZIELm5lmiyOHfdPg9+o+hWr6tcfRdS7tHXnImg/2wtogLzlW2eEmr0J7j6ZrZvaWOLiJbxQ==" }, + "LanguageExt.Core": { + "type": "CentralTransitive", + "requested": "[4.4.0, )", + "resolved": "4.4.0", + "contentHash": "3VARp4kl87gaVNO0vg70A9Brk48cEWEVTG6p30cVN0gCI7ftrDBqkEyy8hUCVweBJUqs4J5ZFrw2tu6dp+gnQQ==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "System.Diagnostics.Contracts": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Queryable": "4.3.0", + "System.Memory": "4.5.4", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + } + }, "Microsoft.Extensions.Hosting": { "type": "CentralTransitive", "requested": "[6.0.0, )", - "resolved": "2.1.0", - "contentHash": "nqOrLtBqpwRT006vdQ2Vp87uiuYztiZcZAndFqH91ZH4SQgr8wImCVQwzUgTxx1DSrpIW765+xrZTZqsoGtvqg==", + "resolved": "6.0.0", + "contentHash": "M8VzD0ni5VarIRT8njnwK4K2WSAo0kZH4Zc3mKcSGkP4CjDZ91T9ZEFmmwhmo4z7x8AFq+tW0WFi9wX+K2cxkQ==", "dependencies": { - "Microsoft.Extensions.Configuration": "2.1.0", - "Microsoft.Extensions.DependencyInjection": "2.1.0", - "Microsoft.Extensions.FileProviders.Physical": "2.1.0", - "Microsoft.Extensions.Hosting.Abstractions": "2.1.0", - "Microsoft.Extensions.Logging": "2.1.0" + "Microsoft.Extensions.Configuration": "6.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", + "Microsoft.Extensions.Configuration.Binder": "6.0.0", + "Microsoft.Extensions.Configuration.CommandLine": "6.0.0", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.0", + "Microsoft.Extensions.Configuration.FileExtensions": "6.0.0", + "Microsoft.Extensions.Configuration.Json": "6.0.0", + "Microsoft.Extensions.Configuration.UserSecrets": "6.0.0", + "Microsoft.Extensions.DependencyInjection": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileProviders.Physical": "6.0.0", + "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging.Configuration": "6.0.0", + "Microsoft.Extensions.Logging.Console": "6.0.0", + "Microsoft.Extensions.Logging.Debug": "6.0.0", + "Microsoft.Extensions.Logging.EventLog": "6.0.0", + "Microsoft.Extensions.Logging.EventSource": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Hosting.Abstractions": { @@ -1243,6 +1531,18 @@ "System.Runtime.CompilerServices.Unsafe": "5.0.0" } }, + "Newtonsoft.Json": { + "type": "CentralTransitive", + "requested": "[13.0.3, )", + "resolved": "13.0.3", + "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" + }, + "Nncase.FlatBuffers": { + "type": "CentralTransitive", + "requested": "[2.0.0, )", + "resolved": "2.0.0", + "contentHash": "ir3uek0+7Y8SwOUGUR8y94sgpVDWLAjKGBm9z7cLe/38GyPxWbIYHPnHZHksNTExTsx3Ie9GtwagkgR/jm64hA==" + }, "OrtKISharp": { "type": "CentralTransitive", "requested": "[0.0.2, )", diff --git a/src/Nncase.Tests/packages.lock.json b/src/Nncase.Tests/packages.lock.json index b08aa2c881..acf8ae7414 100644 --- a/src/Nncase.Tests/packages.lock.json +++ b/src/Nncase.Tests/packages.lock.json @@ -80,11 +80,11 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "System.Linq.Async": { @@ -650,8 +650,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.AppContext": { "type": "Transitive", @@ -1575,6 +1575,7 @@ "dependencies": { "MethodBoundaryAspect.Fody": "[2.0.148, )", "Nncase.CodeGen": "[1.0.0, )", + "Nncase.Compiler": "[1.0.0, )", "Nncase.Core": "[1.0.0, )", "Nncase.Modules.StackVM": "[1.0.0, )", "Nncase.Passes": "[1.0.0, )", diff --git a/third_party/onnx/packages.lock.json b/third_party/onnx/packages.lock.json index 207b93b556..0bdbf312bd 100644 --- a/third_party/onnx/packages.lock.json +++ b/third_party/onnx/packages.lock.json @@ -16,17 +16,17 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" } } } diff --git a/third_party/tflite/packages.lock.json b/third_party/tflite/packages.lock.json index 325adfa712..73d7544eab 100644 --- a/third_party/tflite/packages.lock.json +++ b/third_party/tflite/packages.lock.json @@ -10,17 +10,17 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" } } } diff --git a/tools/Nncase.SourceGenerator/packages.lock.json b/tools/Nncase.SourceGenerator/packages.lock.json index 0430a3e081..50bdccb9fa 100644 --- a/tools/Nncase.SourceGenerator/packages.lock.json +++ b/tools/Nncase.SourceGenerator/packages.lock.json @@ -34,11 +34,11 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "Microsoft.CodeAnalysis.Common": { @@ -62,8 +62,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive", diff --git a/tools/stackvm_gen/IsaGen/packages.lock.json b/tools/stackvm_gen/IsaGen/packages.lock.json index bbcfe63a45..6440c55973 100644 --- a/tools/stackvm_gen/IsaGen/packages.lock.json +++ b/tools/stackvm_gen/IsaGen/packages.lock.json @@ -27,11 +27,11 @@ }, "StyleCop.Analyzers": { "type": "Direct", - "requested": "[1.2.0-beta.435, )", - "resolved": "1.2.0-beta.435", - "contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==", + "requested": "[1.2.0-beta.507, )", + "resolved": "1.2.0-beta.507", + "contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==", "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.435" + "StyleCop.Analyzers.Unstable": "1.2.0.507" } }, "Microsoft.AspNetCore.Mvc.Razor.Extensions": { @@ -169,8 +169,8 @@ }, "StyleCop.Analyzers.Unstable": { "type": "Transitive", - "resolved": "1.2.0.435", - "contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg==" + "resolved": "1.2.0.507", + "contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw==" }, "System.Buffers": { "type": "Transitive",