Skip to content

Add FAQ page - #3324

Merged
Faith Xu (faxu) merged 26 commits into
microsoft:masterfrom
faxu:faq
May 6, 2020
Merged

Add FAQ page#3324
Faith Xu (faxu) merged 26 commits into
microsoft:masterfrom
faxu:faq

Conversation

@faxu

Copy link
Copy Markdown
Contributor

Adding a FAQ page with common questions and issues to help troubleshooting.

@faxu
Faith Xu (faxu) requested a review from a team as a code owner March 26, 2020 00:17
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread README.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread README.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
@snnn

snnn (snnn) commented Apr 9, 2020

Copy link
Copy Markdown
Contributor

Q: How to force to single threaded execution
By default, session.run() uses all my computer's cores, how to limit use to a single thread only?

A:
It requires onnxruntime version >=1.3.0.

Please do both of the following:

  • Build with openmp disabled or set environment variable OMP_NUM_THREADS to 1.
  • Set the session options intra_op_num_threads and inter_op_num_threads to 1 each.

Python example:

#!/usr/bin/python3
os.environ["OMP_NUM_THREADS"] = "1"
import onnxruntime

opts = onnxruntime.SessionOptions()
opts.intra_op_num_threads = 1
opts.inter_op_num_threads = 1
opts.execution_mode = onnxruntime.ExecutionMode.ORT_SEQUENTIAL
ort_session = onnxruntime.InferenceSession('/path/to/model.onnx', sess_options=opts)

C++ example:

// initialize  enviroment...one enviroment per process
Ort::Env env(ORT_LOGGING_LEVEL_WARNING, "test");

// initialize session options if needed
Ort::SessionOptions session_options;
session_options.SetIntraOpNumThreads(1);
session_options.SetInterOpNumThreads(1);
#ifdef _WIN32
  const wchar_t* model_path = L"squeezenet.onnx";
#else
  const char* model_path = "squeezenet.onnx";
#endif

Ort::Session session(env, model_path, session_options);

Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left a few wording suggestions. Overall, looks great, much improved!

Comment thread docs/ONNX_Runtime_Perf_Tuning.md Outdated
Comment thread docs/ONNX_Runtime_Perf_Tuning.md Outdated
Comment thread docs/ONNX_Runtime_Perf_Tuning.md Outdated
Comment thread docs/ONNX_Runtime_Perf_Tuning.md Outdated
Co-Authored-By: Nat Kershaw (MSFT) <nakersha@microsoft.com>
Faith Xu (faxu) and others added 3 commits April 23, 2020 17:50
Co-Authored-By: Nat Kershaw (MSFT) <nakersha@microsoft.com>
Co-Authored-By: Nat Kershaw (MSFT) <nakersha@microsoft.com>
Co-Authored-By: Nat Kershaw (MSFT) <nakersha@microsoft.com>
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread README.md Outdated
@faxu

Copy link
Copy Markdown
Contributor Author

/azp run Linux CPU CI Pipeline,Linux GPU CI Pipeline,Linux GPU TensorRT CI Pipeline,MacOS CI Pipeline,Windows GPU CI Pipeline,Windows GPU TensorRT CI Pipeline,MacOS NoContribops CI Pipeline,Linux CPU x64 NoContribops CI Pipeline,Windows CPU CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@faxu
Faith Xu (faxu) merged commit 9cca219 into microsoft:master May 6, 2020
@faxu
Faith Xu (faxu) deleted the faq branch May 6, 2020 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants