From 603ea0e2cf9a44f631a02f1a41d6085a9218312d Mon Sep 17 00:00:00 2001 From: Chi Lo <54722500+chilo-ms@users.noreply.github.com> Date: Fri, 17 Sep 2021 14:01:15 -0700 Subject: [PATCH] Fix merge conflicts (#9104) --- docs/api/python/api_summary.html | 2 +- .../python/auto_examples/plot_load_and_predict.html | 11 +++++++++-- .../capi/onnxruntime_inference_collection.html | 5 +++++ docs/api/python/tutorial.html | 11 +++++++++-- .../execution-providers/MIGraphX-ExecutionProvider.md | 1 + .../execution-providers/OpenVINO-ExecutionProvider.md | 7 +++---- .../execution-providers/TensorRT-ExecutionProvider.md | 1 + docs/tutorials/tf-get-started.md | 8 +++++++- 8 files changed, 36 insertions(+), 10 deletions(-) diff --git a/docs/api/python/api_summary.html b/docs/api/python/api_summary.html index f3f890d359..dcdbb4979f 100644 --- a/docs/api/python/api_summary.html +++ b/docs/api/python/api_summary.html @@ -236,7 +236,7 @@ facilitate the comparison.

class onnxruntime.InferenceSession(path_or_bytes, sess_options=None, providers=None, provider_options=None)[source]
-

This is the main class used to run a model.

+

This is the main class used to run a model. The next release (ORT 1.10) will require explicitly setting the providers parameter if you want to use execution providers other than the default CPU provider (as opposed to the current behavior of providers getting set/registered by default based on the build flags) when instantiating InferenceSession.

diff --git a/docs/api/python/auto_examples/plot_load_and_predict.html b/docs/api/python/auto_examples/plot_load_and_predict.html index 488820ffc0..0d04cc3019 100644 --- a/docs/api/python/auto_examples/plot_load_and_predict.html +++ b/docs/api/python/auto_examples/plot_load_and_predict.html @@ -53,9 +53,16 @@ retrieve the definition of its inputs and outputs.

Let’s load a very simple model. -The model is available on github onnx…test_sigmoid.

+The model is available on github onnx…test_sigmoid. +Note: The next release (ORT 1.10) will require explicitly setting +the providers parameter if you want to use execution providers other +than the default CPU provider (as opposed to the current behavior of +providers getting set/registered by default based on the build flags) when +instantiating InferenceSession. Following code assumes NVIDIA GPU is available, +you can specify other execution providers or don't include providers parameter +to use default CPU provider.

example1 = get_example("sigmoid.onnx")
-sess = rt.InferenceSession(example1)
+sess = rt.InferenceSession(example1, providers=["CUDAExecutionProvider"])
 

Let’s see the input name and shape.

diff --git a/docs/api/python/modules/onnxruntime/capi/onnxruntime_inference_collection.html b/docs/api/python/modules/onnxruntime/capi/onnxruntime_inference_collection.html index 5059c01cfa..eb51908d06 100644 --- a/docs/api/python/modules/onnxruntime/capi/onnxruntime_inference_collection.html +++ b/docs/api/python/modules/onnxruntime/capi/onnxruntime_inference_collection.html @@ -176,6 +176,11 @@ precedence. Values can either be provider names or tuples of (provider name, options dict). If not provided, then all available providers are used with the default precedence. + The next release (ORT 1.10) will require explicitly setting + this providers parameter if you want to use execution providers + other than the default CPU provider (as opposed to the current + behavior of providers getting set/registered by default based on the + build flags) when instantiating InferenceSession. :param provider_options: Optional sequence of options dicts corresponding to the providers listed in 'providers'. diff --git a/docs/api/python/tutorial.html b/docs/api/python/tutorial.html index 806142b169..a6bff3ae52 100644 --- a/docs/api/python/tutorial.html +++ b/docs/api/python/tutorial.html @@ -104,11 +104,18 @@ to convert other model formats into ONNX. Here we will use

Step 3: Load and run the model using ONNX Runtime

We will use ONNX Runtime to compute the predictions for this machine learning model.

+

Note: The next release (ORT 1.10) will require explicitly setting +the providers parameter if you want to use execution providers other +than the default CPU provider (as opposed to the current behavior of +providers getting set/registered by default based on the build flags) when +instantiating InferenceSession. Following code assumes NVIDIA GPU is available, +you can specify other execution providers or don't include providers parameter +to use default CPU provider.

<<<

import numpy
 import onnxruntime as rt
 
-sess = rt.InferenceSession("logreg_iris.onnx")
+sess = rt.InferenceSession("logreg_iris.onnx", providers=["CUDAExecutionProvider"])
 input_name = sess.get_inputs()[0].name
 pred_onx = sess.run(None, {input_name: X_test.astype(numpy.float32)})[0]
 print(pred_onx)
@@ -125,7 +132,7 @@ by specifying its name into a list.

import numpy
 import onnxruntime as rt
 
-sess = rt.InferenceSession("logreg_iris.onnx")
+sess = rt.InferenceSession("logreg_iris.onnx", providers=["CUDAExecutionProvider"])
 input_name = sess.get_inputs()[0].name
 label_name = sess.get_outputs()[0].name
 pred_onx = sess.run(
diff --git a/docs/execution-providers/MIGraphX-ExecutionProvider.md b/docs/execution-providers/MIGraphX-ExecutionProvider.md
index cbed2a0e58..41618a165c 100644
--- a/docs/execution-providers/MIGraphX-ExecutionProvider.md
+++ b/docs/execution-providers/MIGraphX-ExecutionProvider.md
@@ -37,6 +37,7 @@ The C API details are [here](../get-started/with-c.html.md).
 When using the Python wheel from the ONNX Runtime build with MIGraphX execution provider, it will be automatically
 prioritized over the default GPU or CPU execution providers. There is no need to separately register the execution
 provider. Python APIs details are [here](/python/api_summary).
+*Note that the next release (ORT 1.10) will require explicitly setting the providers parameter if you want to use execution provider other than the default CPU provider when instantiating InferenceSession.*
 
 You can check [here](https://github.com/scxiao/ort_test/tree/master/python/run_onnx) for a python script to run an
 model on either the CPU or MIGraphX Execution Provider.
diff --git a/docs/execution-providers/OpenVINO-ExecutionProvider.md b/docs/execution-providers/OpenVINO-ExecutionProvider.md
index c98e85c623..480898f095 100644
--- a/docs/execution-providers/OpenVINO-ExecutionProvider.md
+++ b/docs/execution-providers/OpenVINO-ExecutionProvider.md
@@ -101,13 +101,12 @@ However, int8 support won't be available for VPU.
 OpenVINO EP can be configured with certain options at runtime that control the behavior of the EP. These options can be set as key-value pairs as below:-
 
 ### Python API
-Key-Value pairs for config options can be set using the Session.set_providers API as follows:-
+Key-Value pairs for config options can be set using InferenceSession API as follow:-
 
 ```
-session = onnxruntime.InferenceSession(, options)
-session.set_providers(['OpenVINOExecutionProvider'], [{Key1 : Value1, Key2 : Value2, ...}])
+session = onnxruntime.InferenceSession(, providers=['OpenVINOExecutionProvider'], provider_options=[{Key1 : Value1, Key2 : Value2, ...}])
 ```
-*Note that this causes the InferenceSession to be re-initialized, which may cause model recompilation and hardware re-initialization*
+*Note that the next release (ORT 1.10) will require explicitly setting the providers parameter if you want to use execution providers other than the default CPU provider (as opposed to the current behavior of providers getting set/registered by default based on the build flags) when instantiating InferenceSession.*
 
 ### C/C++ API
 All the options shown below are passed to SessionOptionsAppendExecutionProvider_OpenVINO() API and populated in the struct OrtOpenVINOProviderOptions in an example shown below, for example for CPU device type:
diff --git a/docs/execution-providers/TensorRT-ExecutionProvider.md b/docs/execution-providers/TensorRT-ExecutionProvider.md
index 4ece654915..c44e66b549 100644
--- a/docs/execution-providers/TensorRT-ExecutionProvider.md
+++ b/docs/execution-providers/TensorRT-ExecutionProvider.md
@@ -46,6 +46,7 @@ If some operators in the model are not supported by TensorRT, ONNX Runtime will
 
 ### Python
 When using the Python wheel from the ONNX Runtime build with TensorRT execution provider, it will be automatically prioritized over the default GPU or CPU execution providers. There is no need to separately register the execution provider.
+*Note that the next release (ORT 1.10) will require explicitly setting the providers parameter if you want to use execution providers other than the default CPU provider when instantiating InferenceSession.*
 
 
 ## Configurations
diff --git a/docs/tutorials/tf-get-started.md b/docs/tutorials/tf-get-started.md
index 0ece8ebd29..918d0bd767 100644
--- a/docs/tutorials/tf-get-started.md
+++ b/docs/tutorials/tf-get-started.md
@@ -78,7 +78,13 @@ import numpy as np
 # Change shapes and types to match model
 input1 = np.zeros((1, 100, 100, 3), np.float32)
 
-sess = ort.InferenceSession("dst/path/model.onnx")
+# Start from ORT 1.10, ORT requires explicitly setting the providers parameter if you want to use execution providers
+# other than the default CPU provider (as opposed to the previous behavior of providers getting set/registered by default
+# based on the build flags) when instantiating InferenceSession.
+# Following code assumes NVIDIA GPU is available, you can specify other execution providers or don't include providers parameter
+# to use default CPU provider.
+sess = ort.InferenceSession("dst/path/model.onnx", providers=["CUDAExecutionProvider"])
+
 # Set first argument of sess.run to None to use all model outputs in default order
 # Input/output names are printed by the CLI and can be set with --rename-inputs and --rename-outputs
 # If using the python API, names are determined from function arg names or TensorSpec names.