Skip to content

Commit a9ece43

Browse files
authored
Update README.md (Tiiny-AI#260)
* Update README.md * update * Update README.md * Update README.md
1 parent b0930a5 commit a9ece43

9 files changed

Lines changed: 50 additions & 8 deletions

File tree

.gitmodules

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[submodule "smallthinker/ggml/src/ggml-kompute/kompute"]
2+
path = smallthinker/ggml/src/ggml-kompute/kompute
3+
url = https://github.com/nomic-ai/kompute.git
4+
[submodule "smallthinker/powerinfer/third_part/perfetto"]
5+
path = smallthinker/powerinfer/third_part/perfetto
6+
url = https://github.com/google/perfetto.git
7+
[submodule "smallthinker/powerinfer/third_part/benchmark"]
8+
path = smallthinker/powerinfer/third_part/benchmark
9+
url = https://github.com/google/benchmark.git
10+
[submodule "smallthinker/powerinfer/third_part/googletest"]
11+
path = smallthinker/powerinfer/third_part/googletest
12+
url = https://github.com/google/googletest.git
13+
[submodule "smallthinker/powerinfer/third_part/libaio"]
14+
path = smallthinker/powerinfer/third_part/libaio
15+
url = https://github.com/crossbuild/libaio.git
16+
[submodule "smallthinker/powerinfer/third_part/liburing"]
17+
path = smallthinker/powerinfer/third_part/liburing
18+
url = https://github.com/axboe/liburing.git
19+
[submodule "smallthinker/powerinfer/third_part/fmt"]
20+
path = smallthinker/powerinfer/third_part/fmt
21+
url = https://github.com/fmtlib/fmt.git

smallthinker/README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
## Intro
2-
- SmallThinker is a family of on-device native Mixture-of-Experts (MoE) language models specially designed for local deployment, co-developed by the IPADS and School of AI at Shanghai Jiao Tong University and Zenergize AI. Designed from the ground up for resource-constrained environments, SmallThinker brings powerful, private, and low-latency AI directly to your personal devices, without relying on the cloud.
2+
- SmallThinker ([SmallThinker-21BA3B-Instruct](https://huggingface.co/PowerInfer/SmallThinker-21BA3B-Instruct) and [SmallThinker-4BA0.6B-Instruct](https://huggingface.co/PowerInfer/SmallThinker-4BA0.6B-Instruct)) is a family of on-device native Mixture-of-Experts (MoE) language models specially designed for local deployment, co-developed by the IPADS and School of AI at Shanghai Jiao Tong University and Zenergize AI. Designed from the ground up for resource-constrained environments, SmallThinker brings powerful, private, and low-latency AI directly to your personal devices, without relying on the cloud.
33

44
- This inference framework is specifically optimized for sparse model inference to achieve faster speeds, leveraging the router's pre-selection mechanism to enable efficient inference even in memory-constrained scenarios.
55

66
## Demo
77

8+
9+
https://github.com/user-attachments/assets/cefd466e-3b1f-47a9-8dc3-f1cf5119045e
10+
11+
812
## Speed
913
### SmallThinker 21B
10-
| Model | Memory(GiB) | i9 14900 | 1+13 8ge4 | rk3588 (16G) | Raspberry PI 5 |
14+
| Model | Memory(GiB) | i9 14900 | 1+13 8ge4 | rk3588 (16G) | Raspberry PI 5 |
1115
|--------------------------------------|---------------------|----------|-----------|--------------|----------------|
1216
| SmallThinker 21B+sparse | 11.47 | 30.19 | 23.03 | 10.84 | 6.61 |
13-
| SmallThinker 21B+sparse +limited memory | 84 | limit 8G | 20.30 | 15.50 | 8.56 |
17+
| SmallThinker 21B+sparse +limited memory | limit 8G | 20.30 | 15.50 | 8.56 | - |
1418
| Qwen3 30B A3B | 16.20 | 33.52 | 20.18 | 9.07 | - |
15-
| Qwen3 30B A3Blimited memory | 81.38 | limit 8G | 10.11 | 0.18 | 6.32 |
19+
| Qwen3 30B A3Blimited memory | limit 8G | 10.11 | 0.18 | 6.32 | - |
1620
| Gemma 3n E2B | 1G, theoretically | 36.88 | 27.06 | 12.50 | 6.66 |
1721
| Gemma 3n E4B | 2G, theoretically | 21.93 | 16.58 | 7.37 | 4.01 |
1822

@@ -31,12 +35,21 @@
3135
Note:i9 14900、1+13 8ge4 use 4 threads,others use the number of threads that can achieve the maximum speed
3236

3337
## Setup
38+
1. init submodule:
3439

35-
1. install clang-21 and mold:
40+
```bash
41+
git submodule update --init --recursive
42+
```
43+
2. install clang-21 and mold:
3644

3745
```bash
3846
sudo apt install clang-21 mold
3947
```
48+
3. cd smallthinker before compiling
49+
```bash
50+
cd smallthinker
51+
```
52+
4053

4154
## Convert Model
4255
```bash
@@ -140,11 +153,12 @@ python get_no_moe_weights_ffn.py /path/to/gguf_q4_0 /path/to/no_moe_gguf_q4_0
140153
```bash
141154
EXPERT_BUNDLE_PATH=/path/to/bundle ./llama-cli -m /path/to/no_moe_gguf_q4_0 --no-cnv --temp 0.6 --top-k 20 --top-p 0.95 --samplers "temperature;top_k;top_p" -p "<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n<|im_start|>user\nCalculate the integral of f(x) = sin(x) from 0 to 3pi/4.<|im_end|>\n<|im_start|>assistant" -t 4 -n 256 -ub 4
142155
```
143-
### LM Head Sparsity:
144-
1. The 4B model uses a sparse lm_head which may lead to some loss in precision. If you want to disable it, change the condition at src/llama-model.cpp:7580 to false.But the speed is slower.
156+
### Note:
157+
1. The models use a sparse lm_head which may lead to some loss in precision. If you want to disable it, change the condition at src/llama-model.cpp:7580 to false.But the speed is slower.
158+
2. It may require root privileges when running in Termux when run the Memory-Efficient Version.
145159

146160

147161
## Acknowledgements
148162

149163
We would like to thank the following projects:
150-
- [llama.cpp](https://github.com/ggml-org/llama.cpp)
164+
- [llama.cpp](https://github.com/ggml-org/llama.cpp)
Submodule kompute added at 7c20efa
Submodule benchmark added at 77c03fb
Submodule fmt added at 35dcc58
Submodule googletest added at 32f9f4c
Submodule libaio added at 5a546a8
Submodule liburing added at f2b6fb8
Submodule perfetto added at 967c577

0 commit comments

Comments
 (0)