HanzoHuang commited on
Commit
780bc4b
·
verified ·
1 Parent(s): 5407549

Document 8K RK3576 preview, add matched encoders and checksums

Browse files
.gitattributes CHANGED
@@ -55,3 +55,5 @@ v1.3.1/RK3588/gemma-4-E2B-it_audio_RK3588.rknn filter=lfs diff=lfs merge=lfs -te
55
  v1.3.1/RK3588/gemma-4-E2B-it_vision_RK3588.rknn filter=lfs diff=lfs merge=lfs -text
56
  v1.3.1-8k/RK3576/gemma-4-E2B-it_RK3576_w8a8.rkllm filter=lfs diff=lfs merge=lfs -text
57
  v1.3.1-8k/RK3576/gemma-4-E2B-it_RK3576_w4a16_g128.rkllm filter=lfs diff=lfs merge=lfs -text
 
 
 
55
  v1.3.1/RK3588/gemma-4-E2B-it_vision_RK3588.rknn filter=lfs diff=lfs merge=lfs -text
56
  v1.3.1-8k/RK3576/gemma-4-E2B-it_RK3576_w8a8.rkllm filter=lfs diff=lfs merge=lfs -text
57
  v1.3.1-8k/RK3576/gemma-4-E2B-it_RK3576_w4a16_g128.rkllm filter=lfs diff=lfs merge=lfs -text
58
+ v1.3.1-8k/RK3576/gemma-4-E2B-it_vision_RK3576.rknn filter=lfs diff=lfs merge=lfs -text
59
+ v1.3.1-8k/RK3576/gemma-4-E2B-it_audio_RK3576.rknn filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
README.md CHANGED
@@ -32,20 +32,57 @@ With Docker installed, choose your model and board in reComputer AI Lab, copy th
32
 
33
  # Gemma-4-E2B-it · RKLLM
34
 
35
- * Max context length: 4096
36
 
37
  Text generation, image questions, and short audio transcription on Rockchip RK3576 and RK3588, converted from [google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it).
38
 
39
- **RK3576 preview:** image and audio requests work in the functional tests, but the vision encoder misses the numerical accuracy target. RK3576 W8A8 also fails one exact-recall check. See the measured results below before choosing this variant. RK3588 W8A8 passes the functional and encoder checks performed here.
40
 
41
  - **Conversion:** RKLLM Toolkit 1.3.1; vision/audio encoders built with RKNN Toolkit2 2.3.2.
42
  - **Inputs / output:** text, one image, or short PCM16 WAV audio → text. Audio generation and video input are not implemented in this serving release.
