Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- Qwen3-1.7B-w8a8-rk3588.rkllm +3 -0
- README.md +135 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
Qwen3-1.7B-w8a8-rk3588.rkllm filter=lfs diff=lfs merge=lfs -text
|
Qwen3-1.7B-w8a8-rk3588.rkllm
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:52219492d52ea3ec4a7143770ab1e394fb8c339caceb4002f3c7659da3e735eb
|
| 3 |
+
size 2375021644
|
README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: rkllm
|
| 4 |
+
base_model: Qwen/Qwen3-1.7B
|
| 5 |
+
tags:
|
| 6 |
+
- rkllm
|
| 7 |
+
- rk3588
|
| 8 |
+
- npu
|
| 9 |
+
- rockchip
|
| 10 |
+
- qwen3
|
| 11 |
+
- thinking
|
| 12 |
+
- reasoning
|
| 13 |
+
- quantized
|
| 14 |
+
- edge-ai
|
| 15 |
+
- orange-pi
|
| 16 |
+
model_name: Qwen3-1.7B-RKLLM-v1.2.3
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
+
language:
|
| 19 |
+
- en
|
| 20 |
+
- zh
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# Qwen3-1.7B — RKLLM v1.2.3 (w8a8, RK3588)
|
| 24 |
+
|
| 25 |
+
RKLLM conversion of [Qwen/Qwen3-1.7B](https://huggingface.co/Qwen/Qwen3-1.7B) for Rockchip RK3588 NPU inference.
|
| 26 |
+
|
| 27 |
+
Converted with **RKLLM Toolkit v1.2.3**, which includes full **thinking mode support** — the model produces `<think>…</think>` reasoning blocks when used with compatible runtimes.
|
| 28 |
+
|
| 29 |
+
## Key Details
|
| 30 |
+
|
| 31 |
+
| Property | Value |
|
| 32 |
+
|---|---|
|
| 33 |
+
| **Base Model** | [Qwen/Qwen3-1.7B](https://huggingface.co/Qwen/Qwen3-1.7B) |
|
| 34 |
+
| **Toolkit Version** | RKLLM Toolkit v1.2.3 |
|
| 35 |
+
| **Runtime Version** | RKLLM Runtime ≥ v1.2.1 (v1.2.3 recommended) |
|
| 36 |
+
| **Quantization** | w8a8 (8-bit weights, 8-bit activations) |
|
| 37 |
+
| **Quantization Algorithm** | normal |
|
| 38 |
+
| **Target Platform** | RK3588 |
|
| 39 |
+
| **NPU Cores** | 3 |
|
| 40 |
+
| **Max Context Length** | 4096 tokens |
|
| 41 |
+
| **Optimization Level** | 1 |
|
| 42 |
+
| **Thinking Mode** | ✅ Supported |
|
| 43 |
+
| **Languages** | English, Chinese (+ others inherited from Qwen3) |
|
| 44 |
+
|
| 45 |
+
## Why This Conversion?
|
| 46 |
+
|
| 47 |
+
Previous Qwen3-1.7B RKLLM conversions on HuggingFace were built with **Toolkit v1.2.0**, which predates thinking mode support (added in v1.2.1). The chat template baked into those `.rkllm` files does not include the `<think>` trigger, so the model never produces reasoning output.
|
| 48 |
+
|
| 49 |
+
This conversion uses **Toolkit v1.2.3**, which correctly embeds the thinking-enabled chat template into the model file.
|
| 50 |
+
|
| 51 |
+
## Thinking Mode
|
| 52 |
+
|
| 53 |
+
Qwen3-1.7B is a hybrid thinking model. When served through an OpenAI-compatible API that parses `<think>` tags, reasoning content appears separately from the final answer — enabling UIs like Open WebUI to show a collapsible "Thinking…" section.
|
| 54 |
+
|
| 55 |
+
Example raw output:
|
| 56 |
+
```
|
| 57 |
+
<think>
|
| 58 |
+
The user is asking about the capital of France. This is a straightforward geography question.
|
| 59 |
+
</think>
|
| 60 |
+
The capital of France is Paris.
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
## Hardware Tested
|
| 64 |
+
|
| 65 |
+
- **Orange Pi 5 Plus** — RK3588, 16GB RAM, Armbian Linux
|
| 66 |
+
- RKNPU driver 0.9.8
|
| 67 |
+
- RKLLM Runtime v1.2.3
|
| 68 |
+
|
| 69 |
+
## Usage
|
| 70 |
+
|
| 71 |
+
### With the official RKLLM API demo
|
| 72 |
+
|
| 73 |
+
```bash
|
| 74 |
+
# Clone the runtime
|
| 75 |
+
git clone https://github.com/airockchip/rknn-llm.git
|
| 76 |
+
cd rknn-llm/examples/rkllm_api_demo
|
| 77 |
+
|
| 78 |
+
# Run (aarch64)
|
| 79 |
+
./build/rkllm_api_demo /path/to/Qwen3-1.7B-w8a8-rk3588.rkllm 2048 4096
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
### With a custom OpenAI-compatible server
|
| 83 |
+
|
| 84 |
+
Any server that launches the RKLLM binary and parses `<think>` tags from the output stream will work. The model responds to standard chat completion requests.
|
| 85 |
+
|
| 86 |
+
## Conversion Script
|
| 87 |
+
|
| 88 |
+
```python
|
| 89 |
+
from rkllm.api import RKLLM
|
| 90 |
+
|
| 91 |
+
model_path = "Qwen/Qwen3-1.7B" # or local path
|
| 92 |
+
output_path = "./Qwen3-1.7B-w8a8-rk3588.rkllm"
|
| 93 |
+
dataset_path = "./data_quant.json" # calibration data
|
| 94 |
+
|
| 95 |
+
# Load
|
| 96 |
+
llm = RKLLM()
|
| 97 |
+
llm.load_huggingface(model=model_path, model_lora=None, device="cpu")
|
| 98 |
+
|
| 99 |
+
# Build
|
| 100 |
+
llm.build(
|
| 101 |
+
do_quantization=True,
|
| 102 |
+
optimization_level=1,
|
| 103 |
+
quantized_dtype="w8a8",
|
| 104 |
+
quantized_algorithm="normal",
|
| 105 |
+
target_platform="rk3588",
|
| 106 |
+
num_npu_core=3,
|
| 107 |
+
extra_qparams=None,
|
| 108 |
+
dataset=dataset_path,
|
| 109 |
+
max_context=4096,
|
| 110 |
+
)
|
| 111 |
+
|
| 112 |
+
# Export
|
| 113 |
+
llm.export_rkllm(output_path)
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
Calibration dataset: 21 diverse prompt/completion pairs (English + Chinese) generated with `generate_data_quant.py` from the [rknn-llm examples](https://github.com/airockchip/rknn-llm/tree/main/examples/rkllm_api_demo/export).
|
| 117 |
+
|
| 118 |
+
## File Listing
|
| 119 |
+
|
| 120 |
+
| File | Description |
|
| 121 |
+
|---|---|
|
| 122 |
+
| `Qwen3-1.7B-w8a8-rk3588.rkllm` | Quantized model for RK3588 NPU |
|
| 123 |
+
|
| 124 |
+
## Compatibility Notes
|
| 125 |
+
|
| 126 |
+
- **Minimum runtime**: RKLLM Runtime v1.2.1 (for thinking mode). v1.2.3 recommended.
|
| 127 |
+
- **RKNPU driver**: ≥ 0.9.6
|
| 128 |
+
- **SoCs**: RK3588 / RK3588S (3 NPU cores). Not compatible with RK3576 (2 cores) without reconversion.
|
| 129 |
+
- **RAM**: ~2GB loaded. Runs comfortably on 8GB+ boards.
|
| 130 |
+
|
| 131 |
+
## Acknowledgements
|
| 132 |
+
|
| 133 |
+
- [Qwen Team](https://huggingface.co/Qwen) for the base model
|
| 134 |
+
- [Rockchip / airockchip](https://github.com/airockchip/rknn-llm) for the RKLLM toolkit and runtime
|
| 135 |
+
- Converted by [GatekeeperZA](https://huggingface.co/GatekeeperZA)
|