Skip to content

Commit

Permalink
test torchscript
Browse files Browse the repository at this point in the history
  • Loading branch information
xhuohai committed Oct 7, 2023
1 parent 8512637 commit 41dd9f6
Show file tree
Hide file tree
Showing 10 changed files with 738 additions and 20 deletions.
2 changes: 2 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<PackageVersion Include="Grpc.Tools" Version="2.42.0" />
<PackageVersion Include="Humanizer.Core" Version="2.14.1" />
<PackageVersion Include="LanguageExt.Core" Version="4.4.0" />
<PackageVersion Include="libtorch-cpu" Version="2.0.1.1" />
<PackageVersion Include="MagicalTensorflowLib" Version="0.0.2" />
<PackageVersion Include="MagicalTensorflowLibOSX-ARM64" Version="0.0.4" />
<PackageVersion Include="MethodBoundaryAspect.Fody">
Expand Down Expand Up @@ -54,6 +55,7 @@
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Reactive" Version="5.0.0" />
<PackageVersion Include="Tomlyn.Extensions.Configuration" Version="1.0.5" />
<PackageVersion Include="TorchSharp" Version="0.100.5" />
<PackageVersion Include="xunit" Version="2.5.0" />
<PackageVersion Include="xunit.analyzers" Version="1.2.0" />
<PackageVersion Include="xunit.assert" Version="2.5.0" />
Expand Down
74 changes: 69 additions & 5 deletions src/Nncase.Cli/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,21 @@
"resolved": "0.0.2",
"contentHash": "HAoROgAKn8XBun11X43HZuspKlo5JGy8/OYw5IUPo7FVh5TCaPrLjGmyGYYZ2dqLlv31yv/b6s254PIRGn95cA=="
},
"libtorch-cpu-linux-x64": {
"type": "Transitive",
"resolved": "2.0.1.1",
"contentHash": "HX1dWJt6aHjU64uucrYFmfcOqURkZ4zconauSuuLFLJAoe8Kdtq73B6y70Uvu2PHfAtE7ksWJzZ9dzChJBbzgw=="
},
"libtorch-cpu-osx-x64": {
"type": "Transitive",
"resolved": "2.0.1.1",
"contentHash": "jVyP0IRieh8ZOGm08HILgJje1r0nEnd3KtH/5r4dQic4UtGWdQNcCxdmrNqibGIeNFy9tpRYcv3Kd4WWUqgr+w=="
},
"libtorch-cpu-win-x64": {
"type": "Transitive",
"resolved": "2.0.1.1",
"contentHash": "gN4x2u/DqTTecUU2CAYwlTtL7HI19nKnhp6CD9sJGcvnX+LK/5WMh+qQ67YTCkKSPpx/+sEGpq43qYAZT/RAcQ=="
},
"Microsoft.Bcl.AsyncInterfaces": {
"type": "Transitive",
"resolved": "6.0.0",
Expand Down Expand Up @@ -342,6 +357,30 @@
"resolved": "1.3.0",
"contentHash": "WXnEcGwmXfa8gW9N2MlcaPNUzM3NLMwnAhacbtH554F8YcoXbIkTB+uGa1Aa+9gyb/9JZgYVHnmADgJUKP52nA=="
},
"SharpZipLib": {
"type": "Transitive",
"resolved": "1.4.0",
"contentHash": "CdkbBSPIpHD8xBlu+8kDJiqc1Tf9iV89BObnqcvEbwysXSj5h1MfaeLgeeaxPZmi7CTJO8FDofBBNxBW0Vml7A=="
},
"SkiaSharp": {
"type": "Transitive",
"resolved": "2.88.3",
"contentHash": "GG8X3EdfwyBfwjl639UIiOVOKEdeoqDgYrz0P1MUCnefXt9cofN+AK8YB/v1+5cLMr03ieWCQdDmPqnFIzSxZw==",
"dependencies": {
"SkiaSharp.NativeAssets.Win32": "2.88.3",
"SkiaSharp.NativeAssets.macOS": "2.88.3"
}
},
"SkiaSharp.NativeAssets.macOS": {
"type": "Transitive",
"resolved": "2.88.3",
"contentHash": "CEbWAXMGFkPV3S1snBKK7jEG3+xud/9kmSAhu0BEUKKtlMdxx+Qal0U9bntQREM9QpqP5xLWZooodi8IlV8MEg=="
},
"SkiaSharp.NativeAssets.Win32": {
"type": "Transitive",
"resolved": "2.88.3",
"contentHash": "MU4ASL8VAbTv5vSw1PoiWjjjpjtGhWtFYuJnrN4sNHFCePb2ohQij9JhSdqLLxk7RpRtWPdV93fbA53Pt+J0yw=="
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.507",
Expand Down Expand Up @@ -477,8 +516,8 @@
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.4",
"contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw=="
"resolved": "4.5.5",
"contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw=="
},
"System.ObjectModel": {
"type": "Transitive",
Expand Down Expand Up @@ -736,7 +775,9 @@
"LanguageExt.Core": "[4.4.0, )",
"Nncase.Core": "[1.0.0, )",
"Onnx.Protobuf": "[1.0.0, )",
"TFLite.Schema": "[1.0.0, )"
"TFLite.Schema": "[1.0.0, )",
"TorchSharp": "[0.100.5, )",
"libtorch-cpu": "[2.0.1.1, )"
}
},
"nncase.io": {
Expand Down Expand Up @@ -845,8 +886,8 @@
"Google.Protobuf": {
"type": "CentralTransitive",
"requested": "[3.19.4, )",
"resolved": "3.19.4",
"contentHash": "fd07/ykL4O4FhqrZIELm5lmiyOHfdPg9+o+hWr6tcfRdS7tHXnImg/2wtogLzlW2eEmr0J7j6ZrZvaWOLiJbxQ=="
"resolved": "3.21.9",
"contentHash": "OTpFujTgkmqMLbg3KT7F/iuKi1rg6s5FCS2M9XcVLDn40zL8wgXm37CY/F6MeOEXKjdcnXGCN/h7oyMkVydVsg=="
},
"LanguageExt.Core": {
"type": "CentralTransitive",
Expand All @@ -866,6 +907,17 @@
"System.ValueTuple": "4.5.0"
}
},
"libtorch-cpu": {
"type": "CentralTransitive",
"requested": "[2.0.1.1, )",
"resolved": "2.0.1.1",
"contentHash": "taUIHw5/Fps03n7n6yr+JNvJ+F92DlgdUo7wJ8nuiuLjk7jV+I8deFUJhZ2dD+q0A0It0Twb0GLjHFoSURXOIQ==",
"dependencies": {
"libtorch-cpu-linux-x64": "2.0.1.1",
"libtorch-cpu-osx-x64": "2.0.1.1",
"libtorch-cpu-win-x64": "2.0.1.1"
}
},
"Microsoft.Extensions.Hosting.Abstractions": {
"type": "CentralTransitive",
"requested": "[6.0.0, )",
Expand Down Expand Up @@ -951,6 +1003,18 @@
"requested": "[5.0.0, )",
"resolved": "5.0.0",
"contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ=="
},
"TorchSharp": {
"type": "CentralTransitive",
"requested": "[0.100.5, )",
"resolved": "0.100.5",
"contentHash": "MKysvgHzoFBnm948T3yC0Ga2UIHVBqiubfztKckh6Hfjmroo+7knuPAxI5kmDOLQ/JUmm43qDKUE051sJgWsCg==",
"dependencies": {
"Google.Protobuf": "3.21.9",
"SharpZipLib": "1.4.0",
"SkiaSharp": "2.88.3",
"System.Memory": "4.5.5"
}
}
}
}
Expand Down
74 changes: 69 additions & 5 deletions src/Nncase.Compiler/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,21 @@
"resolved": "0.0.2",
"contentHash": "HAoROgAKn8XBun11X43HZuspKlo5JGy8/OYw5IUPo7FVh5TCaPrLjGmyGYYZ2dqLlv31yv/b6s254PIRGn95cA=="
},
"libtorch-cpu-linux-x64": {
"type": "Transitive",
"resolved": "2.0.1.1",
"contentHash": "HX1dWJt6aHjU64uucrYFmfcOqURkZ4zconauSuuLFLJAoe8Kdtq73B6y70Uvu2PHfAtE7ksWJzZ9dzChJBbzgw=="
},
"libtorch-cpu-osx-x64": {
"type": "Transitive",
"resolved": "2.0.1.1",
"contentHash": "jVyP0IRieh8ZOGm08HILgJje1r0nEnd3KtH/5r4dQic4UtGWdQNcCxdmrNqibGIeNFy9tpRYcv3Kd4WWUqgr+w=="
},
"libtorch-cpu-win-x64": {
"type": "Transitive",
"resolved": "2.0.1.1",
"contentHash": "gN4x2u/DqTTecUU2CAYwlTtL7HI19nKnhp6CD9sJGcvnX+LK/5WMh+qQ67YTCkKSPpx/+sEGpq43qYAZT/RAcQ=="
},
"Microsoft.Bcl.AsyncInterfaces": {
"type": "Transitive",
"resolved": "6.0.0",
Expand Down Expand Up @@ -348,6 +363,30 @@
"resolved": "1.3.0",
"contentHash": "WXnEcGwmXfa8gW9N2MlcaPNUzM3NLMwnAhacbtH554F8YcoXbIkTB+uGa1Aa+9gyb/9JZgYVHnmADgJUKP52nA=="
},
"SharpZipLib": {
"type": "Transitive",
"resolved": "1.4.0",
"contentHash": "CdkbBSPIpHD8xBlu+8kDJiqc1Tf9iV89BObnqcvEbwysXSj5h1MfaeLgeeaxPZmi7CTJO8FDofBBNxBW0Vml7A=="
},
"SkiaSharp": {
"type": "Transitive",
"resolved": "2.88.3",
"contentHash": "GG8X3EdfwyBfwjl639UIiOVOKEdeoqDgYrz0P1MUCnefXt9cofN+AK8YB/v1+5cLMr03ieWCQdDmPqnFIzSxZw==",
"dependencies": {
"SkiaSharp.NativeAssets.Win32": "2.88.3",
"SkiaSharp.NativeAssets.macOS": "2.88.3"
}
},
"SkiaSharp.NativeAssets.macOS": {
"type": "Transitive",
"resolved": "2.88.3",
"contentHash": "CEbWAXMGFkPV3S1snBKK7jEG3+xud/9kmSAhu0BEUKKtlMdxx+Qal0U9bntQREM9QpqP5xLWZooodi8IlV8MEg=="
},
"SkiaSharp.NativeAssets.Win32": {
"type": "Transitive",
"resolved": "2.88.3",
"contentHash": "MU4ASL8VAbTv5vSw1PoiWjjjpjtGhWtFYuJnrN4sNHFCePb2ohQij9JhSdqLLxk7RpRtWPdV93fbA53Pt+J0yw=="
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.507",
Expand Down Expand Up @@ -474,8 +513,8 @@
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.4",
"contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw=="
"resolved": "4.5.5",
"contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw=="
},
"System.ObjectModel": {
"type": "Transitive",
Expand Down Expand Up @@ -714,7 +753,9 @@
"LanguageExt.Core": "[4.4.0, )",
"Nncase.Core": "[1.0.0, )",
"Onnx.Protobuf": "[1.0.0, )",
"TFLite.Schema": "[1.0.0, )"
"TFLite.Schema": "[1.0.0, )",
"TorchSharp": "[0.100.5, )",
"libtorch-cpu": "[2.0.1.1, )"
}
},
"nncase.io": {
Expand Down Expand Up @@ -793,8 +834,8 @@
"Google.Protobuf": {
"type": "CentralTransitive",
"requested": "[3.19.4, )",
"resolved": "3.19.4",
"contentHash": "fd07/ykL4O4FhqrZIELm5lmiyOHfdPg9+o+hWr6tcfRdS7tHXnImg/2wtogLzlW2eEmr0J7j6ZrZvaWOLiJbxQ=="
"resolved": "3.21.9",
"contentHash": "OTpFujTgkmqMLbg3KT7F/iuKi1rg6s5FCS2M9XcVLDn40zL8wgXm37CY/F6MeOEXKjdcnXGCN/h7oyMkVydVsg=="
},
"LanguageExt.Core": {
"type": "CentralTransitive",
Expand All @@ -814,6 +855,17 @@
"System.ValueTuple": "4.5.0"
}
},
"libtorch-cpu": {
"type": "CentralTransitive",
"requested": "[2.0.1.1, )",
"resolved": "2.0.1.1",
"contentHash": "taUIHw5/Fps03n7n6yr+JNvJ+F92DlgdUo7wJ8nuiuLjk7jV+I8deFUJhZ2dD+q0A0It0Twb0GLjHFoSURXOIQ==",
"dependencies": {
"libtorch-cpu-linux-x64": "2.0.1.1",
"libtorch-cpu-osx-x64": "2.0.1.1",
"libtorch-cpu-win-x64": "2.0.1.1"
}
},
"Microsoft.Extensions.Hosting.Abstractions": {
"type": "CentralTransitive",
"requested": "[6.0.0, )",
Expand Down Expand Up @@ -899,6 +951,18 @@
"requested": "[5.0.0, )",
"resolved": "5.0.0",
"contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ=="
},
"TorchSharp": {
"type": "CentralTransitive",
"requested": "[0.100.5, )",
"resolved": "0.100.5",
"contentHash": "MKysvgHzoFBnm948T3yC0Ga2UIHVBqiubfztKckh6Hfjmroo+7knuPAxI5kmDOLQ/JUmm43qDKUE051sJgWsCg==",
"dependencies": {
"Google.Protobuf": "3.21.9",
"SharpZipLib": "1.4.0",
"SkiaSharp": "2.88.3",
"System.Memory": "4.5.5"
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/Nncase.Importer/Nncase.Importer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

<ItemGroup>
<PackageReference Include="LanguageExt.Core" PrivateAssets="compile" />
<PackageReference Include="libtorch-cpu" />
<PackageReference Include="TorchSharp" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 41dd9f6

Please sign in to comment.