Skip to content

Commit

Permalink
Merge branch 'master' into gt/Nuphar
Browse files Browse the repository at this point in the history
  • Loading branch information
KeDengMS authored May 28, 2019
2 parents a1e7ca7 + 7156084 commit f18356e
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 148 deletions.
163 changes: 95 additions & 68 deletions ThirdPartyNotices.txt

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
"commitHash":"7389dbac82d362f296dc2746f10e43ffa1615660",
"repositoryUrl":"https://github.com/scikit-learn/scikit-learn.git"
}
}
}
},
{
"component":{
Expand Down Expand Up @@ -298,7 +298,17 @@
"repositoryUrl":"https://github.com/NervanaSystems/ngraph.git"
}
}
}
},
{
"component":{
"Type":"other",
"Other":{
"Name":"Boost",
"Version":"1.69.0",
"DownloadUrl":"http://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.bz2"
}
}
},
],
"Version":1
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ docker run -h $HOSTNAME \
-e "IsReleaseBuild=$IsReleaseBuild" \
"onnxruntime-$IMAGE" \
/bin/bash /onnxruntime_src/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-gpu.sh \
/home/onnxruntimedev/$NUGET_REPO_DIRNAME /onnxruntime_src /home/onnxruntimedev $TestDataUrl $TestDataChecksum &
/home/onnxruntimedev/$NUGET_REPO_DIRNAME /onnxruntime_src /home/onnxruntimedev &

wait -n

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# build docker image for CPU

#TODO: Get this working, not tested yet
set -x

SOURCE_ROOT=$1
Expand Down Expand Up @@ -44,7 +43,7 @@ docker run -h $HOSTNAME \
-e "RunTestNative=$RunTestNative" \
"onnxruntime-$IMAGE" \
/bin/bash /onnxruntime_src/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh \
/home/onnxruntimedev/$NUGET_REPO_DIRNAME /onnxruntime_src /home/onnxruntimedev $TestDataUrl $TestDataChecksum &
/home/onnxruntimedev/$NUGET_REPO_DIRNAME /onnxruntime_src /home/onnxruntimedev &

wait -n

Expand Down
19 changes: 10 additions & 9 deletions csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-gpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
LocalNuGetRepo=$1
SourceRoot=$2
BuildDir=$3
TestDataUrl=$4
TestDataChecksum=$5
#TestDataUrl=$4
#TestDataChecksum=$5

#TestDataUrl and TestDataChecksum comes from the build env variable
set -x

echo "Downloading test data"
python3 $SourceRoot/tools/ci_build/build.py --update --download_test_data --build_dir $BuildDir --test_data_url $TestDataUrl --test_data_checksum $TestDataChecksum
if [ $? -ne 0 ]; then
echo "Failed to download test data"
exit 1
fi
#echo "Downloading test data"
#python3 $SourceRoot/tools/ci_build/build.py --update --download_test_data --build_dir $BuildDir --test_data_url $TestDataUrl --test_data_checksum $TestDataChecksum
#if [ $? -ne 0 ]; then
# echo "Failed to download test data"
# exit 1
#fi

set -x

OldDir=`pwd`
cd $SourceRoot
Expand Down
17 changes: 9 additions & 8 deletions csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
LocalNuGetRepo=$1
SourceRoot=$2
BuildDir=$3
TestDataUrl=$4
TestDataChecksum=$5
#TestDataUrl=$4
#TestDataChecksum=$5

#TestDataUrl and TestDataChecksum comes from the build env variable

echo "Downloading test data"
python3 $SourceRoot/tools/ci_build/build.py --update --download_test_data --build_dir $BuildDir --test_data_url $TestDataUrl --test_data_checksum $TestDataChecksum
if [ $? -ne 0 ]; then
echo "Failed to download test data"
exit 1
fi
#echo "Downloading test data"
#python3 $SourceRoot/tools/ci_build/build.py --update --download_test_data --build_dir $BuildDir --test_data_url $TestDataUrl --test_data_checksum $TestDataChecksum
#if [ $? -ne 0 ]; then
# echo "Failed to download test data"
# exit 1
#fi
set -x

