-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add python 3.8/3.9 support for Windows GPU and Linux ARM64 #6615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
08a28f8
add python 3.8/3.9
60ce5d7
update
a12d38d
update
1b0b1e9
csharp
1cdef07
update
502e957
update
4c6b09b
update
5080256
Ke's fix
liqunfu 697c5cb
Merge remote-tracking branch 'origin/master' into snnn/python1
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ | |
| # Licensed under the MIT License. | ||
|
|
||
| LocalNuGetRepo=$1 | ||
| SourceRoot=$2 | ||
| BuildDir=$3 | ||
| export CurrentOnnxRuntimeVersion=$4 | ||
| IsMacOS=${5:-false} | ||
|
|
@@ -12,22 +11,26 @@ PackageName=${PackageName:-Microsoft.ML.OnnxRuntime} | |
| RunTestCsharp=${RunTestCsharp:-true} | ||
| RunTestNative=${RunTestNative:-true} | ||
|
|
||
| set -x | ||
| set -x -e | ||
|
|
||
| OldDir=`pwd` | ||
| cd $SourceRoot | ||
| cd $BUILD_SOURCESDIRECTORY | ||
|
|
||
| echo "Current NuGet package version is $CurrentOnnxRuntimeVersion" | ||
|
|
||
| if [ $RunTestCsharp = "true" ]; then | ||
| if [[ $IsMacOS == "True" || $IsMacOS == "true" ]]; then | ||
| mkdir -p $BUILD_BINARIESDIRECTORY/models | ||
| ln -s $BUILD_SOURCESDIRECTORY/cmake/external/onnx/onnx/backend/test/data/node $BUILD_BINARIESDIRECTORY/models/opset14 | ||
| fi | ||
| # Run C# tests | ||
| dotnet restore $SourceRoot/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj -s $LocalNuGetRepo -s https://api.nuget.org/v3/index.json | ||
| dotnet restore $BUILD_SOURCESDIRECTORY/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj -s $LocalNuGetRepo -s https://api.nuget.org/v3/index.json | ||
| if [ $? -ne 0 ]; then | ||
| echo "Failed to restore nuget packages for the test project" | ||
| exit 1 | ||
| fi | ||
|
|
||
| dotnet test $SourceRoot/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj --no-restore --verbosity detailed | ||
| dotnet test $BUILD_SOURCESDIRECTORY/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj --no-restore --verbosity detailed | ||
| if [ $? -ne 0 ]; then | ||
| echo "Failed to build or execute the end-to-end test" | ||
| exit 1 | ||
|
|
@@ -45,23 +48,23 @@ if [ $RunTestNative = "true" ]; then | |
|
|
||
| inc="-I build/native/include" | ||
|
|
||
| if [ $IsMacOS = "true" ]; then | ||
| if [[ $IsMacOS == "True" || $IsMacOS == "true" ]]; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like there is a way to convert to lower case: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html#Shell-Parameter-Expansion (search for ${parameter,,pattern}) |
||
| export DYLD_FALLBACK_LIBRARY_PATH=$LocalNuGetRepo/_tmp:${DYLD_FALLBACK_LIBRARY_PATH} | ||
| libs="-L runtimes/osx-x64/native -l onnxruntime" | ||
| g++ -std=c++11 $SourceRoot/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests.Capi/C_Api_Sample.cpp $inc $libs -Wunused-result -Wformat=0 -o sampletest | ||
| g++ -std=c++11 $BUILD_SOURCESDIRECTORY/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests.Capi/C_Api_Sample.cpp $inc $libs -Wunused-result -Wformat=0 -o sampletest | ||
| libName=$(otool -L ./sampletest | grep onnxruntime | xargs | cut -d' ' -f1 | cut -d'/' -f2) | ||
| ln -sf runtimes/osx-x64/native/libonnxruntime.dylib $libName | ||
| else | ||
| export LD_LIBRARY_PATH=$LocalNuGetRepo/_tmp:${LD_LIBRARY_PATH} | ||
| libs="-L runtimes/linux-x86/native -L runtimes/linux-x64/native -l onnxruntime" | ||
| g++ -std=c++11 $SourceRoot/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests.Capi/C_Api_Sample.cpp $inc $libs -Wunused-result -o sampletest | ||
| g++ -std=c++11 $BUILD_SOURCESDIRECTORY/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests.Capi/C_Api_Sample.cpp $inc $libs -Wunused-result -o sampletest | ||
| # Create link to versioned shared object required at runtime | ||
| libname=`ldd sampletest | grep onnxruntime | xargs | cut -d" " -f1` | ||
| ln -sf runtimes/linux-x64/native/libonnxruntime.so $libname | ||
| fi | ||
|
|
||
| # Copy Sample Model | ||
| cp $SourceRoot/csharp/testdata/squeezenet.onnx . | ||
| cp $BUILD_SOURCESDIRECTORY/csharp/testdata/squeezenet.onnx . | ||
|
|
||
| # Run the sample model | ||
| ./sampletest | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not keep this parameter and pass the correct value? seems better to not depend on azure devops variable names like BUILD_SOURCESDIRECTORY outside of build definitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could add an additional parameter for the binaries directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, then I need to add another parameter, which requires modify more files(all the callers of this script). That's why I choose this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed I would prefer to pass less parameters when possible. The more we have, the more likely we could make some errors during the passing, for example, missing one parameter or the order is wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's what error handling is for :)
or named command line options
can handle it later
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I forgot to mention, sometimes the file is called from docker, sometimes it runs directly in the host environment. If we use the azure devops variable names directly, then in the first case we need to pass it, in the second case we don't and we can directly use the vars.