Skip to content

Add nhwc support for NNAPI EP, add concat op, handle concurrent calls to NNAPI model#4356

Merged
guoyu-wang merged 4 commits intomasterfrom
nnapi_nhwc
Jun 29, 2020
Merged

Add nhwc support for NNAPI EP, add concat op, handle concurrent calls to NNAPI model#4356
guoyu-wang merged 4 commits intomasterfrom
nnapi_nhwc

Conversation

@guoyu-wang
Copy link
Copy Markdown
Contributor

Description:
NNAPI natively runs more efficiently on nhwc inputs, while onnx uses nchw inputs, although it is supported by NNAPI but all the conv/pool/... operations will fall back to CPU which is much slower

Motivation and Context:
Add internal nchw->nhwc transpose of the inputs when it is necessary (such as the input of conv/pool/...), and only transpose back (nhwc->nchw) only if it is necessary.

Other changes includes in this PR:

  1. Added concat op
  2. Added exclusive lock to the NNAPI model while being executed.
  3. Added device options, such that we can choose the NNAPI model to run on CPU only or disable CPU
  4. Minor code style fix

@guoyu-wang guoyu-wang requested a review from a team as a code owner June 27, 2020 01:24
@guoyu-wang guoyu-wang merged commit 5f4e63e into master Jun 29, 2020
@guoyu-wang guoyu-wang deleted the nnapi_nhwc branch June 29, 2020 18:55
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.

2 participants