liyh00 commited on
Commit
24284c8
·
verified ·
1 Parent(s): a5d0a36

Sync model (SHA: af340d0547381f9a366057bd467cd1ea313d889c)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
.gitattributes CHANGED
@@ -33,3 +33,10 @@ 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
+ special_tokens_map.json filter=lfs diff=lfs merge=lfs -text
37
+ *.cms filter=lfs diff=lfs merge=lfs -text
38
+ *.hwp7s filter=lfs diff=lfs merge=lfs -text
39
+ model.safetensors.index.json filter=lfs diff=lfs merge=lfs -text
40
+ *.tar.gz filter=lfs diff=lfs merge=lfs -text
41
+ *.modelenc filter=lfs diff=lfs merge=lfs -text
42
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ OpenPangu Model License Agreement Version 2.0
2
+
3
+ This OpenPangu Model License Agreement Version 2.0 (the "Agreement") is a legal agreement between You and Huawei Technologies Co., Ltd. ("Huawei", "We" or "Us"), and it governs Your reproducing, use, modification, and distribution of openPangu as made available by Huawei under this Agreement.
4
+
5
+ By using, reproducing, modifying, distributing, performing or displaying any portion or element of openPangu, or otherwise accepting the terms of this Agreement, You agree to be bound by this Agreement.
6
+
7
+ 1. Definitions.
8
+ 1.1. “openPangu” or “Model” means openPangu large language models and software, including trained model weights, parameters (including optimizer states), accompanying source code and scripts released under this Agreement.
9
+ 1.2. “Derivative Model” means all (1) modifications to the Model, (2) works based on the Model, and (3) any other derivative works of the Model. For clarity, information or content results from operating or otherwise using the Model is not a Derivative Model.
10
+ 1.3. “You” or “Your” means an individual or Legal Entity exercising permissions granted by this Agreement and/or using the Model for any purpose.
11
+ 1.4. “Third Party” or “Third Parties” means individuals or legal entities that are not under common control with Us or You.
12
+
13
+ 2. License Grant. Subject to Your full compliance with the terms and conditions of this Agreement, We hereby grant to You a perpetual, worldwide, non-exclusive, non-transferable, no-charge, royalty-free license (except as stated in Section 3) to use, reproduce, modify, and distribute the Model.
14
+
15
+ 3. Conditions for License Grant.
16
+ 3.1. You represent and warrant that You will not, access, download, install, run, deploy, integrate, modify, or otherwise use the Model, directly or indirectly, within the European Union.
17
+ 3.2. If You initiate any copyright or patent litigation against any entity (including filing a cross-claim or counterclaim in such litigation), alleging that this Model or Derivative Models constitute direct or indirect copyright or patent infringement, then any license granted to You under this Agreement for the Model or Derivative Models shall terminate as of the date the aforementioned litigation is filed.
18
+
19
+ 4. Redistribution.
20
+ 4.1. If You distribute the Model or Derivative Model, You shall retain in Your distribution (1) a copy of this agreement, and (2) all copyright notices and other notices of origin included in the Model that are applicable to Your distribution.
21
+ 4.2. Further, if You distribute or make available to Third Parties a product or service (including another AI model) based on the Model, You are required to (1) display the acknowledgement “Powered by openPangu” and (2) include a trademark notice “openPangu is a trademark of Huawei Technologies Co., Ltd.” on related webpages, user manuals, product documentations or other advertising materials mentioning features of the Model.
22
+ 4.3. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for Derivative Model made by You as a whole, provided Your use, reproduction, and distribution of the Model otherwise complies with the terms and conditions of this Agreement.
23
+
24
+ 5. Ownership. We do not claim ownership to any information or content generated using the Model or Derivative Model that are made by You. You are solely responsible for evaluating the accuracy and appropriateness of such information or content for Your use case.
25
+
26
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of Huawei, except as required for complying with Section 4.2.
27
+
28
+ 7. Indemnity. You will indemnify and hold harmless Huawei from and against any claim by any third party arising out of or related to Your use or distribution of the Model or Derivative Model made by You (e.g. a violation against Section 3). For avoidance of doubt, “third party” in this clause include supervisory authorities.
29
+
30
+ 8. THE MODEL IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, NONINFRINGEMENT, ACCURACY, OR THE ABSENCE OF LATENT OR OTHER DEFECTS OR ERRORS, WHETHER OR NOT DISCOVERABLE, ALL TO THE GREATEST EXTENT PERMISSIBLE UNDER APPLICABLE LAW.
31
+
32
+ 9. IN NO EVENT SHALL WE BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE MODEL, IN WHOLE OR IN PART, NO MATTER HOW IT’S CAUSED OR THE LEGAL THEORY IT IS BASED ON, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
33
+
34
+ 10. HUAWEI MAY UPDATE THIS AGREEMENT AT ANY TIME TO COMPLY WITH LEGAL AND REGULATORY REQUIREMENTS, AND YOU AGREE TO ABIDE BY ANY UPDATED LICENSE OR TO CEASE COPYING, USING, MODIFYING AND DISTRIBUTING THIS MODEL AND ANY DERIVATIVE MODELS.
35
+
36
+
37
+ END OF THE TERMS AND CONDITIONS
OPEN SOURCE SOFTWARE NOTICE ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ OPEN SOURCE SOFTWARE NOTICE
2
+
3
+ Please note we provide an open source software notice along with this product and/or this product firmware (in the following just “this product”). The open source software licenses are granted by the respective right holders. And the open source licenses prevail all other license information with regard to the respective open source software contained in the product, including but not limited to End User Software Licensing Agreement. This notice is provided on behalf of Huawei Technologies Co. Ltd. and any of its local subsidiaries which may have provided this product to you in your local country.
4
+
5
+ Warranty Disclaimer
6
+ THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
7
+
8
+ Copyright Notice and License Texts
9
+
10
+ Software: transformers 5.0.0
11
+ Copyright notice:
12
+ Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
13
+
14
+ License Text:
15
+ ----------------------------------------
16
+
17
+ Apache License
18
+ Version 2.0, January 2004
19
+ http://www.apache.org/licenses/
20
+
21
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
22
+
23
+ 1. Definitions.
24
+
25
+ "License" shall mean the terms and conditions for use, reproduction,
26
+ and distribution as defined by Sections 1 through 9 of this document.
27
+
28
+ "Licensor" shall mean the copyright owner or entity authorized by
29
+ the copyright owner that is granting the License.
30
+
31
+ "Legal Entity" shall mean the union of the acting entity and all
32
+ other entities that control, are controlled by, or are under common
33
+ control with that entity. For the purposes of this definition,
34
+ "control" means (i) the power, direct or indirect, to cause the
35
+ direction or management of such entity, whether by contract or
36
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
37
+ outstanding shares, or (iii) beneficial ownership of such entity.
38
+
39
+ "You" (or "Your") shall mean an individual or Legal Entity
40
+ exercising permissions granted by this License.
41
+
42
+ "Source" form shall mean the preferred form for making modifications,
43
+ including but not limited to software source code, documentation
44
+ source, and configuration files.
45
+
46
+ "Object" form shall mean any form resulting from mechanical
47
+ transformation or translation of a Source form, including but
48
+ not limited to compiled object code, generated documentation,
49
+ and conversions to other media types.
50
+
51
+ "Work" shall mean the work of authorship, whether in Source or
52
+ Object form, made available under the License, as indicated by a
53
+ copyright notice that is included in or attached to the work
54
+ (an example is provided in the Appendix below).
55
+
56
+ "Derivative Works" shall mean any work, whether in Source or Object
57
+ form, that is based on (or derived from) the Work and for which the
58
+ editorial revisions, annotations, elaborations, or other modifications
59
+ represent, as a whole, an original work of authorship. For the purposes
60
+ of this License, Derivative Works shall not include works that remain
61
+ separable from, or merely link (or bind by name) to the interfaces of,
62
+ the Work and Derivative Works thereof.
63
+
64
+ "Contribution" shall mean any work of authorship, including
65
+ the original version of the Work and any modifications or additions
66
+ to that Work or Derivative Works thereof, that is intentionally
67
+ submitted to Licensor for inclusion in the Work by the copyright owner
68
+ or by an individual or Legal Entity authorized to submit on behalf of
69
+ the copyright owner. For the purposes of this definition, "submitted"
70
+ means any form of electronic, verbal, or written communication sent
71
+ to the Licensor or its representatives, including but not limited to
72
+ communication on electronic mailing lists, source code control systems,
73
+ and issue tracking systems that are managed by, or on behalf of, the
74
+ Licensor for the purpose of discussing and improving the Work, but
75
+ excluding communication that is conspicuously marked or otherwise
76
+ designated in writing by the copyright owner as "Not a Contribution."
77
+
78
+ "Contributor" shall mean Licensor and any individual or Legal Entity
79
+ on behalf of whom a Contribution has been received by Licensor and
80
+ subsequently incorporated within the Work.
81
+
82
+ 2. Grant of Copyright License. Subject to the terms and conditions of
83
+ this License, each Contributor hereby grants to You a perpetual,
84
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
85
+ copyright license to reproduce, prepare Derivative Works of,
86
+ publicly display, publicly perform, sublicense, and distribute the
87
+ Work and such Derivative Works in Source or Object form.
88
+
89
+ 3. Grant of Patent License. Subject to the terms and conditions of
90
+ this License, each Contributor hereby grants to You a perpetual,
91
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
92
+ (except as stated in this section) patent license to make, have made,
93
+ use, offer to sell, sell, import, and otherwise transfer the Work,
94
+ where such license applies only to those patent claims licensable
95
+ by such Contributor that are necessarily infringed by their
96
+ Contribution(s) alone or by combination of their Contribution(s)
97
+ with the Work to which such Contribution(s) was submitted. If You
98
+ institute patent litigation against any entity (including a
99
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
100
+ or a Contribution incorporated within the Work constitutes direct
101
+ or contributory patent infringement, then any patent licenses
102
+ granted to You under this License for that Work shall terminate
103
+ as of the date such litigation is filed.
104
+
105
+ 4. Redistribution. You may reproduce and distribute copies of the
106
+ Work or Derivative Works thereof in any medium, with or without
107
+ modifications, and in Source or Object form, provided that You
108
+ meet the following conditions:
109
+
110
+ (a) You must give any other recipients of the Work or
111
+ Derivative Works a copy of this License; and
112
+
113
+ (b) You must cause any modified files to carry prominent notices
114
+ stating that You changed the files; and
115
+
116
+ (c) You must retain, in the Source form of any Derivative Works
117
+ that You distribute, all copyright, patent, trademark, and
118
+ attribution notices from the Source form of the Work,
119
+ excluding those notices that do not pertain to any part of
120
+ the Derivative Works; and
121
+
122
+ (d) If the Work includes a "NOTICE" text file as part of its
123
+ distribution, then any Derivative Works that You distribute must
124
+ include a readable copy of the attribution notices contained
125
+ within such NOTICE file, excluding those notices that do not
126
+ pertain to any part of the Derivative Works, in at least one
127
+ of the following places: within a NOTICE text file distributed
128
+ as part of the Derivative Works; within the Source form or
129
+ documentation, if provided along with the Derivative Works; or,
130
+ within a display generated by the Derivative Works, if and
131
+ wherever such third-party notices normally appear. The contents
132
+ of the NOTICE file are for informational purposes only and
133
+ do not modify the License. You may add Your own attribution
134
+ notices within Derivative Works that You distribute, alongside
135
+ or as an addendum to the NOTICE text from the Work, provided
136
+ that such additional attribution notices cannot be construed
137
+ as modifying the License.
138
+
139
+ You may add Your own copyright statement to Your modifications and
140
+ may provide additional or different license terms and conditions
141
+ for use, reproduction, or distribution of Your modifications, or
142
+ for any such Derivative Works as a whole, provided Your use,
143
+ reproduction, and distribution of the Work otherwise complies with
144
+ the conditions stated in this License.
145
+
146
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
147
+ any Contribution intentionally submitted for inclusion in the Work
148
+ by You to the Licensor shall be under the terms and conditions of
149
+ this License, without any additional terms or conditions.
150
+ Notwithstanding the above, nothing herein shall supersede or modify
151
+ the terms of any separate license agreement you may have executed
152
+ with Licensor regarding such Contributions.
153
+
154
+ 6. Trademarks. This License does not grant permission to use the trade
155
+ names, trademarks, service marks, or product names of the Licensor,
156
+ except as required for reasonable and customary use in describing the
157
+ origin of the Work and reproducing the content of the NOTICE file.
158
+
159
+ 7. Disclaimer of Warranty. Unless required by applicable law or
160
+ agreed to in writing, Licensor provides the Work (and each
161
+ Contributor provides its Contributions) on an "AS IS" BASIS,
162
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
163
+ implied, including, without limitation, any warranties or conditions
164
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
165
+ PARTICULAR PURPOSE. You are solely responsible for determining the
166
+ appropriateness of using or redistributing the Work and assume any
167
+ risks associated with Your exercise of permissions under this License.
168
+
169
+ 8. Limitation of Liability. In no event and under no legal theory,
170
+ whether in tort (including negligence), contract, or otherwise,
171
+ unless required by applicable law (such as deliberate and grossly
172
+ negligent acts) or agreed to in writing, shall any Contributor be
173
+ liable to You for damages, including any direct, indirect, special,
174
+ incidental, or consequential damages of any character arising as a
175
+ result of this License or out of the use or inability to use the
176
+ Work (including but not limited to damages for loss of goodwill,
177
+ work stoppage, computer failure or malfunction, or any and all
178
+ other commercial damages or losses), even if such Contributor
179
+ has been advised of the possibility of such damages.
180
+
181
+ 9. Accepting Warranty or Additional Liability. While redistributing
182
+ the Work or Derivative Works thereof, You may choose to offer,
183
+ and charge a fee for, acceptance of support, warranty, indemnity,
184
+ or other liability obligations and/or rights consistent with this
185
+ License. However, in accepting such obligations, You may act only
186
+ on Your own behalf and on Your sole responsibility, not on behalf
187
+ of any other Contributor, and only if You agree to indemnify,
188
+ defend, and hold each Contributor harmless for any liability
189
+ incurred by, or claims asserted against, such Contributor by reason
190
+ of your accepting any such warranty or additional liability.
191
+
192
+ END OF TERMS AND CONDITIONS
193
+
194
+ APPENDIX: How to apply the Apache License to your work.
195
+
196
+ To apply the Apache License to your work, attach the following
197
+ boilerplate notice, with the fields enclosed by brackets "[]"
198
+ replaced with your own identifying information. (Don't include
199
+ the brackets!) The text should be enclosed in the appropriate
200
+ comment syntax for the file format. We also recommend that a
201
+ file or class name and description of purpose be included on the
202
+ same "printed page" as the copyright notice for easier
203
+ identification within third-party archives.
204
+
205
+ Copyright [yyyy] [name of copyright owner]
206
+
207
+ Licensed under the Apache License, Version 2.0 (the "License");
208
+ you may not use this file except in compliance with the License.
209
+ You may obtain a copy of the License at
210
+
211
+ http://www.apache.org/licenses/LICENSE-2.0
212
+
213
+ Unless required by applicable law or agreed to in writing, software
214
+ distributed under the License is distributed on an "AS IS" BASIS,
215
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
216
+ See the License for the specific language governing permissions and
217
+ limitations under the License.
218
+
README.md CHANGED
@@ -1,3 +1,30 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # openPangu-2.0-Pro-Int8
2
+ 中文 | [English](README_EN.md)
3
+
4
+ ## 1. 简介
5
+ openPangu-2.0-Pro 是基于昇腾 NPU 训练的大规模混合专家(MoE)语言模型,参数规模约 505B,每 token 激活参数规模约 18B,模型支持 512k 上下文长度,训练数据总量约34T tokens。后训练阶段完成快慢合一微调(SFT)、多专项强化学习(RL),并通过在线蒸馏(OPD)完成能力合一。
6
+ openPangu-2.0-Pro-Int8 是 openPangu-2.0-Pro 的量化版本。
7
+
8
+ ## 2. 模型架构
9
+ openPangu-2.0-Pro-Int8 在模型架构上实现了全面的升级:
10
+
11
+ - Attention架构:沿用高效 MLA,并采用 DSA+SWA 独立分层混合架构,层配比为 1:2;SWA 层负责局部窗口建模,DSA 层负责稀疏全局聚合,在保持精度的同时显著降低长序列推理的计算、显存与访存开销。
12
+ - 拓扑架构:将传统残差连接升级为 4 支流 mHC 架构,提升表征多样性与泛化能力。
13
+ - 自投机模块:采用 3 头 MTP 架构,一次额外预测 3 个 token,显著提升模型的推理速度。
14
+ - Muon优化器:训练中采用Muon优化器,获得更快的收敛速度。
15
+
16
+ ## 3. 部署和使用
17
+ - 使用omni-infer推理框架,部署方式参考[[openPangu-2.0-Pro部署说明](https://gitcode.com/ascend-tribe/openPangu-2.0-Infer/blob/main/README.md)]
18
+ - 源码仓:[[openPangu-2.0-Infer]](https://gitcode.com/ascend-tribe/openPangu-2.0-Infer)
19
+
20
+ ## 4. 模型许可证
21
+ 除文件中对开源许可证另有约定外,openPangu-2.0-Pro-Int8 模型根据 OPENPANGU MODEL LICENSE AGREEMENT VERSION 2.0 授权,旨在允许使用并促进人工智能技术的进一步发展。有关详细信息,请参阅模型存储库根目录中的 [LICENSE](LICENSE) 文件。
22
+
23
+ ## 5. 免责声明
24
+ 由于 openPangu-2.0-Pro-Int8 (“模型”)所依赖的技术固有的限制,以及人工智能生成的内容是由模型自动生成的,华为无法对以下事项做出任何保证:
25
+ - 该模型的输出通过AI算法自动生成,不能排除某些信息可能存在缺陷、不合理或引起不适的可能性,生成的内容不代表华为的态度或立场;
26
+ - 无法保证该模型100%准确、可靠、功能齐全、及时、安全、无错误、不间断、持续稳定或无任何故障;
27
+ - 该模型的输出内容不构成任何建议或决策,也不保证生成的内容的真实性、完整性、准确性、及时性、合法性、功能性或实用性。生成的内容不能替代医疗、法律等领域的专业人士回答您的问题。生成的内容仅供参考,不代表华为的任何态度、立场或观点。您需要根据实际情况做出独立判断,华为不承担任何责任。
28
+
29
+ ## 6. 反馈
30
+ 如果有任何意见和建议,请提交issue或联系[openPangu@huawei.com](url)。
README_EN.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # openPangu-2.0-Pro-Int8
2
+ [中文](README.md) | English
3
+
4
+ ## 1. Introduction
5
+ openPangu-2.0-Pro is an MoE model trained on Ascend. The model has 505B total parameters and 18B activated parameters. Its context length is 512k. The total pretraining data contains 34T tokens. During Post-training, openPangu-2.0-Pro is trained through unified SFT with slow and fast thinking capability, multiple specialist RL traning, on-policy distillation combining multiple RL specialists.
6
+ openPangu-2.0-Pro-Int8 is a quantized version of openPangu-2.0-Pro.
7
+
8
+ ## 2. Architecture
9
+ openPangu-2.0-Pro-Int8 brings several major architectural improvements:
10
+
11
+ - Efficient attention: The model retains MLA for efficient inference and combines DSA and SWA in a 1:2 layer ratio. SWA layers handle local-window modeling, while DSA layers capture sparse global context. This design lowers compute, memory footprint, and memory access costs for long-context inference while preserving accuracy.
12
+ - Residual topology: The conventional residual path is replaced with a 4-stream mHC design, improving representation diversity and generalization.
13
+ - Multi-token prediction (MTP): The model uses three MTP heads to draft 3 additional tokens per step, enabling faster inference through self-speculative decoding.
14
+ - Optimizer: Training uses the Muon optimizer for faster convergence.
15
+
16
+ ## 3. Deployment
17
+ - omni-infer:Please refer to [[openPangu-2.0-Pro deploy guide](https://gitcode.com/ascend-tribe/openPangu-2.0-Infer/blob/main/README_EN.md)]
18
+ - source code repo:[[openPangu-2.0-Infer]](https://gitcode.com/ascend-tribe/openPangu-2.0-Infer)
19
+
20
+ ## 4. Model License
21
+ Unless otherwise noted, the openPangu-2.0-Pro-Int8 model is licensed under the terms and conditions of OPENPANGU MODEL LICENSE AGREEMENT VERSION 2.0, which is intended to be used permissively and enable the further development of artificial intelligence technologies. Please refer to the [LICENSE](LICENSE) file located in the root directory of the model repository for details.
22
+
23
+ ## 5. Disclaimer
24
+ Due to the technical limitations inherent in the technology on which the openPangu-2.0-Pro-Int8 model (“Model”) relies and the fact that the artificial intelligence generated content is automatically produced by Model, Huawei cannot make any guarantees regarding the following matters:
25
+
26
+ - The output of this Model is automatically generated via AI algorithms, it does not rule out the possibility that some of the information may be flawed, unreasonable, or cause discomfort, and the generated content does not represent Huawei's attitude or standpoint;
27
+ - There is no guarantee that this Model is 100% accurate, reliable, functional, timely, secure and safety, error-free, uninterrupted, continuously stable, or free of any faults;
28
+ - The output of this Model does not constitute any advices or decisions for you, and it does not guarantee the authenticity, completeness, accuracy, timeliness, legality, functionality, or practicality of the generated content. The generated content cannot replace professionals in medical, legal, and other fields in answering your questions. The generated content is for your reference only and does not represent any attitude, standpoint, or position of Huawei. You need to make independent judgments based on your actual situation, and Huawei does not assume any responsibilities.
29
+
30
+ ## 6. Contact
31
+ If you have any question, please raise an issue or contact us at [openPangu@huawei.com](url).
32
+
33
+
34
+
config.json ADDED
@@ -0,0 +1,623 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": ["OpenPanguV2ForCausalLM"],
3
+ "attention_dropout": 0.0,
4
+ "auto_map": {
5
+ "AutoConfig": "configuration_openpangu_v2.OpenPanguV2Config"
6
+ },
7
+ "_attn_implementation":"eager",
8
+ "block_post_layernorm_idx": [0, 4, 9, 14, 19, 24, 29, 34, 39, 44],
9
+ "bos_token_id": 148899,
10
+ "dsa_layers": [0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 49],
11
+ "dtype": "bfloat16",
12
+ "eos_token_id": 148902,
13
+ "first_k_dense_replace": 3,
14
+ "hidden_act": "silu",
15
+ "hidden_size": 5120,
16
+ "index_head_dim": 128,
17
+ "index_n_heads": 32,
18
+ "index_topk": 2048,
19
+ "intermediate_size": 16128,
20
+ "kv_lora_rank": 512,
21
+ "max_position_embeddings": 524288,
22
+ "mhc_num_stream": 4,
23
+ "mhc_recur_norm": 20,
24
+ "mhc_use_gamma": true,
25
+ "model_type": "openpangu_v2",
26
+ "moe_intermediate_size": 1792,
27
+ "n_routed_experts": 384,
28
+ "n_shared_experts": 1,
29
+ "norm_topk_prob": true,
30
+ "num_attention_heads": 64,
31
+ "num_experts_per_tok": 8,
32
+ "num_hidden_layers": 50,
33
+ "num_nextn_predict_layers": 3,
34
+ "pad_token_id": 148902,
35
+ "param_sink_number": 128,
36
+ "q_lora_rank": 1536,
37
+ "qk_nope_head_dim": 128,
38
+ "qk_rope_head_dim": 64,
39
+ "rms_norm_eps": 1e-05,
40
+ "rope_theta": 6400000,
41
+ "rope_interleave": false,
42
+ "router_enable_expert_bias": true,
43
+ "routed_scaling_factor": 2.5,
44
+ "router_sliding_window": 3,
45
+ "sandwich_norm": true,
46
+ "sliding_window": 512,
47
+ "sliding_window_list": [512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 2048, 2048, 2048],
48
+ "swa_layers": [1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22, 23, 25, 26, 28, 29, 31, 32, 34, 35, 37, 38, 40, 41, 43, 44, 46, 47, 50, 51, 52],
49
+ "tie_word_embeddings": false,
50
+ "transformers_version": "5.0.0",
51
+ "use_cache": true,
52
+ "use_mhc": true,
53
+ "use_mome": true,
54
+ "v_head_dim": 128,
55
+ "vocab_size": 151552,
56
+ "quantization_config": {
57
+ "quant_method": "compressed-tensors",
58
+ "quantize": "w8a8_dynamic",
59
+ "format": "int-quantized",
60
+ "quantization_status": "compressed",
61
+ "config_groups": {
62
+ "group_0": {
63
+ "format": "int-quantized",
64
+ "targets": [
65
+ "Linear"
66
+ ],
67
+ "weights": {
68
+ "type": "int",
69
+ "num_bits": 8,
70
+ "symmetric": true,
71
+ "strategy": "channel",
72
+ "dynamic": false,
73
+ "observer": "minmax",
74
+ "actorder": null,
75
+ "group_size": null,
76
+ "block_structure": null,
77
+ "observer_kwargs": {}
78
+ },
79
+ "input_activations": {
80
+ "type": "int",
81
+ "num_bits": 8,
82
+ "symmetric": true,
83
+ "strategy": "token",
84
+ "dynamic": true,
85
+ "actorder": null,
86
+ "group_size": null,
87
+ "block_structure": null,
88
+ "observer": null,
89
+ "observer_kwargs": {}
90
+ },
91
+ "output_activations": null
92
+ }
93
+ },
94
+ "ignore": [
95
+ "lm_head",
96
+ "model.embed_tokens",
97
+ "model.layers.0.attn_mhc_module.phi",
98
+ "model.layers.0.mlp_mhc_module.phi",
99
+ "model.layers.0.self_attn.indexer.weights_proj",
100
+ "model.layers.0.self_attn.indexer.wk",
101
+ "model.layers.0.self_attn.indexer.wq_b",
102
+ "model.layers.0.self_attn.kv_a_proj_with_mqa",
103
+ "model.layers.0.self_attn.kv_b_proj",
104
+ "model.layers.0.self_attn.q_a_proj",
105
+ "model.layers.1.attn_mhc_module.phi",
106
+ "model.layers.1.mlp_mhc_module.phi",
107
+ "model.layers.1.self_attn.kv_a_proj_with_mqa",
108
+ "model.layers.1.self_attn.kv_b_proj",
109
+ "model.layers.1.self_attn.q_a_proj",
110
+ "model.layers.10.attn_mhc_module.phi",
111
+ "model.layers.10.mlp.gate",
112
+ "model.layers.10.mlp.shared_experts.down_proj",
113
+ "model.layers.10.mlp.shared_experts.gate_proj",
114
+ "model.layers.10.mlp.shared_experts.up_proj",
115
+ "model.layers.10.mlp_mhc_module.phi",
116
+ "model.layers.10.self_attn.kv_a_proj_with_mqa",
117
+ "model.layers.10.self_attn.kv_b_proj",
118
+ "model.layers.10.self_attn.q_a_proj",
119
+ "model.layers.11.attn_mhc_module.phi",
120
+ "model.layers.11.mlp.gate",
121
+ "model.layers.11.mlp.shared_experts.down_proj",
122
+ "model.layers.11.mlp.shared_experts.gate_proj",
123
+ "model.layers.11.mlp.shared_experts.up_proj",
124
+ "model.layers.11.mlp_mhc_module.phi",
125
+ "model.layers.11.self_attn.kv_a_proj_with_mqa",
126
+ "model.layers.11.self_attn.kv_b_proj",
127
+ "model.layers.11.self_attn.q_a_proj",
128
+ "model.layers.12.attn_mhc_module.phi",
129
+ "model.layers.12.mlp.gate",
130
+ "model.layers.12.mlp.shared_experts.down_proj",
131
+ "model.layers.12.mlp.shared_experts.gate_proj",
132
+ "model.layers.12.mlp.shared_experts.up_proj",
133
+ "model.layers.12.mlp_mhc_module.phi",
134
+ "model.layers.12.self_attn.indexer.weights_proj",
135
+ "model.layers.12.self_attn.indexer.wk",
136
+ "model.layers.12.self_attn.indexer.wq_b",
137
+ "model.layers.12.self_attn.kv_a_proj_with_mqa",
138
+ "model.layers.12.self_attn.kv_b_proj",
139
+ "model.layers.12.self_attn.q_a_proj",
140
+ "model.layers.13.attn_mhc_module.phi",
141
+ "model.layers.13.mlp.gate",
142
+ "model.layers.13.mlp.shared_experts.down_proj",
143
+ "model.layers.13.mlp.shared_experts.gate_proj",
144
+ "model.layers.13.mlp.shared_experts.up_proj",
145
+ "model.layers.13.mlp_mhc_module.phi",
146
+ "model.layers.13.self_attn.kv_a_proj_with_mqa",
147
+ "model.layers.13.self_attn.kv_b_proj",
148
+ "model.layers.13.self_attn.q_a_proj",
149
+ "model.layers.14.attn_mhc_module.phi",
150
+ "model.layers.14.mlp.gate",
151
+ "model.layers.14.mlp.shared_experts.down_proj",
152
+ "model.layers.14.mlp.shared_experts.gate_proj",
153
+ "model.layers.14.mlp.shared_experts.up_proj",
154
+ "model.layers.14.mlp_mhc_module.phi",
155
+ "model.layers.14.self_attn.kv_a_proj_with_mqa",
156
+ "model.layers.14.self_attn.kv_b_proj",
157
+ "model.layers.14.self_attn.q_a_proj",
158
+ "model.layers.15.attn_mhc_module.phi",
159
+ "model.layers.15.mlp.gate",
160
+ "model.layers.15.mlp.shared_experts.down_proj",
161
+ "model.layers.15.mlp.shared_experts.gate_proj",
162
+ "model.layers.15.mlp.shared_experts.up_proj",
163
+ "model.layers.15.mlp_mhc_module.phi",
164
+ "model.layers.15.self_attn.indexer.weights_proj",
165
+ "model.layers.15.self_attn.indexer.wk",
166
+ "model.layers.15.self_attn.indexer.wq_b",
167
+ "model.layers.15.self_attn.kv_a_proj_with_mqa",
168
+ "model.layers.15.self_attn.kv_b_proj",
169
+ "model.layers.15.self_attn.q_a_proj",
170
+ "model.layers.16.attn_mhc_module.phi",
171
+ "model.layers.16.mlp.gate",
172
+ "model.layers.16.mlp.shared_experts.down_proj",
173
+ "model.layers.16.mlp.shared_experts.gate_proj",
174
+ "model.layers.16.mlp.shared_experts.up_proj",
175
+ "model.layers.16.mlp_mhc_module.phi",
176
+ "model.layers.16.self_attn.kv_a_proj_with_mqa",
177
+ "model.layers.16.self_attn.kv_b_proj",
178
+ "model.layers.16.self_attn.q_a_proj",
179
+ "model.layers.17.attn_mhc_module.phi",
180
+ "model.layers.17.mlp.gate",
181
+ "model.layers.17.mlp.shared_experts.down_proj",
182
+ "model.layers.17.mlp.shared_experts.gate_proj",
183
+ "model.layers.17.mlp.shared_experts.up_proj",
184
+ "model.layers.17.mlp_mhc_module.phi",
185
+ "model.layers.17.self_attn.kv_a_proj_with_mqa",
186
+ "model.layers.17.self_attn.kv_b_proj",
187
+ "model.layers.17.self_attn.q_a_proj",
188
+ "model.layers.18.attn_mhc_module.phi",
189
+ "model.layers.18.mlp.gate",
190
+ "model.layers.18.mlp.shared_experts.down_proj",
191
+ "model.layers.18.mlp.shared_experts.gate_proj",
192
+ "model.layers.18.mlp.shared_experts.up_proj",
193
+ "model.layers.18.mlp_mhc_module.phi",
194
+ "model.layers.18.self_attn.indexer.weights_proj",
195
+ "model.layers.18.self_attn.indexer.wk",
196
+ "model.layers.18.self_attn.indexer.wq_b",
197
+ "model.layers.18.self_attn.kv_a_proj_with_mqa",
198
+ "model.layers.18.self_attn.kv_b_proj",
199
+ "model.layers.18.self_attn.q_a_proj",
200
+ "model.layers.19.attn_mhc_module.phi",
201
+ "model.layers.19.mlp.gate",
202
+ "model.layers.19.mlp.shared_experts.down_proj",
203
+ "model.layers.19.mlp.shared_experts.gate_proj",
204
+ "model.layers.19.mlp.shared_experts.up_proj",
205
+ "model.layers.19.mlp_mhc_module.phi",
206
+ "model.layers.19.self_attn.kv_a_proj_with_mqa",
207
+ "model.layers.19.self_attn.kv_b_proj",
208
+ "model.layers.19.self_attn.q_a_proj",
209
+ "model.layers.2.attn_mhc_module.phi",
210
+ "model.layers.2.mlp_mhc_module.phi",
211
+ "model.layers.2.self_attn.kv_a_proj_with_mqa",
212
+ "model.layers.2.self_attn.kv_b_proj",
213
+ "model.layers.2.self_attn.q_a_proj",
214
+ "model.layers.20.attn_mhc_module.phi",
215
+ "model.layers.20.mlp.gate",
216
+ "model.layers.20.mlp.shared_experts.down_proj",
217
+ "model.layers.20.mlp.shared_experts.gate_proj",
218
+ "model.layers.20.mlp.shared_experts.up_proj",
219
+ "model.layers.20.mlp_mhc_module.phi",
220
+ "model.layers.20.self_attn.kv_a_proj_with_mqa",
221
+ "model.layers.20.self_attn.kv_b_proj",
222
+ "model.layers.20.self_attn.q_a_proj",
223
+ "model.layers.21.attn_mhc_module.phi",
224
+ "model.layers.21.mlp.gate",
225
+ "model.layers.21.mlp.shared_experts.down_proj",
226
+ "model.layers.21.mlp.shared_experts.gate_proj",
227
+ "model.layers.21.mlp.shared_experts.up_proj",
228
+ "model.layers.21.mlp_mhc_module.phi",
229
+ "model.layers.21.self_attn.indexer.weights_proj",
230
+ "model.layers.21.self_attn.indexer.wk",
231
+ "model.layers.21.self_attn.indexer.wq_b",
232
+ "model.layers.21.self_attn.kv_a_proj_with_mqa",
233
+ "model.layers.21.self_attn.kv_b_proj",
234
+ "model.layers.21.self_attn.q_a_proj",
235
+ "model.layers.22.attn_mhc_module.phi",
236
+ "model.layers.22.mlp.gate",
237
+ "model.layers.22.mlp.shared_experts.down_proj",
238
+ "model.layers.22.mlp.shared_experts.gate_proj",
239
+ "model.layers.22.mlp.shared_experts.up_proj",
240
+ "model.layers.22.mlp_mhc_module.phi",
241
+ "model.layers.22.self_attn.kv_a_proj_with_mqa",
242
+ "model.layers.22.self_attn.kv_b_proj",
243
+ "model.layers.22.self_attn.q_a_proj",
244
+ "model.layers.23.attn_mhc_module.phi",
245
+ "model.layers.23.mlp.gate",
246
+ "model.layers.23.mlp.shared_experts.down_proj",
247
+ "model.layers.23.mlp.shared_experts.gate_proj",
248
+ "model.layers.23.mlp.shared_experts.up_proj",
249
+ "model.layers.23.mlp_mhc_module.phi",
250
+ "model.layers.23.self_attn.kv_a_proj_with_mqa",
251
+ "model.layers.23.self_attn.kv_b_proj",
252
+ "model.layers.23.self_attn.q_a_proj",
253
+ "model.layers.24.attn_mhc_module.phi",
254
+ "model.layers.24.mlp.gate",
255
+ "model.layers.24.mlp.shared_experts.down_proj",
256
+ "model.layers.24.mlp.shared_experts.gate_proj",
257
+ "model.layers.24.mlp.shared_experts.up_proj",
258
+ "model.layers.24.mlp_mhc_module.phi",
259
+ "model.layers.24.self_attn.indexer.weights_proj",
260
+ "model.layers.24.self_attn.indexer.wk",
261
+ "model.layers.24.self_attn.indexer.wq_b",
262
+ "model.layers.24.self_attn.kv_a_proj_with_mqa",
263
+ "model.layers.24.self_attn.kv_b_proj",
264
+ "model.layers.24.self_attn.q_a_proj",
265
+ "model.layers.25.attn_mhc_module.phi",
266
+ "model.layers.25.mlp.gate",
267
+ "model.layers.25.mlp.shared_experts.down_proj",
268
+ "model.layers.25.mlp.shared_experts.gate_proj",
269
+ "model.layers.25.mlp.shared_experts.up_proj",
270
+ "model.layers.25.mlp_mhc_module.phi",
271
+ "model.layers.25.self_attn.kv_a_proj_with_mqa",
272
+ "model.layers.25.self_attn.kv_b_proj",
273
+ "model.layers.25.self_attn.q_a_proj",
274
+ "model.layers.26.attn_mhc_module.phi",
275
+ "model.layers.26.mlp.gate",
276
+ "model.layers.26.mlp.shared_experts.down_proj",
277
+ "model.layers.26.mlp.shared_experts.gate_proj",
278
+ "model.layers.26.mlp.shared_experts.up_proj",
279
+ "model.layers.26.mlp_mhc_module.phi",
280
+ "model.layers.26.self_attn.kv_a_proj_with_mqa",
281
+ "model.layers.26.self_attn.kv_b_proj",
282
+ "model.layers.26.self_attn.q_a_proj",
283
+ "model.layers.27.attn_mhc_module.phi",
284
+ "model.layers.27.mlp.gate",
285
+ "model.layers.27.mlp.shared_experts.down_proj",
286
+ "model.layers.27.mlp.shared_experts.gate_proj",
287
+ "model.layers.27.mlp.shared_experts.up_proj",
288
+ "model.layers.27.mlp_mhc_module.phi",
289
+ "model.layers.27.self_attn.indexer.weights_proj",
290
+ "model.layers.27.self_attn.indexer.wk",
291
+ "model.layers.27.self_attn.indexer.wq_b",
292
+ "model.layers.27.self_attn.kv_a_proj_with_mqa",
293
+ "model.layers.27.self_attn.kv_b_proj",
294
+ "model.layers.27.self_attn.q_a_proj",
295
+ "model.layers.28.attn_mhc_module.phi",
296
+ "model.layers.28.mlp.gate",
297
+ "model.layers.28.mlp.shared_experts.down_proj",
298
+ "model.layers.28.mlp.shared_experts.gate_proj",
299
+ "model.layers.28.mlp.shared_experts.up_proj",
300
+ "model.layers.28.mlp_mhc_module.phi",
301
+ "model.layers.28.self_attn.kv_a_proj_with_mqa",
302
+ "model.layers.28.self_attn.kv_b_proj",
303
+ "model.layers.28.self_attn.q_a_proj",
304
+ "model.layers.29.attn_mhc_module.phi",
305
+ "model.layers.29.mlp.gate",
306
+ "model.layers.29.mlp.shared_experts.down_proj",
307
+ "model.layers.29.mlp.shared_experts.gate_proj",
308
+ "model.layers.29.mlp.shared_experts.up_proj",
309
+ "model.layers.29.mlp_mhc_module.phi",
310
+ "model.layers.29.self_attn.kv_a_proj_with_mqa",
311
+ "model.layers.29.self_attn.kv_b_proj",
312
+ "model.layers.29.self_attn.q_a_proj",
313
+ "model.layers.3.attn_mhc_module.phi",
314
+ "model.layers.3.mlp.gate",
315
+ "model.layers.3.mlp.shared_experts.down_proj",
316
+ "model.layers.3.mlp.shared_experts.gate_proj",
317
+ "model.layers.3.mlp.shared_experts.up_proj",
318
+ "model.layers.3.mlp_mhc_module.phi",
319
+ "model.layers.3.self_attn.indexer.weights_proj",
320
+ "model.layers.3.self_attn.indexer.wk",
321
+ "model.layers.3.self_attn.indexer.wq_b",
322
+ "model.layers.3.self_attn.kv_a_proj_with_mqa",
323
+ "model.layers.3.self_attn.kv_b_proj",
324
+ "model.layers.3.self_attn.q_a_proj",
325
+ "model.layers.30.attn_mhc_module.phi",
326
+ "model.layers.30.mlp.gate",
327
+ "model.layers.30.mlp.shared_experts.down_proj",
328
+ "model.layers.30.mlp.shared_experts.gate_proj",
329
+ "model.layers.30.mlp.shared_experts.up_proj",
330
+ "model.layers.30.mlp_mhc_module.phi",
331
+ "model.layers.30.self_attn.indexer.weights_proj",
332
+ "model.layers.30.self_attn.indexer.wk",
333
+ "model.layers.30.self_attn.indexer.wq_b",
334
+ "model.layers.30.self_attn.kv_a_proj_with_mqa",
335
+ "model.layers.30.self_attn.kv_b_proj",
336
+ "model.layers.30.self_attn.q_a_proj",
337
+ "model.layers.31.attn_mhc_module.phi",
338
+ "model.layers.31.mlp.gate",
339
+ "model.layers.31.mlp.shared_experts.down_proj",
340
+ "model.layers.31.mlp.shared_experts.gate_proj",
341
+ "model.layers.31.mlp.shared_experts.up_proj",
342
+ "model.layers.31.mlp_mhc_module.phi",
343
+ "model.layers.31.self_attn.kv_a_proj_with_mqa",
344
+ "model.layers.31.self_attn.kv_b_proj",
345
+ "model.layers.31.self_attn.q_a_proj",
346
+ "model.layers.32.attn_mhc_module.phi",
347
+ "model.layers.32.mlp.gate",
348
+ "model.layers.32.mlp.shared_experts.down_proj",
349
+ "model.layers.32.mlp.shared_experts.gate_proj",
350
+ "model.layers.32.mlp.shared_experts.up_proj",
351
+ "model.layers.32.mlp_mhc_module.phi",
352
+ "model.layers.32.self_attn.kv_a_proj_with_mqa",
353
+ "model.layers.32.self_attn.kv_b_proj",
354
+ "model.layers.32.self_attn.q_a_proj",
355
+ "model.layers.33.attn_mhc_module.phi",
356
+ "model.layers.33.mlp.gate",
357
+ "model.layers.33.mlp.shared_experts.down_proj",
358
+ "model.layers.33.mlp.shared_experts.gate_proj",
359
+ "model.layers.33.mlp.shared_experts.up_proj",
360
+ "model.layers.33.mlp_mhc_module.phi",
361
+ "model.layers.33.self_attn.indexer.weights_proj",
362
+ "model.layers.33.self_attn.indexer.wk",
363
+ "model.layers.33.self_attn.indexer.wq_b",
364
+ "model.layers.33.self_attn.kv_a_proj_with_mqa",
365
+ "model.layers.33.self_attn.kv_b_proj",
366
+ "model.layers.33.self_attn.q_a_proj",
367
+ "model.layers.34.attn_mhc_module.phi",
368
+ "model.layers.34.mlp.gate",
369
+ "model.layers.34.mlp.shared_experts.down_proj",
370
+ "model.layers.34.mlp.shared_experts.gate_proj",
371
+ "model.layers.34.mlp.shared_experts.up_proj",
372
+ "model.layers.34.mlp_mhc_module.phi",
373
+ "model.layers.34.self_attn.kv_a_proj_with_mqa",
374
+ "model.layers.34.self_attn.kv_b_proj",
375
+ "model.layers.34.self_attn.q_a_proj",
376
+ "model.layers.35.attn_mhc_module.phi",
377
+ "model.layers.35.mlp.gate",
378
+ "model.layers.35.mlp.shared_experts.down_proj",
379
+ "model.layers.35.mlp.shared_experts.gate_proj",
380
+ "model.layers.35.mlp.shared_experts.up_proj",
381
+ "model.layers.35.mlp_mhc_module.phi",
382
+ "model.layers.35.self_attn.kv_a_proj_with_mqa",
383
+ "model.layers.35.self_attn.kv_b_proj",
384
+ "model.layers.35.self_attn.q_a_proj",
385
+ "model.layers.36.attn_mhc_module.phi",
386
+ "model.layers.36.mlp.gate",
387
+ "model.layers.36.mlp.shared_experts.down_proj",
388
+ "model.layers.36.mlp.shared_experts.gate_proj",
389
+ "model.layers.36.mlp.shared_experts.up_proj",
390
+ "model.layers.36.mlp_mhc_module.phi",
391
+ "model.layers.36.self_attn.indexer.weights_proj",
392
+ "model.layers.36.self_attn.indexer.wk",
393
+ "model.layers.36.self_attn.indexer.wq_b",
394
+ "model.layers.36.self_attn.kv_a_proj_with_mqa",
395
+ "model.layers.36.self_attn.kv_b_proj",
396
+ "model.layers.36.self_attn.q_a_proj",
397
+ "model.layers.37.attn_mhc_module.phi",
398
+ "model.layers.37.mlp.gate",
399
+ "model.layers.37.mlp.shared_experts.down_proj",
400
+ "model.layers.37.mlp.shared_experts.gate_proj",
401
+ "model.layers.37.mlp.shared_experts.up_proj",
402
+ "model.layers.37.mlp_mhc_module.phi",
403
+ "model.layers.37.self_attn.kv_a_proj_with_mqa",
404
+ "model.layers.37.self_attn.kv_b_proj",
405
+ "model.layers.37.self_attn.q_a_proj",
406
+ "model.layers.38.attn_mhc_module.phi",
407
+ "model.layers.38.mlp.gate",
408
+ "model.layers.38.mlp.shared_experts.down_proj",
409
+ "model.layers.38.mlp.shared_experts.gate_proj",
410
+ "model.layers.38.mlp.shared_experts.up_proj",
411
+ "model.layers.38.mlp_mhc_module.phi",
412
+ "model.layers.38.self_attn.kv_a_proj_with_mqa",
413
+ "model.layers.38.self_attn.kv_b_proj",
414
+ "model.layers.38.self_attn.q_a_proj",
415
+ "model.layers.39.attn_mhc_module.phi",
416
+ "model.layers.39.mlp.gate",
417
+ "model.layers.39.mlp.shared_experts.down_proj",
418
+ "model.layers.39.mlp.shared_experts.gate_proj",
419
+ "model.layers.39.mlp.shared_experts.up_proj",
420
+ "model.layers.39.mlp_mhc_module.phi",
421
+ "model.layers.39.self_attn.indexer.weights_proj",
422
+ "model.layers.39.self_attn.indexer.wk",
423
+ "model.layers.39.self_attn.indexer.wq_b",
424
+ "model.layers.39.self_attn.kv_a_proj_with_mqa",
425
+ "model.layers.39.self_attn.kv_b_proj",
426
+ "model.layers.39.self_attn.q_a_proj",
427
+ "model.layers.4.attn_mhc_module.phi",
428
+ "model.layers.4.mlp.gate",
429
+ "model.layers.4.mlp.shared_experts.down_proj",
430
+ "model.layers.4.mlp.shared_experts.gate_proj",
431
+ "model.layers.4.mlp.shared_experts.up_proj",
432
+ "model.layers.4.mlp_mhc_module.phi",
433
+ "model.layers.4.self_attn.kv_a_proj_with_mqa",
434
+ "model.layers.4.self_attn.kv_b_proj",
435
+ "model.layers.4.self_attn.q_a_proj",
436
+ "model.layers.40.attn_mhc_module.phi",
437
+ "model.layers.40.mlp.gate",
438
+ "model.layers.40.mlp.shared_experts.down_proj",
439
+ "model.layers.40.mlp.shared_experts.gate_proj",
440
+ "model.layers.40.mlp.shared_experts.up_proj",
441
+ "model.layers.40.mlp_mhc_module.phi",
442
+ "model.layers.40.self_attn.kv_a_proj_with_mqa",
443
+ "model.layers.40.self_attn.kv_b_proj",
444
+ "model.layers.40.self_attn.q_a_proj",
445
+ "model.layers.41.attn_mhc_module.phi",
446
+ "model.layers.41.mlp.gate",
447
+ "model.layers.41.mlp.shared_experts.down_proj",
448
+ "model.layers.41.mlp.shared_experts.gate_proj",
449
+ "model.layers.41.mlp.shared_experts.up_proj",
450
+ "model.layers.41.mlp_mhc_module.phi",
451
+ "model.layers.41.self_attn.kv_a_proj_with_mqa",
452
+ "model.layers.41.self_attn.kv_b_proj",
453
+ "model.layers.41.self_attn.q_a_proj",
454
+ "model.layers.42.attn_mhc_module.phi",
455
+ "model.layers.42.mlp.gate",
456
+ "model.layers.42.mlp.shared_experts.down_proj",
457
+ "model.layers.42.mlp.shared_experts.gate_proj",
458
+ "model.layers.42.mlp.shared_experts.up_proj",
459
+ "model.layers.42.mlp_mhc_module.phi",
460
+ "model.layers.42.self_attn.indexer.weights_proj",
461
+ "model.layers.42.self_attn.indexer.wk",
462
+ "model.layers.42.self_attn.indexer.wq_b",
463
+ "model.layers.42.self_attn.kv_a_proj_with_mqa",
464
+ "model.layers.42.self_attn.kv_b_proj",
465
+ "model.layers.42.self_attn.q_a_proj",
466
+ "model.layers.43.attn_mhc_module.phi",
467
+ "model.layers.43.mlp.gate",
468
+ "model.layers.43.mlp.shared_experts.down_proj",
469
+ "model.layers.43.mlp.shared_experts.gate_proj",
470
+ "model.layers.43.mlp.shared_experts.up_proj",
471
+ "model.layers.43.mlp_mhc_module.phi",
472
+ "model.layers.43.self_attn.kv_a_proj_with_mqa",
473
+ "model.layers.43.self_attn.kv_b_proj",
474
+ "model.layers.43.self_attn.q_a_proj",
475
+ "model.layers.44.attn_mhc_module.phi",
476
+ "model.layers.44.mlp.gate",
477
+ "model.layers.44.mlp.shared_experts.down_proj",
478
+ "model.layers.44.mlp.shared_experts.gate_proj",
479
+ "model.layers.44.mlp.shared_experts.up_proj",
480
+ "model.layers.44.mlp_mhc_module.phi",
481
+ "model.layers.44.self_attn.kv_a_proj_with_mqa",
482
+ "model.layers.44.self_attn.kv_b_proj",
483
+ "model.layers.44.self_attn.q_a_proj",
484
+ "model.layers.45.attn_mhc_module.phi",
485
+ "model.layers.45.mlp.gate",
486
+ "model.layers.45.mlp.shared_experts.down_proj",
487
+ "model.layers.45.mlp.shared_experts.gate_proj",
488
+ "model.layers.45.mlp.shared_experts.up_proj",
489
+ "model.layers.45.mlp_mhc_module.phi",
490
+ "model.layers.45.self_attn.indexer.weights_proj",
491
+ "model.layers.45.self_attn.indexer.wk",
492
+ "model.layers.45.self_attn.indexer.wq_b",
493
+ "model.layers.45.self_attn.kv_a_proj_with_mqa",
494
+ "model.layers.45.self_attn.kv_b_proj",
495
+ "model.layers.45.self_attn.q_a_proj",
496
+ "model.layers.46.attn_mhc_module.phi",
497
+ "model.layers.46.mlp.gate",
498
+ "model.layers.46.mlp.shared_experts.down_proj",
499
+ "model.layers.46.mlp.shared_experts.gate_proj",
500
+ "model.layers.46.mlp.shared_experts.up_proj",
501
+ "model.layers.46.mlp_mhc_module.phi",
502
+ "model.layers.46.self_attn.kv_a_proj_with_mqa",
503
+ "model.layers.46.self_attn.kv_b_proj",
504
+ "model.layers.46.self_attn.q_a_proj",
505
+ "model.layers.47.attn_mhc_module.phi",
506
+ "model.layers.47.mlp.gate",
507
+ "model.layers.47.mlp.shared_experts.down_proj",
508
+ "model.layers.47.mlp.shared_experts.gate_proj",
509
+ "model.layers.47.mlp.shared_experts.up_proj",
510
+ "model.layers.47.mlp_mhc_module.phi",
511
+ "model.layers.47.self_attn.kv_a_proj_with_mqa",
512
+ "model.layers.47.self_attn.kv_b_proj",
513
+ "model.layers.47.self_attn.q_a_proj",
514
+ "model.layers.48.attn_mhc_module.phi",
515
+ "model.layers.48.mlp.gate",
516
+ "model.layers.48.mlp.shared_experts.down_proj",
517
+ "model.layers.48.mlp.shared_experts.gate_proj",
518
+ "model.layers.48.mlp.shared_experts.up_proj",
519
+ "model.layers.48.mlp_mhc_module.phi",
520
+ "model.layers.48.self_attn.indexer.weights_proj",
521
+ "model.layers.48.self_attn.indexer.wk",
522
+ "model.layers.48.self_attn.indexer.wq_b",
523
+ "model.layers.48.self_attn.kv_a_proj_with_mqa",
524
+ "model.layers.48.self_attn.kv_b_proj",
525
+ "model.layers.48.self_attn.q_a_proj",
526
+ "model.layers.49.attn_mhc_module.phi",
527
+ "model.layers.49.mlp.gate",
528
+ "model.layers.49.mlp.shared_experts.down_proj",
529
+ "model.layers.49.mlp.shared_experts.gate_proj",
530
+ "model.layers.49.mlp.shared_experts.up_proj",
531
+ "model.layers.49.mlp_mhc_module.phi",
532
+ "model.layers.49.self_attn.indexer.weights_proj",
533
+ "model.layers.49.self_attn.indexer.wk",
534
+ "model.layers.49.self_attn.indexer.wq_b",
535
+ "model.layers.49.self_attn.kv_a_proj_with_mqa",
536
+ "model.layers.49.self_attn.kv_b_proj",
537
+ "model.layers.49.self_attn.q_a_proj",
538
+ "model.layers.5.attn_mhc_module.phi",
539
+ "model.layers.5.mlp.gate",
540
+ "model.layers.5.mlp.shared_experts.down_proj",
541
+ "model.layers.5.mlp.shared_experts.gate_proj",
542
+ "model.layers.5.mlp.shared_experts.up_proj",
543
+ "model.layers.5.mlp_mhc_module.phi",
544
+ "model.layers.5.self_attn.kv_a_proj_with_mqa",
545
+ "model.layers.5.self_attn.kv_b_proj",
546
+ "model.layers.5.self_attn.q_a_proj",
547
+ "model.layers.50.embed_tokens",
548
+ "model.layers.50.mlp.gate",
549
+ "model.layers.50.mlp.shared_experts.down_proj",
550
+ "model.layers.50.mlp.shared_experts.gate_proj",
551
+ "model.layers.50.mlp.shared_experts.up_proj",
552
+ "model.layers.50.self_attn.kv_a_proj_with_mqa",
553
+ "model.layers.50.self_attn.kv_b_proj",
554
+ "model.layers.50.self_attn.q_a_proj",
555
+ "model.layers.50.shared_head.head",
556
+ "model.layers.51.embed_tokens",
557
+ "model.layers.51.mlp.gate",
558
+ "model.layers.51.mlp.shared_experts.down_proj",
559
+ "model.layers.51.mlp.shared_experts.gate_proj",
560
+ "model.layers.51.mlp.shared_experts.up_proj",
561
+ "model.layers.51.self_attn.kv_a_proj_with_mqa",
562
+ "model.layers.51.self_attn.kv_b_proj",
563
+ "model.layers.51.self_attn.q_a_proj",
564
+ "model.layers.51.shared_head.head",
565
+ "model.layers.52.embed_tokens",
566
+ "model.layers.52.mlp.gate",
567
+ "model.layers.52.mlp.shared_experts.down_proj",
568
+ "model.layers.52.mlp.shared_experts.gate_proj",
569
+ "model.layers.52.mlp.shared_experts.up_proj",
570
+ "model.layers.52.self_attn.kv_a_proj_with_mqa",
571
+ "model.layers.52.self_attn.kv_b_proj",
572
+ "model.layers.52.self_attn.q_a_proj",
573
+ "model.layers.52.shared_head.head",
574
+ "model.layers.6.attn_mhc_module.phi",
575
+ "model.layers.6.mlp.gate",
576
+ "model.layers.6.mlp.shared_experts.down_proj",
577
+ "model.layers.6.mlp.shared_experts.gate_proj",
578
+ "model.layers.6.mlp.shared_experts.up_proj",
579
+ "model.layers.6.mlp_mhc_module.phi",
580
+ "model.layers.6.self_attn.indexer.weights_proj",
581
+ "model.layers.6.self_attn.indexer.wk",
582
+ "model.layers.6.self_attn.indexer.wq_b",
583
+ "model.layers.6.self_attn.kv_a_proj_with_mqa",
584
+ "model.layers.6.self_attn.kv_b_proj",
585
+ "model.layers.6.self_attn.q_a_proj",
586
+ "model.layers.7.attn_mhc_module.phi",
587
+ "model.layers.7.mlp.gate",
588
+ "model.layers.7.mlp.shared_experts.down_proj",
589
+ "model.layers.7.mlp.shared_experts.gate_proj",
590
+ "model.layers.7.mlp.shared_experts.up_proj",
591
+ "model.layers.7.mlp_mhc_module.phi",
592
+ "model.layers.7.self_attn.kv_a_proj_with_mqa",
593
+ "model.layers.7.self_attn.kv_b_proj",
594
+ "model.layers.7.self_attn.q_a_proj",
595
+ "model.layers.8.attn_mhc_module.phi",
596
+ "model.layers.8.mlp.gate",
597
+ "model.layers.8.mlp.shared_experts.down_proj",
598
+ "model.layers.8.mlp.shared_experts.gate_proj",
599
+ "model.layers.8.mlp.shared_experts.up_proj",
600
+ "model.layers.8.mlp_mhc_module.phi",
601
+ "model.layers.8.self_attn.kv_a_proj_with_mqa",
602
+ "model.layers.8.self_attn.kv_b_proj",
603
+ "model.layers.8.self_attn.q_a_proj",
604
+ "model.layers.9.attn_mhc_module.phi",
605
+ "model.layers.9.mlp.gate",
606
+ "model.layers.9.mlp.shared_experts.down_proj",
607
+ "model.layers.9.mlp.shared_experts.gate_proj",
608
+ "model.layers.9.mlp.shared_experts.up_proj",
609
+ "model.layers.9.mlp_mhc_module.phi",
610
+ "model.layers.9.self_attn.indexer.weights_proj",
611
+ "model.layers.9.self_attn.indexer.wk",
612
+ "model.layers.9.self_attn.indexer.wq_b",
613
+ "model.layers.9.self_attn.kv_a_proj_with_mqa",
614
+ "model.layers.9.self_attn.kv_b_proj",
615
+ "model.layers.9.self_attn.q_a_proj",
616
+ "model.merge_mhc_module.phi"
617
+ ],
618
+ "sparsity_config": {},
619
+ "transform_config": {},
620
+ "global_compression_ratio": 1.9661,
621
+ "kv_cache_scheme": null
622
+ }
623
+ }
configuration_openpangu_v2.py ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright (c) 2026 Huawei Technologies Co., Ltd. All Rights Reserved.
3
+ # Copyright 2026 The HuggingFace Inc. team. All rights reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ """ OpenPangu_v2 model configuration"""
17
+
18
+ from transformers.configuration_utils import PretrainedConfig
19
+ from transformers.utils import logging
20
+
21
+ try:
22
+ # transformers >= 5.0 exports RopeParameters as a TypedDict.
23
+ from transformers.modeling_rope_utils import RopeParameters
24
+ except ImportError:
25
+ # transformers < 5.0 has no RopeParameters. Provide a TypedDict with the
26
+ # same fields so the `rope_parameters` annotation still resolves. It is
27
+ # only used for typing -- `rope_parameters` defaults to None and is not
28
+ # exercised by config.json, so this fallback never affects behavior.
29
+ from typing import TypedDict
30
+
31
+ class RopeParameters(TypedDict, total=False):
32
+ rope_theta: float
33
+ rope_type: str | None
34
+ partial_rotary_factor: float | None
35
+ factor: float | None
36
+ original_max_position_embeddings: int | None
37
+ attention_factor: float | None
38
+ beta_fast: float | None
39
+ beta_slow: float | None
40
+ short_factor: list[float] | None
41
+ long_factor: list[float] | None
42
+ low_freq_factor: float | None
43
+ high_freq_factor: float | None
44
+
45
+ logger = logging.get_logger(__name__)
46
+
47
+
48
+ class OpenPanguV2Config(PretrainedConfig):
49
+ model_type = "openpangu_v2"
50
+ keys_to_ignore_at_inference = ["past_key_values"]
51
+
52
+ # Default tensor parallel plan for base model `OpenPangu_v2`
53
+ base_model_tp_plan = {
54
+ "layers.*.self_attn.q_proj": "colwise",
55
+ "layers.*.self_attn.k_proj": "colwise",
56
+ "layers.*.self_attn.v_proj": "colwise",
57
+ "layers.*.self_attn.o_proj": "rowwise",
58
+ "layers.*.mlp.gate_proj": "colwise",
59
+ "layers.*.mlp.up_proj": "colwise",
60
+ "layers.*.mlp.down_proj": "rowwise",
61
+ "layers.*.mlp.experts.gate_up_proj": "rowwise",
62
+ "layers.*.mlp.experts.down_proj": "rowwise",
63
+ "layers.*.mlp.shared_experts.gate_proj": "colwise",
64
+ "layers.*.mlp.shared_experts.up_proj": "colwise",
65
+ "layers.*.mlp.shared_experts.down_proj": "rowwise",
66
+ }
67
+ base_model_pp_plan = {
68
+ "embed_tokens": (["input_ids"], ["inputs_embeds"]),
69
+ "layers": (["hidden_states", "attention_mask"], ["hidden_states"]),
70
+ "norm": (["hidden_states"], ["hidden_states"]),
71
+ }
72
+
73
+ def __init__(
74
+ self,
75
+ attention_dropout: float | None = 0.0,
76
+ block_post_layernorm_idx: list[int] | None = None,
77
+ dsa_layers: list[str] | None = None,
78
+ first_k_dense_replace: int | None = 0,
79
+ head_dim: int | None = None,
80
+ hidden_act: str | None = "silu",
81
+ hidden_size: int | None = None,
82
+ index_head_dim: int | None = None,
83
+ index_n_heads: int | None = None,
84
+ index_topk: int | None = None,
85
+ intermediate_size: int | None = None,
86
+ kv_lora_rank: int | None = None,
87
+ layer_types: list[str] | None = None,
88
+ max_position_embeddings: int | None = None,
89
+ mhc_num_stream: int | None = None,
90
+ mhc_recur_norm: int | None = None,
91
+ mhc_use_gamma: bool | None = None,
92
+ moe_intermediate_size: int | None = None,
93
+ n_routed_experts: int | None = None,
94
+ n_shared_experts: int | None = None,
95
+ norm_topk_prob: bool | None = None,
96
+ num_attention_heads: int | None = None,
97
+ num_experts_per_tok: int | None = None,
98
+ num_hidden_layers: int | None = 0,
99
+ num_key_value_heads: int | None = None,
100
+ param_sink_number: int | None = 0,
101
+ q_lora_rank: int | None = None,
102
+ qk_nope_head_dim: int | None = None,
103
+ qk_rope_head_dim: int | None = None,
104
+ rms_norm_eps: float | None = 1e-5,
105
+ rope_interleave: bool | None = False,
106
+ rope_parameters: RopeParameters | dict[str, RopeParameters] | None = None,
107
+ routed_scaling_factor: float | None = None,
108
+ router_sliding_window: int | None = 0,
109
+ sandwich_norm: bool | None = False,
110
+ sliding_window: int | list[int] | None = None,
111
+ swa_layers: list[str] | None = None,
112
+ use_cache: bool | None = True,
113
+ use_mhc: bool | None = False,
114
+ v_head_dim: int | None = None,
115
+ vocab_size: int | None = None,
116
+ **kwargs,
117
+ ):
118
+ self.vocab_size = vocab_size
119
+ self.max_position_embeddings = max_position_embeddings
120
+ self.hidden_size = hidden_size
121
+ self.intermediate_size = intermediate_size
122
+ self.moe_intermediate_size = moe_intermediate_size
123
+ self.num_hidden_layers = num_hidden_layers
124
+ self.num_attention_heads = num_attention_heads
125
+ # for backward compatibility
126
+ if num_key_value_heads is None:
127
+ num_key_value_heads = num_attention_heads
128
+ self.num_key_value_heads = num_key_value_heads
129
+ self.head_dim = head_dim
130
+ self.v_head_dim = v_head_dim
131
+ self.hidden_act = hidden_act
132
+ self.rms_norm_eps = rms_norm_eps
133
+ self.use_cache = use_cache
134
+ self.rope_parameters = rope_parameters
135
+ self.attention_dropout = attention_dropout
136
+ self.layer_types = layer_types
137
+
138
+ self.n_shared_experts = n_shared_experts
139
+ self.n_routed_experts = n_routed_experts
140
+ self.routed_scaling_factor = routed_scaling_factor
141
+ self.kv_lora_rank = kv_lora_rank
142
+ self.q_lora_rank = q_lora_rank
143
+ self.qk_rope_head_dim = qk_rope_head_dim
144
+ self.qk_nope_head_dim = qk_nope_head_dim
145
+ if qk_rope_head_dim is not None and qk_nope_head_dim is not None:
146
+ self.head_dim = qk_rope_head_dim
147
+ self.qk_head_dim = qk_nope_head_dim + qk_rope_head_dim
148
+ self.num_experts_per_tok = num_experts_per_tok
149
+ self.first_k_dense_replace = first_k_dense_replace
150
+ self.norm_topk_prob = norm_topk_prob
151
+ self.rope_interleave = rope_interleave
152
+
153
+ self.sliding_window = sliding_window
154
+ self.swa_layers = swa_layers
155
+
156
+ self.param_sink_number = param_sink_number
157
+ self.router_sliding_window = router_sliding_window
158
+ self.sandwich_norm = sandwich_norm
159
+ self.block_post_layernorm_idx = block_post_layernorm_idx
160
+ self.use_mhc = use_mhc
161
+ self.mhc_use_gamma = mhc_use_gamma
162
+ self.mhc_recur_norm = mhc_recur_norm
163
+ self.mhc_num_stream = mhc_num_stream
164
+
165
+ # Indexer (DSA) parameters
166
+ self.dsa_layers = dsa_layers
167
+ self.index_topk = index_topk
168
+ self.index_head_dim = index_head_dim
169
+ self.index_n_heads = index_n_heads
170
+
171
+ if self.layer_types is None:
172
+ if self.swa_layers is not None:
173
+ self.layer_types = [
174
+ "sliding_attention"
175
+ if i in self.swa_layers
176
+ else "full_attention"
177
+ for i in range(self.num_hidden_layers)
178
+ ]
179
+ else:
180
+ self.layer_types = ["full_attention" for _ in range(self.num_hidden_layers)]
181
+
182
+ if num_hidden_layers is not None and self.layer_types is not None and len(self.layer_types) != num_hidden_layers:
183
+ raise ValueError(
184
+ f"`num_hidden_layers` ({num_hidden_layers}) must be equal to the number of layer types "
185
+ f"({len(layer_types)})"
186
+ )
187
+
188
+ super().__init__(**kwargs)
189
+
190
+
191
+ __all__ = ["OpenPanguV2Config"]
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "eos_token_id": [148902],
3
+ "temperature": 1.0,
4
+ "top_p": 0.8,
5
+ "top_k": 151552,
6
+ "seed": 1234
7
+ }
model-00001.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b39f4f900cf256290295a26ae8248a00ced1664cab78d839698176aa869d290
3
+ size 4655677784
model-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:edb85a65dfb2d117eef54ff165a41b1759266e9a36e80767d7401dde470af282
3
+ size 2878764124
model-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:732544017fa9a804b5dd966b7c6a25475ffb13670f53b22813fafadea8cb399a
3
+ size 2000992336
model-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:825bbb44cc878fae49847cf6f0557a2ceea0887b032fd709970e0921dd8ad398
3
+ size 2000992712
model-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df3daebe8ea4fdf81f92f7aedaf239ee8317beb62ea8a89ee04ffaa7969eedc4
3
+ size 2000992712
model-00006.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:434abbe3be7f3e04008148fac570758c2373369fb2568c5d22fcefa05d854e9f
3
+ size 2001791608
model-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35094cc5bd919cbf0342c0d29ae61a85b5266e95b3f5737bd7311ff7037018a5
3
+ size 2002444440
model-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:befccbc9c3f533acaa69d670052912e448121759da3445dd28fc5f03229175dd
3
+ size 2051698892
model-00009.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a608f1c39b0a3a6b94f66ab2dc0a1437713cbd31692f88b8be76d1e2d6b1620c
3
+ size 2000992632
model-00010.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df779fc9e3e6a64a0ae8f6346e9b4e8960f212ea1bcf71d1ce29bfca9844c657
3
+ size 2000992712
model-00011.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33a7ca72ff3b77945457244d30a5cdd0a4c55118668b2c739bebc661c6130ee1
3
+ size 2001298928
model-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f38140dcd39663c6ebcf2bc1576d7974350ead7fd806e9c5d0bcb83db47391b
3
+ size 2002444336
model-00013.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24ad38a7ec9965ca98473d281cfda20032dc3a6e75f9bd729ffc44831f1bbfd8
3
+ size 2052232652
model-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9b0d6311eaf21a9192ee0fba69a4f0ef5e0c28a53770361fe5022d9531d5985
3
+ size 2000992488
model-00015.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8aad9ec61444bed8552640d62852860c88c8e54a82c23084d218975dabc4023
3
+ size 2000992712
model-00016.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:17fd92f09889bd1fabe2142e03252a601acc01ba1a477b4a372ba17291d9e9b1
3
+ size 2000992712
model-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6100532b699274753f97b111762f15a02d1c3070870d8080f74686b24916cb3
3
+ size 2002257800
model-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:32eca7bf18aeb0cdce8e89af67300d1263e03e0c63ddaa4f2bf5aa23b01b10e2
3
+ size 2066906348
model-00019.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7718a8437d71accf96d995ff245e2652d280bc7941e25003a2b402abb4e90053
3
+ size 2000992320
model-00020.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:031fe379e46f4f5ecb0269040d53044dcaaf38096bf8590eabc680135776dfed
3
+ size 2000992712
model-00021.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47b29e197e5c51aa62227fe8f7a241531fd2494b19f57ef060f8fdf621b9a201
3
+ size 2000992712
model-00022.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:13cf2d9649deaf1dc9e5e3c8edbd35ce7bef19cfd0850952e970e4fb1d1d0cbd
3
+ size 2001764976
model-00023.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a1e765d2b6580584d20b894b9a216c2003668e40d94d14acb4318571edf9334
3
+ size 2002444440
model-00024.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00397df054d39a3c46d5cb420e2b32aa4185af59cd446dff9b6b4b22c47b278c
3
+ size 516386172
model-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:175ed9f8672e181cf0a69756c2753dedb5ebdd2f8eeba7b8e3bb9904b4227aa1
3
+ size 2030997248
model-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c7c9e0d5342e54f21e688d0d2501a3ab149ddac35ff4b4fb883e3cb246173163
3
+ size 2000992712
model-00027.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72bdf841190912df3f015788d3d16e928e722f16739b9faa055fd149458205db
3
+ size 2000992712
model-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72b198d575ed8024f75726891d39e10f3eb854b685732aec2a9efd6ff27b6df7
3
+ size 2001631792
model-00029.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1921b006292a4e27366dd9878c260e146f735fa333ebcf6096c58a9fbc2073d2
3
+ size 2002444432
model-00030.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac8af44ff55de695a8243165db4f373361a7190b6a4dc25675ed1e2f6cc8fb05
3
+ size 2051858684
model-00031.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f5183292ce9806f11f5d7cbffe8308b97feb409583c55b38c2dcceba6e6cea4
3
+ size 2000992584
model-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:051a8d3521cd759c3a5c37ad4288e28adc466c6e16861a06ba200fe40fbe9bf0
3
+ size 2000992712
model-00033.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27f35b92e3e34ff2feb36df813b111b6c3fea2763c8b803f5a81ebcf8281d849
3
+ size 2001139168
model-00034.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d0bc7b8205504f286bdaea08bc9769837d3148f9fb7f38cd5c2b56b2c457eed
3
+ size 2002444288
model-00035.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:434e08cc2fa08b6b742320a56e05f911912ae63e962efe96aa8113c465bf2bba
3
+ size 2066573420
model-00036.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d66ead03e2c3490a90defec16a78b6b726eee0b0d41502c397e0e453a8d8139
3
+ size 2000992440
model-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:643a31df0f5a9718389be9edd693dc9e402c76be9e504cab32e530aa2077a74f
3
+ size 2000992712
model-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0146a3f3756f35d0b8ac8aa152c7b5723dd02e44f3d6a04eb36269efe92aa307
3
+ size 2000992712
model-00039.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4b6536ced36ca3320afb91a13c9ac71368f99e269fab8deb952ff9d58c22aae
3
+ size 2002098000
model-00040.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41c0ca23463509b0259da0ee8c7fc394db535b6daa10dca7a8ba956f284f3b96
3
+ size 2002444440
model-00041.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dcdcaf637963d1c289b8ccd0af1733e565c9c77a12c634bde1c8a3701dcbf254
3
+ size 2051433276
model-00042.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4fd6edfb263e7b62846206bf47e4039899f79fc9bf66cc9224cabf86ca80e6a0
3
+ size 2000993152