OldDir=`pwd`
cd $SourceRoot
Expand Down
4 changes: 3 additions & 1 deletion onnxruntime/test/perftest/ort_test_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ OnnxRuntimeTestSession::OnnxRuntimeTestSession(Ort::Env& env, std::random_device
else
session_options.DisableSequentialExecution();
fprintf(stdout, "Setting thread pool size to %d\n", performance_test_config.run_config.session_thread_pool_size);
session_options.SetThreadPoolSize(performance_test_config.run_config.session_thread_pool_size);
// Don't set the thread pool size unless it has been changed from our zero default value (as zero will fail)
if (performance_test_config.run_config.session_thread_pool_size != 0)
session_options.SetThreadPoolSize(performance_test_config.run_config.session_thread_pool_size);
// Set optimization level.
session_options.SetGraphOptimizationLevel(performance_test_config.run_config.optimization_level);
if (!performance_test_config.run_config.profile_file.empty())
Expand Down
121 changes: 64 additions & 57 deletions onnxruntime/test/python/onnx_backend_test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

pytest_plugins = 'onnx.backend.test.report',


class OrtBackendTest(onnx.backend.test.BackendTest):

def __init__(self, backend, parent_module=None):
Expand All @@ -33,8 +34,55 @@ def assert_similar_outputs(cls, ref_outputs, outputs, rtol, atol):
rtol=1e-3,
atol=1e-5)

def CreateBackendTest(testname=None):

# ORT first supported opset 7, so models with nodes that require versions prior to opset 7 are not supported
def tests_with_pre_opset7_dependencies_filters():
filters = ('^test_AvgPool1d_cpu.*',
'^test_AvgPool1d_stride_cpu.*',
'^test_AvgPool2d_cpu.*',
'^test_AvgPool2d_stride_cpu.*',
'^test_AvgPool3d_cpu.*',
'^test_AvgPool3d_stride1_pad0_gpu_input_cpu.*',
'^test_AvgPool3d_stride_cpu.*',
'^test_BatchNorm1d_3d_input_eval_cpu.*',
'^test_BatchNorm2d_eval_cpu.*',
'^test_BatchNorm2d_momentum_eval_cpu.*',
'^test_BatchNorm3d_eval_cpu.*',
'^test_BatchNorm3d_momentum_eval_cpu.*',
'^test_GLU_cpu.*',
'^test_GLU_dim_cpu.*',
'^test_Linear_cpu.*',
'^test_PReLU_1d_cpu.*',
'^test_PReLU_1d_multiparam_cpu.*',
'^test_PReLU_2d_cpu.*',
'^test_PReLU_2d_multiparam_cpu.*',
'^test_PReLU_3d_cpu.*',
'^test_PReLU_3d_multiparam_cpu.*',
'^test_PoissonNLLLLoss_no_reduce_cpu.*',
'^test_Softsign_cpu.*',
'^test_operator_add_broadcast_cpu.*',
'^test_operator_add_size1_broadcast_cpu.*',
'^test_operator_add_size1_right_broadcast_cpu.*',
'^test_operator_add_size1_singleton_broadcast_cpu.*',
'^test_operator_addconstant_cpu.*',
'^test_operator_addmm_cpu.*',
'^test_operator_basic_cpu.*',
'^test_operator_mm_cpu.*',
'^test_operator_non_float_params_cpu.*',
'^test_operator_params_cpu.*',
'^test_operator_pow_cpu.*')

return filters


def unsupported_usages_filters():
filters = ('^test_convtranspose_1d_cpu.*', # ConvTransponse supports 4-D only
'^test_convtranspose_3d_cpu.*')

return filters


def create_backend_test(testname=None):
backend_test = OrtBackendTest(c2, __name__)

