From be1d9ec9f49cf49ec340ab9444c20a38a3733310 Mon Sep 17 00:00:00 2001 From: Kah Xuan Lim Date: Thu, 15 Feb 2024 15:38:36 +0800 Subject: [PATCH 1/2] Modem ML: Add TFLiteService to device specific services. Bug: 307449478 Change-Id: Idab76b6afc60dc76c196910376ea8d1fc980e749 --- device.mk | 6 ++++++ overlay/frameworks/base/core/res/res/values/config.xml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/device.mk b/device.mk index 28e7c1e..e47d425 100644 --- a/device.mk +++ b/device.mk @@ -970,6 +970,12 @@ PRODUCT_PACKAGES += modem_svc_sit # modem_ml_svc_sit daemon PRODUCT_PACKAGES += modem_ml_svc_sit +# Modem ML TFLite service. +PRODUCT_PACKAGES += modemml-tflite-service \ + libtensorflowlite_jni + +PRODUCT_SYSTEM_SERVER_JARS += modemml-tflite-service + # modem ML models configs ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) PRODUCT_COPY_FILES += \ diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index ffbbf72..81e4b11 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -300,6 +300,12 @@ com.bilibili.app.in:0.07 com.twitter.android:0.07 com.google.android.youtube:0.07 + + + + + com.android.server.modemml.TFLiteService From 743b5d57c6f37ed741f064e1b87562c279c78fe8 Mon Sep 17 00:00:00 2001 From: Kah Xuan Lim Date: Thu, 15 Feb 2024 15:39:27 +0800 Subject: [PATCH 2/2] Modem ML: Add TFLite config files Users will specify the default configurations for the TFLite models registered in the config files. Bug: 307449476 Change-Id: I22b753f7995abeae8e7ce477415dc6dc723d6220 --- device.mk | 6 ++++-- ..._ml_models_user.conf => modem_ml_nnapi_models_user.conf} | 0 ..._userdebug.conf => modem_ml_nnapi_models_userdebug.conf} | 0 modem_ml/modem_ml_tflite_models_user.conf | 1 + modem_ml/modem_ml_tflite_models_userdebug.conf | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) rename modem_ml/{modem_ml_models_user.conf => modem_ml_nnapi_models_user.conf} (100%) rename modem_ml/{modem_ml_models_userdebug.conf => modem_ml_nnapi_models_userdebug.conf} (100%) create mode 100644 modem_ml/modem_ml_tflite_models_user.conf create mode 100644 modem_ml/modem_ml_tflite_models_userdebug.conf diff --git a/device.mk b/device.mk index e47d425..4c897fe 100644 --- a/device.mk +++ b/device.mk @@ -979,10 +979,12 @@ PRODUCT_SYSTEM_SERVER_JARS += modemml-tflite-service # modem ML models configs ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) PRODUCT_COPY_FILES += \ - device/google/zumapro/modem_ml/modem_ml_models_userdebug.conf:$(TARGET_COPY_OUT_VENDOR)/etc/modem_ml_models.conf + device/google/zumapro/modem_ml/modem_ml_nnapi_models_userdebug.conf:$(TARGET_COPY_OUT_VENDOR)/etc/modem_ml_models.conf \ + device/google/zumapro/modem_ml/modem_ml_tflite_models_userdebug.conf:$(TARGET_COPY_OUT_VENDOR)/etc/modem_ml_tflite_models.conf else PRODUCT_COPY_FILES += \ - device/google/zumapro/modem_ml/modem_ml_models_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/modem_ml_models.conf + device/google/zumapro/modem_ml/modem_ml_nnapi_models_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/modem_ml_models.conf \ + device/google/zumapro/modem_ml/modem_ml_tflite_models_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/modem_ml_tflite_models.conf endif # modem logging binary/configs diff --git a/modem_ml/modem_ml_models_user.conf b/modem_ml/modem_ml_nnapi_models_user.conf similarity index 100% rename from modem_ml/modem_ml_models_user.conf rename to modem_ml/modem_ml_nnapi_models_user.conf diff --git a/modem_ml/modem_ml_models_userdebug.conf b/modem_ml/modem_ml_nnapi_models_userdebug.conf similarity index 100% rename from modem_ml/modem_ml_models_userdebug.conf rename to modem_ml/modem_ml_nnapi_models_userdebug.conf diff --git a/modem_ml/modem_ml_tflite_models_user.conf b/modem_ml/modem_ml_tflite_models_user.conf new file mode 100644 index 0000000..9122b5e --- /dev/null +++ b/modem_ml/modem_ml_tflite_models_user.conf @@ -0,0 +1 @@ +#name,version,ml_type,compute_enable,compute_timer,train_enable,train_timer,monitor_enable_monitor_timer,use_nnapi,execution_preference,accelerator_name,allow_fp16_precision diff --git a/modem_ml/modem_ml_tflite_models_userdebug.conf b/modem_ml/modem_ml_tflite_models_userdebug.conf new file mode 100644 index 0000000..9122b5e --- /dev/null +++ b/modem_ml/modem_ml_tflite_models_userdebug.conf @@ -0,0 +1 @@ +#name,version,ml_type,compute_enable,compute_timer,train_enable,train_timer,monitor_enable_monitor_timer,use_nnapi,execution_preference,accelerator_name,allow_fp16_precision