onnxruntime icon indicating copy to clipboard operation
onnxruntime copied to clipboard

[oneDNN EP] Improves threading performance and adds support ORT and Eigen threadpools

Open eralmual opened this issue 3 years ago • 42 comments
trafficstars

  • Added oneDNN support to use an unified threadpool with ORT, users can select this with the --dnnl_thread ort build flag.

  • Fixed oversubscription happening with ORT and OpenMP oneDNN threads.

  • Added OrtDnnlProviderOptions struct to support provider creation with new features and customization.

  • Added option for users to customize the numbers of OpenMP and Eigen threads used by oneDNN.

  • perf_test and MNIST training now supports OpenMP, Eigen and ORT threadpools.

  • Java and Python support for new threadpool options.

Description: Previously OneDNN ep suffered from thread oversubscription due to ORT creating it's own thread pool and OneDNN creating another one, this update aims to fix this issue by using one unified threadpool for both the default provider and oneDNN ep by default. Also enables support for Eigen threadpool and prevents the oversubscription issue when using OpenMP. The OrtDnnlProviderOptions struct is added, this allows for deeper customization of the oneDNN ep with features that will be coming in the next few moths.

Motivation and Context

  • Why is this change required? What problem does it solve? Performance related fix, prevents thread oversubscription, improves performance on CPU and allows the user to customize thread distribution according to their workload.

  • If it fixes an open issue, please link to the issue here.

eralmual avatar Jul 13 '22 22:07 eralmual

@jywu-msft maintainer please run /azp run Linux DNNL CI Pipeline since this is the primary pipeline for testing the OneDNN execution provider.

eralmual avatar Jul 13 '22 22:07 eralmual

@jywu-msft could you please run the CI /azp run Linux DNNL CI Pipline for this PR?

georgen117 avatar Jul 20 '22 19:07 georgen117

/azp run Linux DNNL CI Pipeline

jywu-msft avatar Jul 20 '22 22:07 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jul 20 '22 22:07 azure-pipelines[bot]

@jywu-msft could you try running /azp run Linux DNNL CI Pipeline again please?

eralmual avatar Jul 28 '22 15:07 eralmual

/azp run Linux DNNL CI Pipeline

jywu-msft avatar Jul 28 '22 16:07 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jul 28 '22 16:07 azure-pipelines[bot]

Sorry @jywu-msft could you give it another try?

eralmual avatar Jul 28 '22 17:07 eralmual

/azp run Linux DNNL CI Pipeline

eralmual avatar Jul 29 '22 18:07 eralmual

Commenter does not have sufficient privileges for PR 12172 in repo microsoft/onnxruntime

azure-pipelines[bot] avatar Jul 29 '22 18:07 azure-pipelines[bot]

@jywu-msft just to remind you about this

eralmual avatar Aug 01 '22 17:08 eralmual

/azp run Linux DNNL CI Pipeline

jywu-msft avatar Aug 03 '22 15:08 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 03 '22 15:08 azure-pipelines[bot]

@jywu-msft could you try again please

eralmual avatar Aug 03 '22 22:08 eralmual

@jywu-msft would you mind running the /azp run Linux DNNL CI Pipeline again?

georgen117 avatar Aug 08 '22 15:08 georgen117

/azp run Linux DNNL CI Pipline

jywu-msft avatar Aug 08 '22 15:08 jywu-msft

No pipelines are associated with this pull request.

azure-pipelines[bot] avatar Aug 08 '22 15:08 azure-pipelines[bot]

No pipelines are associated with this pull request.

@jywu-msft Do you know why we got this message?

georgen117 avatar Aug 08 '22 16:08 georgen117

/azp run Linux DNNL CI Pipeline

jywu-msft avatar Aug 08 '22 21:08 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 08 '22 21:08 azure-pipelines[bot]

No pipelines are associated with this pull request.

@jywu-msft Do you know why we got this message?

sorry, i did a copy and paste and it seems the source had a typo.

jywu-msft avatar Aug 08 '22 21:08 jywu-msft

@jywu-msft could you try running /azp run Linux DNNL CI Pipeline again please?

eralmual avatar Aug 11 '22 18:08 eralmual

/azp run Linux DNNL CI Pipeline

jywu-msft avatar Aug 11 '22 18:08 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 11 '22 18:08 azure-pipelines[bot]

@jywu-msft can we try again please? /azp run Linux DNNL CI Pipeline

eralmual avatar Aug 11 '22 20:08 eralmual

@jywu-msft can you run /azp run Linux DNNL CI Pipeline again please?

georgen117 avatar Aug 15 '22 18:08 georgen117

/azp run Linux DNNL CI Pipeline

jywu-msft avatar Aug 15 '22 20:08 jywu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 15 '22 20:08 azure-pipelines[bot]

@jywu-msft could you run /azp run Linux DNNL CI Pipeline again please?

eralmual avatar Aug 18 '22 16:08 eralmual

@jywu-msft could you run /azp run Linux DNNL CI Pipeline again please?

georgen117 avatar Aug 19 '22 18:08 georgen117