# Type not supported
Expand All @@ -43,68 +91,27 @@ def CreateBackendTest(testname=None):
if testname:
backend_test.include(testname + '.*')
else:
backend_test.exclude(r'('
'^test_cast_DOUBLE_to_FLOAT_cpu.*'
'|^test_cast_FLOAT_to_DOUBLE_cpu.*'
'|^test_cast_FLOAT_to_STRING_cpu.*'
'|^test_cast_STRING_to_FLOAT_cpu.*'
'|^test_convtranspose_1d_cpu.*'
'|^test_convtranspose_3d_cpu.*'
'|^test_constantofshape_*.*'
'|^test_dequantizelinear_cpu.*'

'|^test_AvgPool1d_cpu.*'
'|^test_AvgPool1d_stride_cpu.*'
'|^test_AvgPool2d_cpu.*'
'|^test_AvgPool2d_stride_cpu.*'
'|^test_AvgPool3d_cpu.*'
'|^test_AvgPool3d_stride1_pad0_gpu_input_cpu.*'
'|^test_AvgPool3d_stride_cpu.*'
'|^test_BatchNorm1d_3d_input_eval_cpu.*'
'|^test_BatchNorm2d_eval_cpu.*'
'|^test_BatchNorm2d_momentum_eval_cpu.*'
'|^test_BatchNorm3d_eval_cpu.*'
'|^test_BatchNorm3d_momentum_eval_cpu.*'
'|^test_GLU_cpu.*'
'|^test_GLU_dim_cpu.*'
'|^test_Linear_cpu.*'
'|^test_PReLU_1d_cpu.*'
'|^test_PReLU_1d_multiparam_cpu.*'
'|^test_PReLU_2d_cpu.*'
'|^test_PReLU_2d_multiparam_cpu.*'
'|^test_PReLU_3d_cpu.*'
'|^test_PReLU_3d_multiparam_cpu.*'
'|^test_PoissonNLLLLoss_no_reduce_cpu.*'
'|^test_Softsign_cpu.*'
'|^test_operator_add_broadcast_cpu.*'
'|^test_operator_add_size1_broadcast_cpu.*'
'|^test_operator_add_size1_right_broadcast_cpu.*'
'|^test_operator_add_size1_singleton_broadcast_cpu.*'
'|^test_operator_addconstant_cpu.*'
'|^test_operator_addmm_cpu.*'
'|^test_operator_basic_cpu.*'
'|^test_operator_mm_cpu.*'
'|^test_operator_non_float_params_cpu.*'
'|^test_operator_params_cpu.*'
'|^test_operator_pow_cpu.*'
'|^test_shrink_cpu.*'
'|^test_vgg19_cpu.*'
'|^test_zfnet512_cpu.*'
'|^test_qlinearconv_cpu.*'
'|^test_quantizelinear_cpu.*'
'|^test_roialign_cpu.*'
'|^test_operator_repeat_dim_overflow_cpu.*'
'|^test_operator_symbolic_override_nested_cpu.*' #Nuphar: Same input used by multiple XP is not supported
'|^test_scan_sum_cpu.*' #Nuphar: Graph output (sum_out) does not exist in the graph
'|^test_scan9_sum_cpu.*' #Nuphar: Graph output (sum_out) does not exist in the graph
')')
# Tests that are failing temporarily and should be fixed
current_failing_tests = ('^test_cast_FLOAT_to_STRING_cpu.*',
'^test_constantofshape_*.*',
'^test_dequantizelinear_cpu.*',
'^test_shrink_cpu.*',
'^test_qlinearconv_cpu.*',
'^test_quantizelinear_cpu.*')

filters = current_failing_tests + \
tests_with_pre_opset7_dependencies_filters() + \
unsupported_usages_filters()

backend_test.exclude('(' + '|'.join(filters) + ')')

# import all test cases at global scope to make
# them visible to python.unittest.
globals().update(backend_test.enable_report().test_cases)

return backend_test


def parse_args():
parser = argparse.ArgumentParser(os.path.basename(__file__),
description='Run the ONNX backend tests using ONNXRuntime.')
Expand All @@ -125,5 +132,5 @@ def parse_args():
if __name__ == '__main__':
args = parse_args()

backend_test = CreateBackendTest(args.testname)
backend_test = create_backend_test(args.testname)
unittest.main()

0 comments on commit f18356e

Please sign in to comment.