From 6a6786673ef586d61abd25afa6e492b60d7c7ca9 Mon Sep 17 00:00:00 2001 From: Alan Kelly Date: Fri, 31 Mar 2023 00:57:13 -0700 Subject: [PATCH] Do not explicitly set XNNPACK delegate flags. XNNPACK is now enabled by default for all types so the behaviour remains identical. PiperOrigin-RevId: 520855384 --- mediapipe/calculators/tensor/inference_calculator_cpu.cc | 2 -- mediapipe/calculators/tensor/inference_calculator_xnnpack.cc | 2 -- mediapipe/calculators/tflite/tflite_inference_calculator.cc | 2 -- 3 files changed, 6 deletions(-) diff --git a/mediapipe/calculators/tensor/inference_calculator_cpu.cc b/mediapipe/calculators/tensor/inference_calculator_cpu.cc index a18a463ae..80d36ba68 100644 --- a/mediapipe/calculators/tensor/inference_calculator_cpu.cc +++ b/mediapipe/calculators/tensor/inference_calculator_cpu.cc @@ -151,8 +151,6 @@ InferenceCalculatorCpuImpl::MaybeCreateDelegate(CalculatorContext* cc) { auto xnnpack_opts = TfLiteXNNPackDelegateOptionsDefault(); xnnpack_opts.num_threads = GetXnnpackNumThreads(opts_has_delegate, opts_delegate); - // TODO Remove once XNNPACK is enabled by default. - xnnpack_opts.flags |= TFLITE_XNNPACK_DELEGATE_FLAG_QU8; return TfLiteDelegatePtr(TfLiteXNNPackDelegateCreate(&xnnpack_opts), &TfLiteXNNPackDelegateDelete); } diff --git a/mediapipe/calculators/tensor/inference_calculator_xnnpack.cc b/mediapipe/calculators/tensor/inference_calculator_xnnpack.cc index 4212534a1..a9417d508 100644 --- a/mediapipe/calculators/tensor/inference_calculator_xnnpack.cc +++ b/mediapipe/calculators/tensor/inference_calculator_xnnpack.cc @@ -114,8 +114,6 @@ InferenceCalculatorXnnpackImpl::CreateDelegate(CalculatorContext* cc) { auto xnnpack_opts = TfLiteXNNPackDelegateOptionsDefault(); xnnpack_opts.num_threads = GetXnnpackNumThreads(opts_has_delegate, opts_delegate); - // TODO Remove once XNNPACK is enabled by default. - xnnpack_opts.flags |= TFLITE_XNNPACK_DELEGATE_FLAG_QU8; return TfLiteDelegatePtr(TfLiteXNNPackDelegateCreate(&xnnpack_opts), &TfLiteXNNPackDelegateDelete); } diff --git a/mediapipe/calculators/tflite/tflite_inference_calculator.cc b/mediapipe/calculators/tflite/tflite_inference_calculator.cc index 0f7fa933e..6d3250a5b 100644 --- a/mediapipe/calculators/tflite/tflite_inference_calculator.cc +++ b/mediapipe/calculators/tflite/tflite_inference_calculator.cc @@ -941,8 +941,6 @@ absl::Status TfLiteInferenceCalculator::LoadDelegate(CalculatorContext* cc) { if (use_xnnpack) { auto xnnpack_opts = TfLiteXNNPackDelegateOptionsDefault(); xnnpack_opts.num_threads = GetXnnpackNumThreads(calculator_opts); - // TODO Remove once XNNPACK is enabled by default. - xnnpack_opts.flags |= TFLITE_XNNPACK_DELEGATE_FLAG_QU8; delegate_ = TfLiteDelegatePtr(TfLiteXNNPackDelegateCreate(&xnnpack_opts), &TfLiteXNNPackDelegateDelete); RET_CHECK_EQ(interpreter_->ModifyGraphWithDelegate(delegate_.get()),