From 33fca29993c1e1741a7b6279b2d737d9c6323ac8 Mon Sep 17 00:00:00 2001 From: wuhanstudio Date: Fri, 23 Jan 2026 18:19:12 +0000 Subject: [PATCH 1/4] [ai] Add LiME-TM package --- ai/Kconfig | 1 + ai/LiME-TM/Kconfig | 37 +++++++++++++++++++++++++++++++++++++ ai/LiME-TM/package.json | 27 +++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 ai/LiME-TM/Kconfig create mode 100644 ai/LiME-TM/package.json diff --git a/ai/Kconfig b/ai/Kconfig index 233db460ac..42437e0ee2 100644 --- a/ai/Kconfig +++ b/ai/Kconfig @@ -12,5 +12,6 @@ source "$PKGS_DIR/packages/ai/naxos/Kconfig" source "$PKGS_DIR/packages/ai/ncnn/Kconfig" source "$PKGS_DIR/packages/ai/r-tinymaix/Kconfig" source "$PKGS_DIR/packages/ai/llmchat/Kconfig" +source "$PKGS_DIR/packages/ai/LiME-TM/Kconfig" endmenu diff --git a/ai/LiME-TM/Kconfig b/ai/LiME-TM/Kconfig new file mode 100644 index 0000000000..6895b40667 --- /dev/null +++ b/ai/LiME-TM/Kconfig @@ -0,0 +1,37 @@ + +# Kconfig file for package ulapack +menuconfig PKG_USING_LIME_TM + select RT_USING_POSIX_FS + bool "LiME-TM: Lightning fast and Memory Efficient Machine Learning for MCU (Tsetlin Machine)" + default n + +if PKG_USING_LIME_TM + + config PKG_LIME_TM_PATH + string + default "/packages/ai/LiME-TM" + + config LIME_TM_USING_MNIST_EXAMPLE + bool "Training and testing MNIST example" + help + Training a compressed Tsetlin Machine model on the MNIST dataset. + default n + + choice + prompt "Version" + default PKG_USING_LIME_TM_LATEST_VERSION + help + Select the package version + config PKG_USING_LIME_TM_LATEST_VERSION + bool "latest" + endchoice + + config PKG_LIME_TM_VER + string + default "latest" if PKG_USING_LIME_TM_LATEST_VERSION + + config PKG_LIME_TM_VER_NUM + hex + default 0x99999 if PKG_USING_LIME_TM_LATEST_VERSION + +endif diff --git a/ai/LiME-TM/package.json b/ai/LiME-TM/package.json new file mode 100644 index 0000000000..ddd2fe6129 --- /dev/null +++ b/ai/LiME-TM/package.json @@ -0,0 +1,27 @@ +{ + "name": "lime-tm", + "description": "Lightning fast and Memory Efficient Machine Learning for MCU (Tsetlin Machine)", + "description_zh": "嵌入式机器学习库", + "enable": "PKG_USING_LIME_TM", + "keywords": [ + "Machine Learning", + "Tsetlin Machine" + ], + "category": "ai", + "author": { + "name": "wuhanstudio", + "email": "wuhanstudio@qq.com", + "github": "wuhanstudio" + }, + "license": "MIT", + "repository": "https://github.com/wuhanstudio/tsetlin.idf", + "homepage": "https://github.com/wuhanstudio/tsetlin.idf#readme", + "site": [ + { + "version": "latest", + "URL": "https://github.com/wuhanstudio/tsetlin.idf.git", + "filename": "", + "VER_SHA": "main" + } + ] +} From a2a822d43f50edf670368ea73f22092d718cc73b Mon Sep 17 00:00:00 2001 From: wuhanstudio Date: Tue, 10 Feb 2026 14:53:06 +0000 Subject: [PATCH 2/4] [ai][lime-tm] Add support for static model --- ai/LiME-TM/Kconfig | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/ai/LiME-TM/Kconfig b/ai/LiME-TM/Kconfig index 6895b40667..8f1a7cf4ea 100644 --- a/ai/LiME-TM/Kconfig +++ b/ai/LiME-TM/Kconfig @@ -11,11 +11,37 @@ if PKG_USING_LIME_TM string default "/packages/ai/LiME-TM" - config LIME_TM_USING_MNIST_EXAMPLE - bool "Training and testing MNIST example" + choice + prompt "Choose exmaple" + + config LIME_TM_USING_MNIST_FS_EXAMPLE + bool "Training and testing MNIST example (File System)" + select TSETLIN_USING_PROTOBUF + help + Training a compressed Tsetlin Machine model on the MNIST dataset. + default n + + config LIME_TM_USING_MNIST_STATIC_EXAMPLE + bool "Training and testing MNIST example (Static Model)" + select TSETLIN_USING_STATIC_MODEL + help + Training a compressed Tsetlin Machine model on the MNIST dataset. + default y + endchoice + + config TSETLIN_USING_PROTOBUF + bool "Load model from protobuf file" + help + Using proto-c to save the model as a protobuf file. + depends on LIME_TM_USING_MNIST_FS_EXAMPLE + default y + + config TSETLIN_USING_STATIC_MODEL + bool "Load model from static headers" help - Training a compressed Tsetlin Machine model on the MNIST dataset. - default n + Using the tsetlin compiler to save the model as a static C header file. + depends on LIME_TM_USING_MNIST_STATIC_EXAMPLE + default y choice prompt "Version" From b552732f6e26c0c8b9fc834db1db7934b35a858a Mon Sep 17 00:00:00 2001 From: Han Wu Date: Thu, 26 Feb 2026 11:08:15 +0000 Subject: [PATCH 3/4] Update Kconfig --- ai/LiME-TM/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/ai/LiME-TM/Kconfig b/ai/LiME-TM/Kconfig index 8f1a7cf4ea..6d85d8cc83 100644 --- a/ai/LiME-TM/Kconfig +++ b/ai/LiME-TM/Kconfig @@ -24,6 +24,7 @@ if PKG_USING_LIME_TM config LIME_TM_USING_MNIST_STATIC_EXAMPLE bool "Training and testing MNIST example (Static Model)" select TSETLIN_USING_STATIC_MODEL + select TSETLIN_MODEL_TRAINABLE help Training a compressed Tsetlin Machine model on the MNIST dataset. default y From 09ecd43db0621e1bc411ad4f9378d7ac891b5436 Mon Sep 17 00:00:00 2001 From: wuhanstudio Date: Thu, 26 Feb 2026 11:21:25 +0000 Subject: [PATCH 4/4] [LiME-TM] Add model training config --- ai/LiME-TM/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ai/LiME-TM/Kconfig b/ai/LiME-TM/Kconfig index 6d85d8cc83..03fc007897 100644 --- a/ai/LiME-TM/Kconfig +++ b/ai/LiME-TM/Kconfig @@ -37,6 +37,12 @@ if PKG_USING_LIME_TM depends on LIME_TM_USING_MNIST_FS_EXAMPLE default y + config TSETLIN_MODEL_TRAINABLE + bool "Enable model training" + help + Enabling this option allows the model to be trained on-device. + default y + config TSETLIN_USING_STATIC_MODEL bool "Load model from static headers" help