Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tflite] Make --nnapi_accelerator_name work in kernel tests #42400

Conversation

freedomtan
Copy link
Contributor

Originally, when --nnapi=true, always test nnapi-reference, the NNAPI CPU reference implementation. Now when --nnapi_accelerator_name is specified, set it as is.

@multiverse-tf: my colleagues and me want to use these kernel tests to test NNAPI drivers other than nnapi-reference.

@google-ml-butler google-ml-butler bot added the size:S CL Change Size: Small label Aug 16, 2020
@freedomtan freedomtan force-pushed the make_nnapi_accelerator_name_work branch from cd2ccf8 to abdd0e2 Compare August 16, 2020 01:56
delegate_providers->MutableParams()->Set<std::string>(
"nnapi_accelerator_name", "nnapi-reference");
opt_name, accelerator_name.empty() ? "nnapi-reference"
Copy link
Contributor

Choose a reason for hiding this comment

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

Might simply overwrite the parameter value if --nnapi_accelerator_name is not set?, i.e.

auto* params = delegate_providers->MutableParams();
if (!params->HasValueSetstd::string("nnapi_accelerator_name")) {
params->Setstd::string("nnapi_accelerator_name", "nnapi-reference");
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like same logic, I didn't notice there is HasValueSet(). Updated. Thanks.

@gbaned gbaned self-assigned this Aug 17, 2020
@gbaned gbaned added the comp:lite TF Lite related issues label Aug 17, 2020
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Aug 17, 2020
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Aug 17, 2020
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Aug 17, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Aug 17, 2020
@tensorflow-copybara tensorflow-copybara merged commit 33e968d into tensorflow:master Aug 17, 2020
PR Queue automation moved this from Approved by Reviewer to Merged Aug 17, 2020
@freedomtan freedomtan deleted the make_nnapi_accelerator_name_work branch August 18, 2020 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes comp:lite TF Lite related issues ready to pull PR ready for merge process size:S CL Change Size: Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

6 participants