thermal: add support of LSTM model sensors

- add tflite model files
- add lstm model sensors to thermal config
- add lstm model sensor to virtual skin prediction

Bug: 308179047
Test: build and validate thermal service

Change-Id: Iaff613d75b3766bfbdf40b391e453a94172872a3
Signed-off-by: Jikai Ma <jikai@google.com>
This commit is contained in:
Jikai Ma 2024-03-13 21:25:17 -07:00
parent 7b34b39057
commit 7a7ba4ae75
7 changed files with 57 additions and 8 deletions

View file

@ -27,7 +27,8 @@ PRODUCT_COPY_FILES += \
ifneq (,$(filter $(TARGET_DEVICE),komodo caiman tokay)) ifneq (,$(filter $(TARGET_DEVICE),komodo caiman tokay))
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
$(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_$(TARGET_DEVICE)_proto.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_proto.json \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_$(TARGET_DEVICE)_proto.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_proto.json \
$(TARGET_VENDOR_THERMAL_CONFIG_PATH)/vt_estimation_model_$(TARGET_DEVICE).tflite:$(TARGET_COPY_OUT_VENDOR)/etc/vt_estimation_model.tflite $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/vt_estimation_model_$(TARGET_DEVICE).tflite:$(TARGET_COPY_OUT_VENDOR)/etc/vt_estimation_model.tflite \
$(TARGET_VENDOR_THERMAL_CONFIG_PATH)/vt_prediction_lstm_model_$(TARGET_DEVICE).tflite:$(TARGET_COPY_OUT_VENDOR)/etc/vt_prediction_lstm_model.tflite
ifneq (,$(filter $(TARGET_BUILD_VARIANT), userdebug eng)) ifneq (,$(filter $(TARGET_BUILD_VARIANT), userdebug eng))
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
$(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_$(TARGET_DEVICE)_wingboard.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_wingboard.json $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_$(TARGET_DEVICE)_wingboard.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_wingboard.json

View file

@ -188,6 +188,19 @@
"Coefficient": [1.0, -1.0], "Coefficient": [1.0, -1.0],
"Multiplier": 1 "Multiplier": 1
}, },
{
"Name": "VIRTUAL-SKIN-LSTM-MODEL",
"Type": "UNKNOWN",
"VirtualSensor": true,
"ModelPath": "vt_prediction_lstm_model.tflite",
"Formula": "USE_ML_MODEL",
"Combination": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "battery", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"],
"PreviousSampleCount": 11,
"OutputLabelCount": 6,
"Multiplier": 0.001,
"SupportUnderStampling": true,
"ValidateInput": true
},
{ {
"Name": "STATS-UPDATOR", "Name": "STATS-UPDATOR",
"Type": "UNKNOWN", "Type": "UNKNOWN",
@ -195,8 +208,8 @@
"Hidden": true, "Hidden": true,
"TriggerSensor": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], "TriggerSensor": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"],
"Formula": "WEIGHTED_AVG", "Formula": "WEIGHTED_AVG",
"Combination": ["VIRTUAL-SKIN-MODEL", "VIRTUAL-SKIN-LEGACY", "VIRTUAL-SKIN-MODEL-LEGACY-DIFF"], "Combination": ["VIRTUAL-SKIN-MODEL", "VIRTUAL-SKIN-LEGACY", "VIRTUAL-SKIN-MODEL-LEGACY-DIFF", "VIRTUAL-SKIN-LSTM-MODEL"],
"Coefficient": [0.0, 0.0, 0.0], "Coefficient": [0.0, 0.0, 0.0, 0.0],
"Multiplier": 1, "Multiplier": 1,
"SendPowerHint": true, "SendPowerHint": true,
"PollingDelay": 300000, "PollingDelay": 300000,
@ -218,6 +231,9 @@
"SendCallback": true, "SendCallback": true,
"PollingDelay": 300000, "PollingDelay": 300000,
"PassiveDelay": 7000, "PassiveDelay": 7000,
"PredictorInfo": {
"Sensor": "VIRTUAL-SKIN-LSTM-MODEL"
},
"BindedCdevInfo": [ "BindedCdevInfo": [
{ {
"CdevRequest": "tpu_cooling", "CdevRequest": "tpu_cooling",

View file

@ -211,6 +211,19 @@
"Coefficient": [1.0, -1.0], "Coefficient": [1.0, -1.0],
"Multiplier": 1 "Multiplier": 1
}, },
{
"Name": "VIRTUAL-SKIN-LSTM-MODEL",
"Type": "UNKNOWN",
"VirtualSensor": true,
"ModelPath": "vt_prediction_lstm_model.tflite",
"Formula": "USE_ML_MODEL",
"Combination": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "battery", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"],
"PreviousSampleCount": 11,
"OutputLabelCount": 6,
"Multiplier": 0.001,
"SupportUnderSampling": true,
"ValidateInput": true
},
{ {
"Name": "STATS-UPDATOR", "Name": "STATS-UPDATOR",
"Type": "UNKNOWN", "Type": "UNKNOWN",
@ -218,8 +231,8 @@
"Hidden": true, "Hidden": true,
"TriggerSensor": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], "TriggerSensor": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"],
"Formula": "WEIGHTED_AVG", "Formula": "WEIGHTED_AVG",
"Combination": ["VIRTUAL-SKIN-MODEL", "VIRTUAL-SKIN-LEGACY", "VIRTUAL-SKIN-MODEL-LEGACY-DIFF"], "Combination": ["VIRTUAL-SKIN-MODEL", "VIRTUAL-SKIN-LEGACY", "VIRTUAL-SKIN-MODEL-LEGACY-DIFF", "VIRTUAL-SKIN-LSTM-MODEL"],
"Coefficient": [0.0, 0.0, 0.0], "Coefficient": [0.0, 0.0, 0.0, 0.0],
"Multiplier": 1, "Multiplier": 1,
"SendPowerHint": true, "SendPowerHint": true,
"PollingDelay": 300000, "PollingDelay": 300000,
@ -241,6 +254,9 @@
"SendCallback": true, "SendCallback": true,
"PollingDelay": 300000, "PollingDelay": 300000,
"PassiveDelay": 7000, "PassiveDelay": 7000,
"PredictorInfo": {
"Sensor": "VIRTUAL-SKIN-LSTM-MODEL"
},
"BindedCdevInfo": [ "BindedCdevInfo": [
{ {
"CdevRequest": "tpu_cooling", "CdevRequest": "tpu_cooling",

View file

@ -178,6 +178,19 @@
"Coefficient": [1.0, -1.0], "Coefficient": [1.0, -1.0],
"Multiplier": 1 "Multiplier": 1
}, },
{
"Name": "VIRTUAL-SKIN-LSTM-MODEL",
"Type": "UNKNOWN",
"VirtualSensor": true,
"ModelPath": "vt_prediction_lstm_model.tflite",
"Formula": "USE_ML_MODEL",
"Combination": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "battery", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"],
"PreviousSampleCount": 11,
"OutputLabelCount": 6,
"Multiplier": 0.001,
"SupportUnderSampling": true,
"ValidateInput": true
},
{ {
"Name": "STATS-UPDATOR", "Name": "STATS-UPDATOR",
"Type": "UNKNOWN", "Type": "UNKNOWN",
@ -185,8 +198,8 @@
"Hidden": true, "Hidden": true,
"TriggerSensor": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], "TriggerSensor": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"],
"Formula": "WEIGHTED_AVG", "Formula": "WEIGHTED_AVG",
"Combination": ["VIRTUAL-SKIN-MODEL", "VIRTUAL-SKIN-LEGACY", "VIRTUAL-SKIN-MODEL-LEGACY-DIFF"], "Combination": ["VIRTUAL-SKIN-MODEL", "VIRTUAL-SKIN-LEGACY", "VIRTUAL-SKIN-MODEL-LEGACY-DIFF", "VIRTUAL-SKIN-LSTM-MODEL"],
"Coefficient": [0.0, 0.0, 0.0], "Coefficient": [0.0, 0.0, 0.0, 0.0],
"Multiplier": 1, "Multiplier": 1,
"SendPowerHint": true, "SendPowerHint": true,
"PollingDelay": 300000, "PollingDelay": 300000,
@ -208,6 +221,9 @@
"SendCallback": true, "SendCallback": true,
"PollingDelay": 300000, "PollingDelay": 300000,
"PassiveDelay": 7000, "PassiveDelay": 7000,
"PredictorInfo": {
"Sensor": "VIRTUAL-SKIN-LSTM-MODEL"
},
"BindedCdevInfo": [ "BindedCdevInfo": [
{ {
"CdevRequest": "tpu_cooling", "CdevRequest": "tpu_cooling",

Binary file not shown.

Binary file not shown.

Binary file not shown.