43
- - **Context:** exported at 4,096 tokens; board checks used 2,048, including media embeddings and generated text.
44
  - **License:** Apache 2.0; see the [original model](https://huggingface.co/google/gemma-4-E2B-it) for terms and intended use.
45
 
46
  ## Choose your files
47
 
48
- The new matched multimodal set is under **`v1.3.1/`**. Use the exact SoC for your board. Each variant needs its language file and vision encoder; add the audio encoder to enable speech input. The two RK3576 variants share the same encoders.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  | Board | Quantization | Language size | Language model |
51
  | --- | --- | --- | --- |
@@ -72,17 +109,17 @@ Their contents and checksums are unchanged; the old unversioned paths have moved
72
 
73
  ## Run on your board
74
 
75
- This RK3576 W4A16 example uses the rolling ARM64 `env-latest` image. Gemma vision/audio requires [PR #13](https://github.com/Hanzo-Huang/rkllm-docker/pull/13) to be merged and the main environment-image build to complete successfully. Download the three files first:
76
 
77
  ```bash
78
  hf download HanzoHuang/gemma-4-E2B-it-RKLLM \
79
- v1.3.1/RK3576/gemma-4-E2B-it_RK3576_w4a16_g128.rkllm \
80
- v1.3.1/RK3576/gemma-4-E2B-it_vision_RK3576.rknn \
81
- v1.3.1/RK3576/gemma-4-E2B-it_audio_RK3576.rknn \
82
  --local-dir ./models
83
 
84
  sudo docker run --pull=always --rm --name gemma4 --privileged -p 8001:8001 \
85
- -v "$PWD/models/v1.3.1/RK3576:/app/models:ro" \
86
  -e MODEL_KIND=vlm -e TARGET_PLATFORM=rk3576 -e VLM_MODEL_FAMILY=gemma4 \
87
  -e MODEL_FILE=gemma-4-E2B-it_RK3576_w4a16_g128.rkllm \
88
  -e VISION_MODEL_FILE=gemma-4-E2B-it_vision_RK3576.rknn \
@@ -91,12 +128,14 @@ sudo docker run --pull=always --rm --name gemma4 --privileged -p 8001:8001 \
91
  serve --embed_flash 1 --max_context_len 4096 --timeout 600
92
  ```
93
 
94
- For RK3588, select its three files and set `TARGET_PLATFORM=rk3588`. The API is OpenAI compatible at `/v1/chat/completions`; use `image_url` for an image or `input_audio` with base64 `data` and `format: "wav"` for speech. Supported audio is PCM16 WAV, mono/stereo, 8–48 kHz, longer than 10 ms and no more than 7.56 seconds. Split longer recordings before sending them. The audio encoder runs on one NPU core.
95
 
96
  Runtime integration: [rkllm-docker Gemma support and model definitions](https://github.com/Hanzo-Huang/rkllm-docker/pull/13).
97
 
98
  ## Release notes
99
 
 
 
100
  Measured on the matching RK3576 and RK3588 devkits with RKLLM runtime 1.3.1 and RKNN runtime 2.3.2:
101
 
102
  | Variant | Functional checks | Encoder accuracy against original float32 PyTorch |
@@ -109,7 +148,7 @@ Functional checks cover arithmetic, conversation recall, image questions, two sh
109
 
110
  The source weights were downloaded through ModelScope. Language calibration combines SDK image examples and general text prompts; it does not include the acceptance questions. The shared converter applies FP16-safe normalization and clipping and an RK3576 audio attention-layout correction through its existing single command. Rejected compiler/calibration experiments are excluded from this release.
111
 
112
- New deployable-file hashes: [SHA256SUMS](v1.3.1/SHA256SUMS), with paths relative to `v1.3.1/`.
113
 
114
  <details>
115
  <summary>Previous text-only file checksums</summary>
 
32
 
33
  # Gemma-4-E2B-it · RKLLM
34
 
35
+ * Max context length: 8192 (`v1.3.1-8k/`). Earlier `v1.3.1/` and `v1.3.0/` releases use 4096.
36
 
37
  Text generation, image questions, and short audio transcription on Rockchip RK3576 and RK3588, converted from [google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it).
38
 
39
+ **RK3576 preview:** the 8K W4 model passes 9/14 strict API checks and W8 passes 13/14. Observed limits include speech omissions, image descriptions missing the expected keyword, and W8 exact-recall errors. The shared vision encoder also misses the numerical accuracy target. The RK3588 results below describe the earlier 4096-token release.
40
 
41
  - **Conversion:** RKLLM Toolkit 1.3.1; vision/audio encoders built with RKNN Toolkit2 2.3.2.
42
  - **Inputs / output:** text, one image, or short PCM16 WAV audio → text. Audio generation and video input are not implemented in this serving release.
43
+ - **Context:** the 8K release exports 8192 tokens, with API checks at runtime limits 4096 and 8192 and benchmarks at 2048. The older 4K release was exported at 4096 and checked at 2048.
44
  - **License:** Apache 2.0; see the [original model](https://huggingface.co/google/gemma-4-E2B-it) for terms and intended use.
45
 
46
  ## Choose your files
47
 
48
+ ### 8192-token release
49
+
50
+ The 8K language models are under **`v1.3.1-8k/`**. These files were exported with RKLLM Toolkit 1.3.1. The RK3576 vision and audio encoders are byte-identical to the earlier `v1.3.1/` files and retain their measured accuracy limits.
51
+
52
+ | Board | Quantization | Language size | Language model |
53
+ | --- | --- | --- | --- |
54
+ | RK3576 | `w4a16_g128` | 7.72 GiB | [Language model](v1.3.1-8k/RK3576/gemma-4-E2B-it_RK3576_w4a16_g128.rkllm) |
55
+ | RK3576 | `w8a8` | 8.43 GiB | [Language model](v1.3.1-8k/RK3576/gemma-4-E2B-it_RK3576_w8a8.rkllm) |
56
+
57
+ Both RK3576 variants use the matching [vision encoder](v1.3.1-8k/RK3576/gemma-4-E2B-it_vision_RK3576.rknn) and [audio encoder](v1.3.1-8k/RK3576/gemma-4-E2B-it_audio_RK3576.rknn). Vision uses 480 × 480 images and 100 image tokens. Audio uses one NPU core. Use `--embed_flash 1`.
58
+
59
+ **8K validation, 2026-11-29:** RKLLM runtime 1.3.1 and RKNN runtime 2.5.0 on RK3576. The columns below report strict smoke checks at the stated runtime context. They include output-content checks alongside HTTP status checks.
60
+
61
+ | Variant | Runtime 4096 | Runtime 8192 | Observed limits |
62
+ | --- | --- | --- | --- |
63
+ | RK3576 `w4a16_g128` | 9/14 | 9/14 | Greeting speech omitted ‘world’; space-scene descriptions missed the check’s ‘astronaut’ keyword. |
64
+ | RK3576 `w8a8` | 13/14 | 13/14 | Exact recall returned ORCHI D instead of ORCHID. |
65
+
66
+ RK3576 `w4a16_g128` processed 8,033 native prefill tokens and returned `PINEAPPLE` for the recall target `PINEAPPLE`; this single recall check passed.
67
+
68
+ RK3576 `w8a8` processed 8,033 native prefill tokens and returned `PINEPAPLE` for the recall target `PINEAPPLE`; this exact-recall check failed.
69
+
70
+ Long-context token counts come from native runtime logs. HTTP API usage counts are estimates. The long-context check uses one synthetic recall prompt. The shared RK3576 vision encoder retains the earlier cosine result **0.97914620**, below the 0.99 target. The audio encoder's earlier result is **0.99222647**. Those measurements were obtained for the identical encoder files in the October release.
71
+
72
+ The following accepted benchmarks use runtime context **2048**, `embed_flash=1`, and both encoders loaded. Generation speed is the median of three native decode measurements after warm-up. RAM is additional board use above the idle baseline, in decimal GB. Attempts with swap growth above 10 MB were excluded. All four W4 benchmark attempts were swap-affected, so no W4 speed or RAM result is accepted.
73
+
74
+ | Variant | Generation tok/s | Startup RAM GB | Stable RAM GB |
75
+ | --- | --- | --- | --- |
76
+ | RK3576 `w4a16_g128` | No accepted measurement | — | — |
77
+ | RK3576 `w8a8` | 4.50 | 5.83 | 5.84 |
78
+
79
+ Source checkpoint acquisition used ModelScope `google/gemma-4-E2B-it`, revision `8d46078a6a7635da2771a051ca04d8df6d390454`. W4A16-g128 calibration used 20 SDK image-and-text examples. W8A8 calibration added the SDK's 21 text-only prompts. Acceptance questions and audio clips were excluded from calibration. W8A8 requested hybrid rate 0.50. The toolkit reports that hybrid quantization is unsupported for this model. The retained encoders were built with RKNN Toolkit2 2.3.2.
80
+
81
+ 8K deployable-file checksums are in [SHA256SUMS](v1.3.1-8k/SHA256SUMS).
82
+
83
+ ### 4096-token multimodal release
84
+
85
+ The 4096-token multimodal set is under **`v1.3.1/`**. Use the exact SoC for your board. Each variant needs its language file and vision encoder; add the audio encoder to enable speech input. The two RK3576 variants share the same encoders.
86
 
87
  | Board | Quantization | Language size | Language model |
88
  | --- | --- | --- | --- |
 
109
 
110
  ## Run on your board
111
 
112
+ This RK3576 W4A16 example uses the ARM64 `env-latest` image and the 8K release. Serving checks used RKLLM 1.3.1 and RKNN 2.5.0. Download the three files first:
113
 
114
  ```bash
115
  hf download HanzoHuang/gemma-4-E2B-it-RKLLM \
116
+ v1.3.1-8k/RK3576/gemma-4-E2B-it_RK3576_w4a16_g128.rkllm \
117
+ v1.3.1-8k/RK3576/gemma-4-E2B-it_vision_RK3576.rknn \
118
+ v1.3.1-8k/RK3576/gemma-4-E2B-it_audio_RK3576.rknn \
119
  --local-dir ./models
120
 
121
  sudo docker run --pull=always --rm --name gemma4 --privileged -p 8001:8001 \
122
+ -v "$PWD/models/v1.3.1-8k/RK3576:/app/models:ro" \
123
  -e MODEL_KIND=vlm -e TARGET_PLATFORM=rk3576 -e VLM_MODEL_FAMILY=gemma4 \
124
  -e MODEL_FILE=gemma-4-E2B-it_RK3576_w4a16_g128.rkllm \
125
  -e VISION_MODEL_FILE=gemma-4-E2B-it_vision_RK3576.rknn \
 
128
  serve --embed_flash 1 --max_context_len 4096 --timeout 600
129
  ```
130
 
131
+ RK3588 currently uses its earlier `v1.3.1/` files with `TARGET_PLATFORM=rk3588`. The API is OpenAI compatible at `/v1/chat/completions`; use `image_url` for an image or `input_audio` with base64 `data` and `format: "wav"` for speech. Supported audio is PCM16 WAV, mono/stereo, 8–48 kHz, longer than 10 ms and no more than 7.56 seconds. Split longer recordings before sending them. The audio encoder runs on one NPU core.
132
 
133
  Runtime integration: [rkllm-docker Gemma support and model definitions](https://github.com/Hanzo-Huang/rkllm-docker/pull/13).
134
 
135
  ## Release notes
136
 
137
+ ### October 4096-token release
138
+
139
  Measured on the matching RK3576 and RK3588 devkits with RKLLM runtime 1.3.1 and RKNN runtime 2.3.2:
140
 
141
  | Variant | Functional checks | Encoder accuracy against original float32 PyTorch |
 
148
 
149
  The source weights were downloaded through ModelScope. Language calibration combines SDK image examples and general text prompts; it does not include the acceptance questions. The shared converter applies FP16-safe normalization and clipping and an RK3576 audio attention-layout correction through its existing single command. Rejected compiler/calibration experiments are excluded from this release.
150
 
151
+ 4096-token deployable-file hashes: [SHA256SUMS](v1.3.1/SHA256SUMS), with paths relative to `v1.3.1/`.
152
 
153
  <details>
154
  <summary>Previous text-only file checksums</summary>
README_zh-CN.md CHANGED
@@ -32,20 +32,57 @@ tags:
32
 
33
  # Gemma-4-E2B-it · RKLLM
34
 
35
- * 最大上下文长度: 4096
36
 
37
  在 Rockchip RK3576 和 RK3588 上进行文本生成、图像问答和短音频转写,转换自 [google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it)。
38
 
39
- **RK3576 预览版:** 图像和音频请求通过了功能测试,但视觉编码器未达到数值精度目标。RK3576 W8A8 还未通过一项精确记忆检查。选择此版本前,请查看下方实测结果。RK3588 W8A8 通过了此次执行的功能及编码器检查。
40
 
41
  - **转换工具:** RKLLM Toolkit 1.3.1;视觉和音频编码器使用 RKNN Toolkit2 2.3.2 构建。
42
  - **输入 / 输出:** 文本、单张图像或短 PCM16 WAV 音频 → 文本。此服务版本未实现音频生成和视频输入。
43
- - **上下文:** 导出长度为 4,096 个 token;开发板检查使用 2,048,包含媒体嵌入及生成文本。
44
  - **许可证:** Apache 2.0;条款及预期用途请参阅[原始模型](https://huggingface.co/google/gemma-4-E2B-it)。
45
 
46
  ## 选择模型文件
47
 
48
- 新的配套多模态文件位于 **`v1.3.1/`** 目录。请选择与开发板 SoC 完全匹配的文件。每个版本都需要语言模型和视觉编码器;如需语音输入,还需添加音频编码器。两个 RK3576 版本共用相同的编码器。
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  | 开发板 | 量化方式 | 语言模型大小 | 语言模型 |
51
  | --- | --- | --- | --- |
@@ -72,17 +109,17 @@ tags:
72
 
73
  ## 在开发板上运行
74
 
75
- 此 RK3576 W4A16 示例使用滚动更新的 ARM64 `env-latest` 镜像。Gemma 视觉和音频功能需要先合并 [PR #13](https://github.com/Hanzo-Huang/rkllm-docker/pull/13),并成功完成主分支的运行环境镜像构建。请先下载以下三个文件:
76
 
77
  ```bash
78
  hf download HanzoHuang/gemma-4-E2B-it-RKLLM \
79
- v1.3.1/RK3576/gemma-4-E2B-it_RK3576_w4a16_g128.rkllm \
80
- v1.3.1/RK3576/gemma-4-E2B-it_vision_RK3576.rknn \
81
- v1.3.1/RK3576/gemma-4-E2B-it_audio_RK3576.rknn \
82
  --local-dir ./models
83
 
84
  sudo docker run --pull=always --rm --name gemma4 --privileged -p 8001:8001 \
85
- -v "$PWD/models/v1.3.1/RK3576:/app/models:ro" \
86
  -e MODEL_KIND=vlm -e TARGET_PLATFORM=rk3576 -e VLM_MODEL_FAMILY=gemma4 \
87
  -e MODEL_FILE=gemma-4-E2B-it_RK3576_w4a16_g128.rkllm \
88
  -e VISION_MODEL_FILE=gemma-4-E2B-it_vision_RK3576.rknn \
@@ -91,12 +128,14 @@ sudo docker run --pull=always --rm --name gemma4 --privileged -p 8001:8001 \
91
  serve --embed_flash 1 --max_context_len 4096 --timeout 600
92
  ```
93
 
94
- 对于 RK3588,请选择其对应的三个文件并设置 `TARGET_PLATFORM=rk3588`。API 在 `/v1/chat/completions` 提供兼容 OpenAI 的接口;图像使用 `image_url`,语音使用 `input_audio`,并提供 base64 编码的 `data` 和 `format: "wav"`。支持的音频为 PCM16 WAV、单声道或立体声、8–48 kHz,时长须大于 10 ms 且不超过 7.56 秒。较长录音请分段发送。音频编码器在单个 NPU 核心上运行。
95
 
96
  运行时集成:[rkllm-docker Gemma 支持与模型定义](https://github.com/Hanzo-Huang/rkllm-docker/pull/13)。
97
 
98
  ## 发布说明
99
 
 
 
100
  以下结果在匹配的 RK3576 和 RK3588 开发板上测得,使用 RKLLM Runtime 1.3.1 及 RKNN Runtime 2.3.2:
101
 
102
  | 版本 | 功能检查 | 相对原始 float32 PyTorch 的编码器精度 |
 
32
 
33
  # Gemma-4-E2B-it · RKLLM
34
 
35
+ * 最大上下文长度:8192(`v1.3.1-8k/`);4096(`v1.3.1/` 和 `v1.3.0/`)。
36
 
37
  在 Rockchip RK3576 和 RK3588 上进行文本生成、图像问答和短音频转写,转换自 [google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it)。
38
 
39
+ **RK3576 预览版:** 8K W4 通过 9/14 项严格 API 检查,W8 通过 13/14 项。限制包括语音转录漏词、图像描述未包含预期关键词,以及 W8 精确记忆错误。共用视觉编码器也未达到数值精度目标。下方 RK3588 结果对应较早的 4096-token 版本。
40
 
41
  - **转换工具:** RKLLM Toolkit 1.3.1;视觉和音频编码器使用 RKNN Toolkit2 2.3.2 构建。
42
  - **输入 / 输出:** 文本、单张图像或短 PCM16 WAV 音频 → 文本。此服务版本未实现音频生成和视频输入。
43
+ - **上下文:** 8K 版本导出长度为 8192,API 检查使用运行时上限 4096 和 8192,基准使用 2048。旧 4K 版本导出长度为 4096,历史开发板检查使用 2048。
44
  - **许可证:** Apache 2.0;条款及预期用途请参阅[原始模型](https://huggingface.co/google/gemma-4-E2B-it)。
45
 
46
  ## 选择模型文件
47
 
48
+ ### 8192-token 版本
49
+
50
+ 8K 语言模型位于 **`v1.3.1-8k/`**,使用 RKLLM Toolkit 1.3.1 导出。RK3576 视觉和音频编码器与此前 `v1.3.1/` 的文件逐字节相同,保留原有的数值精度限制。
51
+
52
+ | 开发板 | 量化方式 | 语言模型大小 | 语言模型 |
53
+ | --- | --- | --- | --- |
54
+ | RK3576 | `w4a16_g128` | 7.72 GiB | [语言模型](v1.3.1-8k/RK3576/gemma-4-E2B-it_RK3576_w4a16_g128.rkllm) |
55
+ | RK3576 | `w8a8` | 8.43 GiB | [语言模型](v1.3.1-8k/RK3576/gemma-4-E2B-it_RK3576_w8a8.rkllm) |
56
+
57
+ 两个 RK3576 版本使用配套的[视觉编码器](v1.3.1-8k/RK3576/gemma-4-E2B-it_vision_RK3576.rknn)和[音频编码器](v1.3.1-8k/RK3576/gemma-4-E2B-it_audio_RK3576.rknn)。视觉输入为 480 × 480、100 个图像 token。音频使用单个 NPU 核心。请设置 `--embed_flash 1`。
58
+
59
+ **8K 验证,2026-11-29:** RK3576 使用 RKLLM Runtime 1.3.1 和 RKNN Runtime 2.5.0。下表列出对应运行时上下文下的严格冒烟检查,包含输出内容检查和 HTTP 状态检查。
60
+
61
+ | 版本 | 运行时 4096 | 运行时 8192 | 实际限制 |
62
+ | --- | --- | --- | --- |
63
+ | RK3576 `w4a16_g128` | 9/14 | 9/14 | 问候语转录漏掉 world;太空场景描述未包含检查要求的 astronaut。 |
64
+ | RK3576 `w8a8` | 13/14 | 13/14 | 精确记忆返回 ORCHI D,而不是 ORCHID。 |
65
+
66
+ RK3576 `w4a16_g128` 在原生运行时处理了 8,033 个预填充 token,记忆提示返回 `PINEAPPLE`,目标为 `PINEAPPLE`;此单条记忆检查通过。
67
+
68
+ RK3576 `w8a8` 在原生运行时处理了 8,033 个预填充 token,记忆提示返回 `PINEPAPLE`,目标为 `PINEAPPLE`;此精确记忆检查未通过。
69
+
70
+ 长上下文 token 数取自原生运行时日志。HTTP API 的 usage 字段使用估算值。长上下文检查使用一条合成记忆提示。共用的 RK3576 视觉编码器保留此前 **0.97914620** 的余弦相似度结果,低于 0.99 目标;音频编码器此前为 **0.99222647**。这些测量来自 10 月版本中完全相同的编码器文件。
71
+
72
+ 以下有效基准使用运行时上下文 **2048**、`embed_flash=1`,并加载视觉和音频编码器。生成速度为预热后三次原生解码测量的中位数。内存是相对空闲基线增加的开发板内存,以十进制 GB 计。swap 增长超过 10 MB 的测量已排除。W4 的四次基准均受 swap 影响,因此没有采纳 W4 的速度或内存数据。
73
+
74
+ | 版本 | 生成速度 tok/s | 启动内存 GB | 稳态内存 GB |
75
+ | --- | --- | --- | --- |
76
+ | RK3576 `w4a16_g128` | 未取得有效测量 | — | — |
77
+ | RK3576 `w8a8` | 4.50 | 5.83 | 5.84 |
78
+
79
+ 源检查点通过 ModelScope `google/gemma-4-E2B-it` 获取,固定 revision 为 `8d46078a6a7635da2771a051ca04d8df6d390454`。W4A16-g128 使用 20 个 SDK 图文示例进行校准;W8A8 额外使用 SDK 的 21 条纯文本提示。验收问题和音频片段未用于校准。W8A8 请求的 hybrid rate 为 0.50,工具报告此模型不支持混合量化。复用的编码器由 RKNN Toolkit2 2.3.2 构建。
80
+
81
+ 8K 可部署文件校验和位于 [SHA256SUMS](v1.3.1-8k/SHA256SUMS)。
82
+
83
+ ### 4096-token 多模态版本
84
+
85
+ 4096-token 配套多模态文件位于 **`v1.3.1/`** 目录。请选���与开发板 SoC 完全匹配的文件。每个版本都需要语言模型和视觉编码器;如需语音输入,还需添加音频编码器。两个 RK3576 版本共用相同的编码器。
86
 
87
  | 开发板 | 量化方式 | 语言模型大小 | 语言模型 |
88
  | --- | --- | --- | --- |
 
109
 
110
  ## 在开发板上运行
111
 
112
+ 此 RK3576 W4A16 示例使用 ARM64 `env-latest` 镜像和 8K 文件。服务检查使用 RKLLM 1.3.1 与 RKNN 2.5.0。请先下载以下三个文件:
113
 
114
  ```bash
115
  hf download HanzoHuang/gemma-4-E2B-it-RKLLM \
116
+ v1.3.1-8k/RK3576/gemma-4-E2B-it_RK3576_w4a16_g128.rkllm \
117
+ v1.3.1-8k/RK3576/gemma-4-E2B-it_vision_RK3576.rknn \
118
+ v1.3.1-8k/RK3576/gemma-4-E2B-it_audio_RK3576.rknn \
119
  --local-dir ./models
120
 
121
  sudo docker run --pull=always --rm --name gemma4 --privileged -p 8001:8001 \
122
+ -v "$PWD/models/v1.3.1-8k/RK3576:/app/models:ro" \
123
  -e MODEL_KIND=vlm -e TARGET_PLATFORM=rk3576 -e VLM_MODEL_FAMILY=gemma4 \
124
  -e MODEL_FILE=gemma-4-E2B-it_RK3576_w4a16_g128.rkllm \
125
  -e VISION_MODEL_FILE=gemma-4-E2B-it_vision_RK3576.rknn \
 
128
  serve --embed_flash 1 --max_context_len 4096 --timeout 600
129
  ```
130
 
131
+ RK3588 当前使用较早的 `v1.3.1/` 文件,并设置 `TARGET_PLATFORM=rk3588`。API 在 `/v1/chat/completions` 提供兼容 OpenAI 的接口;图像使用 `image_url`,语音使用 `input_audio`,并提供 base64 编码的 `data` 和 `format: "wav"`。支持的音频为 PCM16 WAV、单声道或立体声、8–48 kHz,时长须大于 10 ms 且不超过 7.56 秒。较长录音请分段发送。音频编码器在单个 NPU 核心上运行。
132
 
133
  运行时集成:[rkllm-docker Gemma 支持与模型定义](https://github.com/Hanzo-Huang/rkllm-docker/pull/13)。
134
 
135
  ## 发布说明
136
 
137
+ ### 10 月 4096-token 版本
138
+
139
  以下结果在匹配的 RK3576 和 RK3588 开发板上测得,使用 RKLLM Runtime 1.3.1 及 RKNN Runtime 2.3.2:
140
 
141
  | 版本 | 功能检查 | 相对原始 float32 PyTorch 的编码器精度 |
v1.3.1-8k/RK3576/gemma-4-E2B-it_audio_RK3576.rknn ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6072391b5700423a7e6958b20895a86f1f9325c386cd1df680124856e02ef377
3
+ size 620825393
v1.3.1-8k/RK3576/gemma-4-E2B-it_vision_RK3576.rknn ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c7760b0e0e9f8188de5a9ab6b8ff4f99412e69fb014cbf66a43c3b646740f17
3
+ size 1170712958
v1.3.1-8k/SHA256SUMS ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ f812e3b06d1cbd1c3a4f5032bb278cbb5ee12b38ff66514b5a4f7e995fb27a28 RK3576/gemma-4-E2B-it_RK3576_w4a16_g128.rkllm
2
+ 48470ef3442fb76b11aa630b519b51e991182fc68afd0c512f0e4148f6375f4b RK3576/gemma-4-E2B-it_RK3576_w8a8.rkllm
3
+ 2c7760b0e0e9f8188de5a9ab6b8ff4f99412e69fb014cbf66a43c3b646740f17 RK3576/gemma-4-E2B-it_vision_RK3576.rknn
4
+ 6072391b5700423a7e6958b20895a86f1f9325c386cd1df680124856e02ef377 RK3576/gemma-4-E2B-it_audio_RK3576.rknn