Text Generation
Transformers
Safetensors
ceno
dna
genomics
dna-language-model
mamba
Mixture of Experts
custom_code
Instructions to use CladeTeam/CENO-9B-A3B-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CladeTeam/CENO-9B-A3B-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CladeTeam/CENO-9B-A3B-base", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("CladeTeam/CENO-9B-A3B-base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CladeTeam/CENO-9B-A3B-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CladeTeam/CENO-9B-A3B-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CladeTeam/CENO-9B-A3B-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/CladeTeam/CENO-9B-A3B-base
- SGLang
How to use CladeTeam/CENO-9B-A3B-base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "CladeTeam/CENO-9B-A3B-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CladeTeam/CENO-9B-A3B-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "CladeTeam/CENO-9B-A3B-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CladeTeam/CENO-9B-A3B-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use CladeTeam/CENO-9B-A3B-base with Docker Model Runner:
docker model run hf.co/CladeTeam/CENO-9B-A3B-base
Add config, code, tokenizer, index and model card
Browse files- LICENSE +201 -0
- NOTICE +25 -0
- README.md +101 -0
- ceno_cp_math.py +54 -0
- ceno_norm.py +99 -0
- ceno_tokenizer.py +571 -0
- config.json +84 -0
- configuration_ceno.py +344 -0
- generation_config.json +7 -0
- model.safetensors.index.json +570 -0
- modeling_ceno.py +0 -0
- special_tokens_map.json +5 -0
- third_party/TransformerEngine-LICENSE +175 -0
- tokenizer_config.json +26 -0
- training_precision.py +654 -0
- vocab.json +485 -0
LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or Derivative
|
| 95 |
+
Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright [yyyy] [name of copyright owner]
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
NOTICE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
CENO
|
| 2 |
+
Copyright (c) 2025-2026 CENO Authors. All rights reserved.
|
| 3 |
+
|
| 4 |
+
This product includes model code adapted from the Nemotron-H and Mamba2
|
| 5 |
+
implementations distributed in Hugging Face Transformers
|
| 6 |
+
(https://github.com/huggingface/transformers), with Hugging Face and NVIDIA
|
| 7 |
+
copyright notices preserved. Hugging Face Transformers is licensed under the
|
| 8 |
+
Apache License, Version 2.0.
|
| 9 |
+
|
| 10 |
+
The CENO configuration and modeling modules under `ceno_model/ceno_hf/` are
|
| 11 |
+
adapted from those implementations and are distributed under the same Apache
|
| 12 |
+
License, Version 2.0, included in this distribution as the `LICENSE` file.
|
| 13 |
+
|
| 14 |
+
The tokenizer module is derived from Arc Institute's Evo2 CharLevelTokenizer,
|
| 15 |
+
also distributed under the Apache License, Version 2.0. Its upstream copyright
|
| 16 |
+
notice is preserved in `ceno_model/ceno_hf/ceno_tokenizer.py`.
|
| 17 |
+
|
| 18 |
+
Nemotron-H is © NVIDIA Corporation. CENO and CENO-P are derivative works that
|
| 19 |
+
build on the Nemotron-H Mamba/Attention/MoE hybrid backbone and add
|
| 20 |
+
multi-species alignment (MSA) post-training. All NVIDIA copyright notices and
|
| 21 |
+
license terms are preserved as required by the Apache License, Version 2.0.
|
| 22 |
+
|
| 23 |
+
The CENO normalization and CP merge helpers include adaptations of NVIDIA
|
| 24 |
+
TransformerEngine (Apache-2.0). Its license is included in the corresponding
|
| 25 |
+
third_party/TransformerEngine-LICENSE file.
|
README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
tags:
|
| 5 |
+
- dna
|
| 6 |
+
- genomics
|
| 7 |
+
- dna-language-model
|
| 8 |
+
- mamba
|
| 9 |
+
- moe
|
| 10 |
+
pipeline_tag: text-generation
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# CENO-9B-A3B-base
|
| 14 |
+
|
| 15 |
+
**CENO-9B-A3B-base** is the base pretraining checkpoint of the 9B **CENO** DNA foundation model — a causal language model over genomic sequence built on a
|
| 16 |
+
Nemotron-H **Mamba / Attention / Mixture-of-Experts** hybrid backbone (no MSA inputs).
|
| 17 |
+
|
| 18 |
+
It is part of the **CENO** DNA foundation model family. Model code, the VEP pipeline, and a
|
| 19 |
+
generation demo live in the companion [CENO code repository](https://github.com/CladeTeam/CENO).
|
| 20 |
+
This checkpoint is standalone-loadable with `trust_remote_code=True` — the model code is
|
| 21 |
+
bundled here.
|
| 22 |
+
|
| 23 |
+
## Model details
|
| 24 |
+
|
| 25 |
+
| | |
|
| 26 |
+
|---|---|
|
| 27 |
+
| Family | CENO (base) |
|
| 28 |
+
| Training stage | Base pretraining (stage 2) |
|
| 29 |
+
| Parameters | 8.9B (8928.6M) |
|
| 30 |
+
| Precision | bfloat16 |
|
| 31 |
+
| `model_type` | `ceno` |
|
| 32 |
+
| Architecture class | `CENOForCausalLM` |
|
| 33 |
+
| Auto-map (model) | `modeling_ceno.CENOForCausalLM` |
|
| 34 |
+
| Auto-map (tokenizer) | `ceno_tokenizer.CENOCharLevelTokenizer` |
|
| 35 |
+
|
| 36 |
+
## Architecture
|
| 37 |
+
|
| 38 |
+
| Property | Value |
|
| 39 |
+
|---|---|
|
| 40 |
+
| Hidden layers | 42 |
|
| 41 |
+
| Hidden size | 2560 |
|
| 42 |
+
| Attention heads | 20 |
|
| 43 |
+
| Intermediate size | 10240 |
|
| 44 |
+
| Experts (MoE) | 8 (top-2 per token) |
|
| 45 |
+
| Vocabulary | 512 (byte / character-level) |
|
| 46 |
+
|
| 47 |
+
The backbone is a Mamba / Attention / Mixture-of-Experts hybrid (Nemotron-H
|
| 48 |
+
architecture). The tokenizer is character-level, mapping DNA bases to their ASCII
|
| 49 |
+
byte codes.
|
| 50 |
+
|
| 51 |
+
## Usage
|
| 52 |
+
|
| 53 |
+
```python
|
| 54 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 55 |
+
|
| 56 |
+
ckpt = "CladeTeam/CENO-9B-A3B-base"
|
| 57 |
+
model = AutoModelForCausalLM.from_pretrained(ckpt, trust_remote_code=True)
|
| 58 |
+
tokenizer = AutoTokenizer.from_pretrained(ckpt, trust_remote_code=True)
|
| 59 |
+
|
| 60 |
+
ids = tokenizer.encode("ATCGATCG", return_tensors="pt")
|
| 61 |
+
# out = model.generate(ids, max_new_tokens=128) # needs a CUDA GPU (Mamba kernels)
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> The Mamba layers require CUDA kernels, so forward passes and generation need a GPU.
|
| 65 |
+
> Config, tokenizer, and weight loading are CPU-safe.
|
| 66 |
+
|
| 67 |
+
## Intended use
|
| 68 |
+
|
| 69 |
+
- **Base checkpoints (`CENO-*`)** — genomic-sequence generation and embedding extraction;
|
| 70 |
+
downstream adaptation (fine-tuning, probing) for genomics tasks.
|
| 71 |
+
- **MSA checkpoints (`CENO-P-*`)** — variant effect prediction (VEP) by scoring wild-type
|
| 72 |
+
vs. variant sequences with delta log-likelihood. See the TraitGym VEP example in the
|
| 73 |
+
[CENO code repository](https://github.com/CladeTeam/CENO).
|
| 74 |
+
|
| 75 |
+
## License
|
| 76 |
+
|
| 77 |
+
Apache-2.0. The bundled model code is derived from NVIDIA's Nemotron-H Hugging Face
|
| 78 |
+
implementation (Apache-2.0); the tokenizer is derived from the Arc Institute Evo2
|
| 79 |
+
`CharLevelTokenizer` (Apache-2.0). See the `LICENSE` and `NOTICE` files in this repository
|
| 80 |
+
for full attribution.
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
<!-- CENO_INFERENCE_CURRENT -->
|
| 84 |
+
## Current inference implementation
|
| 85 |
+
|
| 86 |
+
Current source and usage instructions
|
| 87 |
+
are maintained at [CladeTeam/CENO](https://github.com/CladeTeam/CENO).
|
| 88 |
+
|
| 89 |
+
Loading
|
| 90 |
+
uses the checkpoint dtype by default; explicit caller dtype overrides are honored.
|
| 91 |
+
Use `torch_dtype="auto"`, `.cuda().eval()` and `torch.inference_mode()` for raw
|
| 92 |
+
forward calls. `generate()` enters no-grad mode automatically.
|
| 93 |
+
|
| 94 |
+
The HF precision path is single-GPU, unpadded, and permits at most 131072 tokens
|
| 95 |
+
per prefill. Use the repository's vLLM entry for larger prefills.
|
| 96 |
+
|
| 97 |
+
The tested HF stack is PyTorch 2.7.0a0 (NVIDIA 25.03), Transformers 4.48.3,
|
| 98 |
+
mamba-ssm 2.2.4, causal-conv1d 1.2.2.post1 and FlashAttention 2.7.3. HF and vLLM
|
| 99 |
+
use separate environments. Numerical correctness is not a guarantee of
|
| 100 |
+
repetition-free or biologically functional generation.
|
| 101 |
+
<!-- /CENO_INFERENCE_CURRENT -->
|
ceno_cp_math.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPDX-License-Identifier: Apache-2.0
|
| 2 |
+
# NVIDIA TransformerEngine abbdd76 CP attention arithmetic, Triton adaptation.
|
| 3 |
+
import torch
|
| 4 |
+
import triton
|
| 5 |
+
import triton.language as tl
|
| 6 |
+
from triton.language.extra.cuda import libdevice
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
@triton.jit
|
| 10 |
+
def _lse_add(Total, Part, T: tl.constexpr, FULL: tl.constexpr,
|
| 11 |
+
OFFSET: tl.constexpr, H: tl.constexpr, BLOCK: tl.constexpr):
|
| 12 |
+
off=tl.program_id(0)*BLOCK+tl.arange(0,BLOCK)
|
| 13 |
+
head=off//T;row=off%T;mask=off<H*T
|
| 14 |
+
ptr=Total+head*FULL+row+OFFSET
|
| 15 |
+
total=tl.load(ptr,mask=mask,other=0)
|
| 16 |
+
part=tl.load(Part+off,mask=mask,other=0).to(tl.float64)
|
| 17 |
+
hi=tl.maximum(total,part);lo=tl.minimum(total,part)
|
| 18 |
+
value=hi+libdevice.log1p(libdevice.exp(lo-hi))
|
| 19 |
+
tl.store(ptr,value,mask=mask)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
@triton.jit
|
| 23 |
+
def _merge(Out,Part,Total,Lse,N:tl.constexpr,T:tl.constexpr,FULL:tl.constexpr,
|
| 24 |
+
OFFSET:tl.constexpr,ADD:tl.constexpr,H:tl.constexpr,D:tl.constexpr,
|
| 25 |
+
BLOCK:tl.constexpr):
|
| 26 |
+
off=tl.program_id(0)*BLOCK+tl.arange(0,BLOCK)
|
| 27 |
+
row=off//(H*D);head=(off//D)%H;mask=off<N
|
| 28 |
+
total=tl.load(Total+head*FULL+row+OFFSET,mask=mask,other=0)
|
| 29 |
+
lse=tl.load(Lse+head*T+row,mask=mask,other=0)
|
| 30 |
+
# TE's Torch 2.7 compiled kernel uses approximate exp and fused add/multiply.
|
| 31 |
+
# Current Torch's eager/compiled exp does not reproduce this BF16 rounding.
|
| 32 |
+
weight=tl.exp(lse-total)
|
| 33 |
+
value=tl.load(Part+off,mask=mask,other=0).to(tl.float32)
|
| 34 |
+
dest=Out+OFFSET*H*D+off
|
| 35 |
+
if ADD:
|
| 36 |
+
old=tl.load(dest,mask=mask,other=0).to(tl.float32)
|
| 37 |
+
result=tl.fma(value,weight,old)
|
| 38 |
+
else:result=value*weight
|
| 39 |
+
tl.store(dest,result,mask=mask)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def combine(parts, offsets):
|
| 43 |
+
"""Merge in ring order; every output update is stored back to BF16."""
|
| 44 |
+
first,lse=parts[0];length,h,d=first.shape
|
| 45 |
+
total=lse.double().clone()
|
| 46 |
+
for (_,part),offset in zip(parts[1:],offsets[1:]):
|
| 47 |
+
_lse_add[(triton.cdiv(part.numel(),256),)](
|
| 48 |
+
total,part,part.shape[1],length,offset,h,256,enable_fp_fusion=False)
|
| 49 |
+
total=total.float();out=torch.empty_like(first)
|
| 50 |
+
for i,((value,part),offset) in enumerate(zip(parts,offsets)):
|
| 51 |
+
_merge[(triton.cdiv(value.numel(),1024),)](
|
| 52 |
+
out,value,total,part,value.numel(),len(value),length,offset,i>0,h,d,1024,
|
| 53 |
+
enable_fp_fusion=False)
|
| 54 |
+
return out
|
ceno_norm.py
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPDX-License-Identifier: Apache-2.0
|
| 2 |
+
# Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
| 3 |
+
# CENO Triton adaptation of TransformerEngine abbdd76 RMSNorm reduction order.
|
| 4 |
+
"""Explicit, batch-independent TE RMSNorm arithmetic for BF16 CENO widths 512/1024.
|
| 5 |
+
|
| 6 |
+
The training TE build chooses two reduction algorithms according to row count.
|
| 7 |
+
Keep that choice explicit: ``te-general`` reproduces the original 5385-row
|
| 8 |
+
reference; ``te-tuned`` reproduces the aligned training-shaped kernel. Never
|
| 9 |
+
switch based on a serving batch's size. This is not a generic TE replacement.
|
| 10 |
+
|
| 11 |
+
Source: NVIDIA/TransformerEngine@abbdd76, common/normalization/rmsnorm.
|
| 12 |
+
See third_party/TransformerEngine-LICENSE for the upstream Apache-2.0 license.
|
| 13 |
+
"""
|
| 14 |
+
|
| 15 |
+
import torch
|
| 16 |
+
import triton
|
| 17 |
+
import triton.language as tl
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
@triton.jit
|
| 21 |
+
def _xor(value, offset: tl.constexpr):
|
| 22 |
+
# One warp owns one row. Changing num_warps/layout changes this reduction.
|
| 23 |
+
return tl.inline_asm_elementwise(
|
| 24 |
+
"shfl.sync.bfly.b32 $0, $1, $2, 31, -1;",
|
| 25 |
+
constraints="=f,f,r",
|
| 26 |
+
args=[value, offset],
|
| 27 |
+
dtype=tl.float32,
|
| 28 |
+
is_pure=True,
|
| 29 |
+
pack=1,
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
@triton.jit
|
| 34 |
+
def _te_norm(X, W, Y, EPS: tl.constexpr, TUNED: tl.constexpr, WIDTH: tl.constexpr):
|
| 35 |
+
row = tl.program_id(0)
|
| 36 |
+
lanes = tl.arange(0, 32)
|
| 37 |
+
mean = tl.full((32,), 0, tl.float32)
|
| 38 |
+
if TUNED:
|
| 39 |
+
for i in tl.static_range(WIDTH // 32):
|
| 40 |
+
cols = lanes * 8 + (i // 8) * 256 + i % 8
|
| 41 |
+
mean = mean + tl.load(X + row * WIDTH + cols).to(tl.float32)
|
| 42 |
+
for offset in tl.static_range(5):
|
| 43 |
+
mean = mean + _xor(mean, 1 << offset)
|
| 44 |
+
mean = mean * (1.0 / WIDTH)
|
| 45 |
+
variance = tl.full((32,), 0, tl.float32)
|
| 46 |
+
for i in tl.static_range(WIDTH // 32):
|
| 47 |
+
cols = lanes * 8 + (i // 8) * 256 + i % 8
|
| 48 |
+
x = tl.load(X + row * WIDTH + cols).to(tl.float32)
|
| 49 |
+
delta = x - mean if TUNED else x
|
| 50 |
+
variance = tl.fma(delta, delta, variance)
|
| 51 |
+
for offset in tl.static_range(5):
|
| 52 |
+
variance = variance + _xor(variance, 1 << offset)
|
| 53 |
+
moment = variance * (1.0 / WIDTH)
|
| 54 |
+
if TUNED:
|
| 55 |
+
moment = tl.fma(mean, mean, moment)
|
| 56 |
+
scale = tl.rsqrt(moment + EPS)
|
| 57 |
+
for i in tl.static_range(WIDTH // 32):
|
| 58 |
+
cols = lanes * 8 + (i // 8) * 256 + i % 8
|
| 59 |
+
x = tl.load(X + row * WIDTH + cols).to(tl.float32)
|
| 60 |
+
weight = tl.load(W + cols).to(tl.float32)
|
| 61 |
+
tl.store(Y + row * WIDTH + cols, (scale * x) * weight)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def _te_rms_norm_impl(
|
| 65 |
+
x: torch.Tensor, weight: torch.Tensor, epsilon: float, mode: str
|
| 66 |
+
) -> torch.Tensor:
|
| 67 |
+
if mode not in ("te-general", "te-tuned"):
|
| 68 |
+
raise ValueError(f"Unsupported TE RMSNorm mode: {mode}")
|
| 69 |
+
if (
|
| 70 |
+
not x.is_cuda
|
| 71 |
+
or x.dtype != torch.bfloat16
|
| 72 |
+
or x.shape[-1] not in (512, 1024)
|
| 73 |
+
or weight.dtype != x.dtype
|
| 74 |
+
or weight.shape != (x.shape[-1],)
|
| 75 |
+
or weight.device != x.device
|
| 76 |
+
or epsilon <= 0
|
| 77 |
+
):
|
| 78 |
+
raise ValueError("TE RMSNorm requires CUDA BF16 width 512/1024 and a positive epsilon")
|
| 79 |
+
x, weight = x.contiguous(), weight.contiguous()
|
| 80 |
+
out = torch.empty_like(x)
|
| 81 |
+
rows = x.numel() // x.shape[-1]
|
| 82 |
+
if rows:
|
| 83 |
+
_te_norm[(rows,)](x, weight, out, epsilon, mode == "te-tuned", x.shape[-1], num_warps=1)
|
| 84 |
+
return out
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
def _te_rms_norm_fake(x, weight, epsilon, mode):
|
| 88 |
+
return torch.empty_like(x, memory_format=torch.contiguous_format)
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
# Multiple HF Hub repositories can import this file under different dynamic names.
|
| 92 |
+
# Register the shared operator once per process.
|
| 93 |
+
if hasattr(torch.ops.ceno, "te_rms_norm"):
|
| 94 |
+
te_rms_norm = torch.ops.ceno.te_rms_norm.default
|
| 95 |
+
else:
|
| 96 |
+
te_rms_norm = torch.library.custom_op("ceno::te_rms_norm", mutates_args=())(
|
| 97 |
+
_te_rms_norm_impl
|
| 98 |
+
)
|
| 99 |
+
te_rms_norm.register_fake(_te_rms_norm_fake)
|
ceno_tokenizer.py
ADDED
|
@@ -0,0 +1,571 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# coding=utf-8
|
| 2 |
+
# Copyright (c) 2025, Arc Institute. All rights reserved.
|
| 3 |
+
# Copyright (c) 2026, CENO 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 |
+
"""Byte-level (character-level) tokenizer for CENO."""
|
| 17 |
+
|
| 18 |
+
import json
|
| 19 |
+
import os
|
| 20 |
+
from typing import List, Optional, Tuple, Union, Dict, Any
|
| 21 |
+
import numpy as np
|
| 22 |
+
import torch
|
| 23 |
+
from transformers import PreTrainedTokenizer
|
| 24 |
+
from transformers.tokenization_utils_base import BatchEncoding
|
| 25 |
+
from transformers.utils import logging
|
| 26 |
+
|
| 27 |
+
logger = logging.get_logger(__name__)
|
| 28 |
+
|
| 29 |
+
VOCAB_FILES_NAMES = {"vocab_file": "vocab.json"}
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
class CENOCharLevelTokenizer(PreTrainedTokenizer):
|
| 33 |
+
"""
|
| 34 |
+
HuggingFace-style byte-level (character-level) tokenizer for CENO.
|
| 35 |
+
|
| 36 |
+
This tokenizer converts text directly to byte values using numpy's fromstring,
|
| 37 |
+
which is perfect for DNA sequences and other character-level tasks.
|
| 38 |
+
|
| 39 |
+
Args:
|
| 40 |
+
vocab_size (int): Size of the vocabulary (default: 512)
|
| 41 |
+
eos_token (str): End of sequence token
|
| 42 |
+
pad_token (str): Padding token
|
| 43 |
+
unk_token (str): Unknown token
|
| 44 |
+
**kwargs: Additional arguments passed to PreTrainedTokenizer
|
| 45 |
+
"""
|
| 46 |
+
|
| 47 |
+
vocab_files_names = VOCAB_FILES_NAMES
|
| 48 |
+
|
| 49 |
+
def __init__(
|
| 50 |
+
self,
|
| 51 |
+
vocab_size: int = 512,
|
| 52 |
+
eos_token: str = "<eos>",
|
| 53 |
+
pad_token: str = "<pad>",
|
| 54 |
+
unk_token: str = "<unk>",
|
| 55 |
+
**kwargs
|
| 56 |
+
):
|
| 57 |
+
self._vocab_size = vocab_size
|
| 58 |
+
self.eod_id = 0
|
| 59 |
+
self.eos_id = 0
|
| 60 |
+
self.pad_id = 1
|
| 61 |
+
self.unk_id = 2
|
| 62 |
+
|
| 63 |
+
# Build vocabulary - builds the CENO character mapping
|
| 64 |
+
self._vocab = self._build_vocab()
|
| 65 |
+
self._id_to_token = {v: k for k, v in self._vocab.items()}
|
| 66 |
+
|
| 67 |
+
super().__init__(
|
| 68 |
+
eos_token=eos_token,
|
| 69 |
+
pad_token=pad_token,
|
| 70 |
+
unk_token=unk_token,
|
| 71 |
+
**kwargs
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
def _build_vocab(self) -> Dict[str, int]:
|
| 75 |
+
"""Build vocabulary mapping characters to IDs"""
|
| 76 |
+
vocab = {}
|
| 77 |
+
|
| 78 |
+
# Add special tokens
|
| 79 |
+
vocab["<unk>"] = 2
|
| 80 |
+
vocab["<pad>"] = 1
|
| 81 |
+
vocab["<eos>"] = 0
|
| 82 |
+
|
| 83 |
+
# Add printable ASCII characters (32-126)
|
| 84 |
+
for i in range(32, min(127, self._vocab_size)):
|
| 85 |
+
vocab[chr(i)] = i
|
| 86 |
+
|
| 87 |
+
# Add extended byte values as special tokens
|
| 88 |
+
for i in range(127, self._vocab_size):
|
| 89 |
+
vocab[f"<byte_{i}>"] = i
|
| 90 |
+
|
| 91 |
+
return vocab
|
| 92 |
+
|
| 93 |
+
def clamp(self, n: int) -> int:
|
| 94 |
+
"""Clamp token ID to valid range, matching the CENO tokenizer implementation"""
|
| 95 |
+
return max(0, min(n, self._vocab_size - 1))
|
| 96 |
+
|
| 97 |
+
@property
|
| 98 |
+
def vocab_size(self) -> int:
|
| 99 |
+
"""Return vocabulary size"""
|
| 100 |
+
return self._vocab_size
|
| 101 |
+
|
| 102 |
+
def get_vocab(self) -> Dict[str, int]:
|
| 103 |
+
"""Return vocabulary dictionary"""
|
| 104 |
+
return self._vocab.copy()
|
| 105 |
+
|
| 106 |
+
def _tokenize(self, text: str) -> List[int]:
|
| 107 |
+
"""
|
| 108 |
+
Tokenize text using numpy's fromstring (byte-level tokenization).
|
| 109 |
+
Byte-level tokenization: text is converted directly to its ASCII byte IDs.
|
| 110 |
+
"""
|
| 111 |
+
# Convert text to byte array using numpy (matches the CENO implementation)
|
| 112 |
+
token_ids = np.frombuffer(text.encode("utf-8"), dtype=np.uint8).tolist()
|
| 113 |
+
return token_ids
|
| 114 |
+
|
| 115 |
+
def _convert_token_to_id(self, token: Union[str, int]) -> int:
|
| 116 |
+
"""Convert token to ID"""
|
| 117 |
+
if isinstance(token, int):
|
| 118 |
+
return self.clamp(token)
|
| 119 |
+
|
| 120 |
+
# Handle string tokens
|
| 121 |
+
if token in self._vocab:
|
| 122 |
+
return self._vocab[token]
|
| 123 |
+
|
| 124 |
+
# Handle single characters
|
| 125 |
+
if len(token) == 1:
|
| 126 |
+
return self.clamp(ord(token))
|
| 127 |
+
|
| 128 |
+
# Handle byte tokens
|
| 129 |
+
if token.startswith("<byte_") and token.endswith(">"):
|
| 130 |
+
try:
|
| 131 |
+
byte_val = int(token[6:-1])
|
| 132 |
+
return self.clamp(byte_val)
|
| 133 |
+
except ValueError:
|
| 134 |
+
pass
|
| 135 |
+
|
| 136 |
+
# Return unknown token ID
|
| 137 |
+
return self._vocab.get(self.unk_token, 0)
|
| 138 |
+
|
| 139 |
+
def _convert_id_to_token(self, index: int) -> str:
|
| 140 |
+
"""Convert ID to token, CENO decode-token behavior"""
|
| 141 |
+
clamped_index = self.clamp(index)
|
| 142 |
+
|
| 143 |
+
# Handle special cases before interpreting byte values.
|
| 144 |
+
if clamped_index == self.eos_id:
|
| 145 |
+
return self.eos_token
|
| 146 |
+
if clamped_index == self.pad_id:
|
| 147 |
+
return self.pad_token
|
| 148 |
+
if clamped_index == self.unk_id:
|
| 149 |
+
return self.unk_token
|
| 150 |
+
|
| 151 |
+
# Convert to character if in printable range
|
| 152 |
+
if 32 <= clamped_index <= 126:
|
| 153 |
+
return chr(clamped_index)
|
| 154 |
+
|
| 155 |
+
# Return byte token for extended range
|
| 156 |
+
return f"<byte_{clamped_index}>"
|
| 157 |
+
|
| 158 |
+
def convert_tokens_to_string(self, tokens: List[str]) -> str:
|
| 159 |
+
"""Convert tokens back to string"""
|
| 160 |
+
result = []
|
| 161 |
+
for token in tokens:
|
| 162 |
+
if token in [self.pad_token, self.eos_token, self.unk_token]:
|
| 163 |
+
continue
|
| 164 |
+
elif token.startswith("<byte_") and token.endswith(">"):
|
| 165 |
+
try:
|
| 166 |
+
byte_val = int(token[6:-1])
|
| 167 |
+
result.append(chr(self.clamp(byte_val)))
|
| 168 |
+
except (ValueError, OverflowError):
|
| 169 |
+
continue
|
| 170 |
+
else:
|
| 171 |
+
result.append(token)
|
| 172 |
+
return "".join(result)
|
| 173 |
+
|
| 174 |
+
def tokenize(self, text: str, **kwargs) -> List[str]:
|
| 175 |
+
"""
|
| 176 |
+
Tokenize text and return string tokens.
|
| 177 |
+
This wraps the numeric tokenization for HuggingFace compatibility.
|
| 178 |
+
"""
|
| 179 |
+
# Get numeric tokens
|
| 180 |
+
numeric_tokens = self._tokenize(text)
|
| 181 |
+
|
| 182 |
+
# Convert to string tokens
|
| 183 |
+
string_tokens = [self._convert_id_to_token(token_id) for token_id in numeric_tokens]
|
| 184 |
+
|
| 185 |
+
return string_tokens
|
| 186 |
+
|
| 187 |
+
def encode(
|
| 188 |
+
self,
|
| 189 |
+
text: str,
|
| 190 |
+
add_special_tokens: bool = True,
|
| 191 |
+
padding: bool = False,
|
| 192 |
+
truncation: bool = False,
|
| 193 |
+
max_length: Optional[int] = None,
|
| 194 |
+
return_tensors: Optional[str] = None,
|
| 195 |
+
**kwargs
|
| 196 |
+
) -> Union[List[int], torch.Tensor]:
|
| 197 |
+
"""
|
| 198 |
+
Encode text to token IDs.
|
| 199 |
+
Core tokenization functionality of the CENO byte-level tokenizer.
|
| 200 |
+
"""
|
| 201 |
+
# Tokenize to get numeric IDs directly
|
| 202 |
+
token_ids = self._tokenize(text)
|
| 203 |
+
|
| 204 |
+
# Handle truncation
|
| 205 |
+
if truncation and max_length is not None:
|
| 206 |
+
token_ids = token_ids[:max_length]
|
| 207 |
+
|
| 208 |
+
# Handle padding
|
| 209 |
+
if padding and max_length is not None:
|
| 210 |
+
if len(token_ids) < max_length:
|
| 211 |
+
token_ids.extend([self.pad_id] * (max_length - len(token_ids)))
|
| 212 |
+
|
| 213 |
+
# Convert to tensors if requested
|
| 214 |
+
if return_tensors == "pt":
|
| 215 |
+
return torch.tensor([token_ids], dtype=torch.long)
|
| 216 |
+
elif return_tensors == "np":
|
| 217 |
+
return np.array([token_ids], dtype=np.int64)
|
| 218 |
+
|
| 219 |
+
return token_ids
|
| 220 |
+
|
| 221 |
+
def decode(
|
| 222 |
+
self,
|
| 223 |
+
token_ids: Union[List[int], torch.Tensor, np.ndarray],
|
| 224 |
+
skip_special_tokens: bool = False,
|
| 225 |
+
clean_up_tokenization_spaces: bool = True,
|
| 226 |
+
**kwargs
|
| 227 |
+
) -> str:
|
| 228 |
+
"""
|
| 229 |
+
Decode token IDs back to text.
|
| 230 |
+
CENO detokenization.
|
| 231 |
+
"""
|
| 232 |
+
# Convert to list if tensor or numpy array
|
| 233 |
+
if isinstance(token_ids, torch.Tensor):
|
| 234 |
+
token_ids = token_ids.tolist()
|
| 235 |
+
elif isinstance(token_ids, np.ndarray):
|
| 236 |
+
token_ids = token_ids.tolist()
|
| 237 |
+
|
| 238 |
+
# Convert IDs to tokens
|
| 239 |
+
tokens = [self._convert_id_to_token(token_id) for token_id in token_ids]
|
| 240 |
+
|
| 241 |
+
# Filter special tokens if requested
|
| 242 |
+
if skip_special_tokens:
|
| 243 |
+
tokens = [
|
| 244 |
+
token for token in tokens
|
| 245 |
+
if token not in [self.pad_token, self.eos_token, self.unk_token]
|
| 246 |
+
]
|
| 247 |
+
|
| 248 |
+
# Convert tokens to string
|
| 249 |
+
return self.convert_tokens_to_string(tokens)
|
| 250 |
+
|
| 251 |
+
def batch_encode_plus(
|
| 252 |
+
self,
|
| 253 |
+
batch_text_or_text_pairs: Union[List[str], List[Tuple[str, str]]],
|
| 254 |
+
add_special_tokens: bool = True,
|
| 255 |
+
padding: bool = False,
|
| 256 |
+
truncation: bool = False,
|
| 257 |
+
max_length: Optional[int] = None,
|
| 258 |
+
return_tensors: Optional[str] = None,
|
| 259 |
+
**kwargs
|
| 260 |
+
) -> BatchEncoding:
|
| 261 |
+
"""Batch encode multiple texts"""
|
| 262 |
+
batch_outputs = []
|
| 263 |
+
|
| 264 |
+
for text in batch_text_or_text_pairs:
|
| 265 |
+
if isinstance(text, tuple):
|
| 266 |
+
# Handle text pairs (not typically used for DNA sequences)
|
| 267 |
+
text = text[0] # Just use first text for now
|
| 268 |
+
|
| 269 |
+
encoded = self.encode(
|
| 270 |
+
text,
|
| 271 |
+
add_special_tokens=add_special_tokens,
|
| 272 |
+
padding=False, # We'll handle padding after
|
| 273 |
+
truncation=truncation,
|
| 274 |
+
max_length=max_length,
|
| 275 |
+
return_tensors=None,
|
| 276 |
+
)
|
| 277 |
+
batch_outputs.append(encoded)
|
| 278 |
+
|
| 279 |
+
# Handle batch padding
|
| 280 |
+
if padding and max_length is not None:
|
| 281 |
+
max_len = max_length
|
| 282 |
+
elif padding:
|
| 283 |
+
max_len = max(len(output) for output in batch_outputs)
|
| 284 |
+
else:
|
| 285 |
+
max_len = None
|
| 286 |
+
|
| 287 |
+
if max_len is not None:
|
| 288 |
+
for i, output in enumerate(batch_outputs):
|
| 289 |
+
if len(output) < max_len:
|
| 290 |
+
batch_outputs[i] = output + [self.pad_id] * (max_len - len(output))
|
| 291 |
+
elif len(output) > max_len:
|
| 292 |
+
batch_outputs[i] = output[:max_len]
|
| 293 |
+
|
| 294 |
+
# Convert to tensors if requested
|
| 295 |
+
if return_tensors == "pt":
|
| 296 |
+
batch_outputs = torch.tensor(batch_outputs, dtype=torch.long)
|
| 297 |
+
elif return_tensors == "np":
|
| 298 |
+
batch_outputs = np.array(batch_outputs)
|
| 299 |
+
|
| 300 |
+
return BatchEncoding({"input_ids": batch_outputs})
|
| 301 |
+
|
| 302 |
+
def batch_decode(
|
| 303 |
+
self,
|
| 304 |
+
sequences: Union[List[List[int]], torch.Tensor, np.ndarray],
|
| 305 |
+
skip_special_tokens: bool = False,
|
| 306 |
+
clean_up_tokenization_spaces: bool = True,
|
| 307 |
+
**kwargs
|
| 308 |
+
) -> List[str]:
|
| 309 |
+
"""Batch decode multiple sequences"""
|
| 310 |
+
# Convert to list format
|
| 311 |
+
if isinstance(sequences, torch.Tensor):
|
| 312 |
+
sequences = sequences.tolist()
|
| 313 |
+
elif isinstance(sequences, np.ndarray):
|
| 314 |
+
sequences = sequences.tolist()
|
| 315 |
+
|
| 316 |
+
return [
|
| 317 |
+
self.decode(
|
| 318 |
+
sequence,
|
| 319 |
+
skip_special_tokens=skip_special_tokens,
|
| 320 |
+
clean_up_tokenization_spaces=clean_up_tokenization_spaces,
|
| 321 |
+
**kwargs
|
| 322 |
+
)
|
| 323 |
+
for sequence in sequences
|
| 324 |
+
]
|
| 325 |
+
|
| 326 |
+
def save_pretrained(
|
| 327 |
+
self,
|
| 328 |
+
save_directory: str,
|
| 329 |
+
legacy_format: Optional[bool] = None,
|
| 330 |
+
filename_prefix: Optional[str] = None,
|
| 331 |
+
push_to_hub: bool = False,
|
| 332 |
+
**kwargs
|
| 333 |
+
) -> Tuple[str]:
|
| 334 |
+
"""
|
| 335 |
+
Save the tokenizer to a directory.
|
| 336 |
+
|
| 337 |
+
Args:
|
| 338 |
+
save_directory (str): Directory to save the tokenizer
|
| 339 |
+
legacy_format (bool, optional): Whether to save in legacy format
|
| 340 |
+
filename_prefix (str, optional): Prefix for filenames
|
| 341 |
+
push_to_hub (bool): Whether to push to HuggingFace Hub
|
| 342 |
+
**kwargs: Additional arguments
|
| 343 |
+
|
| 344 |
+
Returns:
|
| 345 |
+
Tuple[str]: Tuple of saved file paths
|
| 346 |
+
"""
|
| 347 |
+
if not os.path.isdir(save_directory):
|
| 348 |
+
os.makedirs(save_directory, exist_ok=True)
|
| 349 |
+
|
| 350 |
+
# Save vocabulary
|
| 351 |
+
vocab_file = os.path.join(
|
| 352 |
+
save_directory,
|
| 353 |
+
(filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
|
| 354 |
+
)
|
| 355 |
+
|
| 356 |
+
with open(vocab_file, "w", encoding="utf-8") as f:
|
| 357 |
+
f.write(json.dumps(self._vocab, indent=2, sort_keys=True, ensure_ascii=False) + "\n")
|
| 358 |
+
|
| 359 |
+
# Save tokenizer configuration
|
| 360 |
+
config_file = os.path.join(
|
| 361 |
+
save_directory,
|
| 362 |
+
(filename_prefix + "-" if filename_prefix else "") + "tokenizer_config.json"
|
| 363 |
+
)
|
| 364 |
+
|
| 365 |
+
tokenizer_config = {
|
| 366 |
+
"tokenizer_class": "CENOCharLevelTokenizer",
|
| 367 |
+
"vocab_size": self._vocab_size,
|
| 368 |
+
"eos_token": self.eos_token,
|
| 369 |
+
"pad_token": self.pad_token,
|
| 370 |
+
"unk_token": self.unk_token,
|
| 371 |
+
"eod_id": self.eod_id,
|
| 372 |
+
"eos_id": self.eos_id,
|
| 373 |
+
"pad_id": self.pad_id,
|
| 374 |
+
"model_max_length": getattr(self, 'model_max_length', 1000000),
|
| 375 |
+
"clean_up_tokenization_spaces": True,
|
| 376 |
+
"tokenize_chinese_chars": False,
|
| 377 |
+
"strip_accents": None,
|
| 378 |
+
"do_lower_case": False,
|
| 379 |
+
"do_basic_tokenize": False,
|
| 380 |
+
"never_split": None,
|
| 381 |
+
"tokenizer_type": "CharLevelTokenizer",
|
| 382 |
+
"name_or_path": save_directory,
|
| 383 |
+
}
|
| 384 |
+
|
| 385 |
+
with open(config_file, "w", encoding="utf-8") as f:
|
| 386 |
+
json.dump(tokenizer_config, f, indent=2, ensure_ascii=False)
|
| 387 |
+
|
| 388 |
+
# Save special tokens map
|
| 389 |
+
special_tokens_file = os.path.join(
|
| 390 |
+
save_directory,
|
| 391 |
+
(filename_prefix + "-" if filename_prefix else "") + "special_tokens_map.json"
|
| 392 |
+
)
|
| 393 |
+
|
| 394 |
+
special_tokens_map = {
|
| 395 |
+
"eos_token": self.eos_token,
|
| 396 |
+
"pad_token": self.pad_token,
|
| 397 |
+
"unk_token": self.unk_token,
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
with open(special_tokens_file, "w", encoding="utf-8") as f:
|
| 401 |
+
json.dump(special_tokens_map, f, indent=2, ensure_ascii=False)
|
| 402 |
+
|
| 403 |
+
logger.info(f"Tokenizer saved to {save_directory}")
|
| 404 |
+
|
| 405 |
+
return (vocab_file, config_file, special_tokens_file)
|
| 406 |
+
|
| 407 |
+
@classmethod
|
| 408 |
+
def from_pretrained(
|
| 409 |
+
cls,
|
| 410 |
+
pretrained_model_name_or_path: Union[str, os.PathLike],
|
| 411 |
+
cache_dir: Optional[str] = None,
|
| 412 |
+
force_download: bool = False,
|
| 413 |
+
local_files_only: bool = False,
|
| 414 |
+
token: Optional[str] = None,
|
| 415 |
+
revision: str = "main",
|
| 416 |
+
**kwargs
|
| 417 |
+
):
|
| 418 |
+
"""
|
| 419 |
+
Load a tokenizer from a pretrained model.
|
| 420 |
+
|
| 421 |
+
Args:
|
| 422 |
+
pretrained_model_name_or_path (str): Path to directory containing tokenizer files
|
| 423 |
+
or name of a model on HuggingFace Hub
|
| 424 |
+
cache_dir (str, optional): Directory to cache downloaded files
|
| 425 |
+
force_download (bool): Whether to force download even if cached
|
| 426 |
+
local_files_only (bool): Whether to only use local files
|
| 427 |
+
token (str, optional): HuggingFace access token
|
| 428 |
+
revision (str): Model revision to use
|
| 429 |
+
**kwargs: Additional arguments
|
| 430 |
+
|
| 431 |
+
Returns:
|
| 432 |
+
CENOCharLevelTokenizer: Loaded tokenizer instance
|
| 433 |
+
"""
|
| 434 |
+
# Handle local directory
|
| 435 |
+
if os.path.isdir(pretrained_model_name_or_path):
|
| 436 |
+
model_path = pretrained_model_name_or_path
|
| 437 |
+
else:
|
| 438 |
+
# Try to download from HuggingFace Hub
|
| 439 |
+
try:
|
| 440 |
+
from huggingface_hub import snapshot_download
|
| 441 |
+
|
| 442 |
+
model_path = snapshot_download(
|
| 443 |
+
repo_id=pretrained_model_name_or_path,
|
| 444 |
+
cache_dir=cache_dir,
|
| 445 |
+
force_download=force_download,
|
| 446 |
+
local_files_only=local_files_only,
|
| 447 |
+
token=token,
|
| 448 |
+
revision=revision,
|
| 449 |
+
)
|
| 450 |
+
except ImportError:
|
| 451 |
+
raise ImportError(
|
| 452 |
+
"huggingface_hub is required to download models from the Hub. "
|
| 453 |
+
"Install it with: pip install huggingface_hub"
|
| 454 |
+
)
|
| 455 |
+
except Exception as e:
|
| 456 |
+
logger.warning(f"Failed to download from HuggingFace Hub: {e}")
|
| 457 |
+
logger.warning("Falling back to local initialization...")
|
| 458 |
+
return cls(**kwargs)
|
| 459 |
+
|
| 460 |
+
# Load tokenizer configuration
|
| 461 |
+
config_file = os.path.join(model_path, "tokenizer_config.json")
|
| 462 |
+
config = {}
|
| 463 |
+
|
| 464 |
+
if os.path.exists(config_file):
|
| 465 |
+
with open(config_file, "r", encoding="utf-8") as f:
|
| 466 |
+
config = json.load(f)
|
| 467 |
+
logger.info(f"Loaded tokenizer config from {config_file}")
|
| 468 |
+
|
| 469 |
+
# Load special tokens map
|
| 470 |
+
special_tokens_file = os.path.join(model_path, "special_tokens_map.json")
|
| 471 |
+
special_tokens = {}
|
| 472 |
+
|
| 473 |
+
if os.path.exists(special_tokens_file):
|
| 474 |
+
with open(special_tokens_file, "r", encoding="utf-8") as f:
|
| 475 |
+
special_tokens = json.load(f)
|
| 476 |
+
logger.info(f"Loaded special tokens from {special_tokens_file}")
|
| 477 |
+
|
| 478 |
+
# Load vocabulary
|
| 479 |
+
vocab_file = os.path.join(model_path, VOCAB_FILES_NAMES["vocab_file"])
|
| 480 |
+
vocab = None
|
| 481 |
+
|
| 482 |
+
if os.path.exists(vocab_file):
|
| 483 |
+
with open(vocab_file, "r", encoding="utf-8") as f:
|
| 484 |
+
vocab = json.load(f)
|
| 485 |
+
logger.info(f"Loaded vocabulary from {vocab_file}")
|
| 486 |
+
|
| 487 |
+
# Merge configurations (kwargs override file config)
|
| 488 |
+
init_kwargs = {
|
| 489 |
+
"vocab_size": config.get("vocab_size", 512),
|
| 490 |
+
"eos_token": special_tokens.get("eos_token", config.get("eos_token", "<eos>")),
|
| 491 |
+
"pad_token": special_tokens.get("pad_token", config.get("pad_token", "<pad>")),
|
| 492 |
+
"unk_token": special_tokens.get("unk_token", config.get("unk_token", "<unk>")),
|
| 493 |
+
}
|
| 494 |
+
|
| 495 |
+
# Override with any provided kwargs
|
| 496 |
+
init_kwargs.update(kwargs)
|
| 497 |
+
|
| 498 |
+
# Create tokenizer instance
|
| 499 |
+
tokenizer = cls(**init_kwargs)
|
| 500 |
+
|
| 501 |
+
# Load custom vocabulary if available
|
| 502 |
+
if vocab is not None:
|
| 503 |
+
tokenizer._vocab = vocab
|
| 504 |
+
tokenizer._id_to_token = {v: k for k, v in vocab.items()}
|
| 505 |
+
logger.info("Loaded custom vocabulary")
|
| 506 |
+
|
| 507 |
+
# Set additional attributes from config
|
| 508 |
+
if config:
|
| 509 |
+
tokenizer.eod_id = config.get("eod_id", 0)
|
| 510 |
+
tokenizer.eos_id = config.get("eos_id", 0)
|
| 511 |
+
tokenizer.pad_id = config.get("pad_id", 1)
|
| 512 |
+
if hasattr(tokenizer, 'model_max_length'):
|
| 513 |
+
tokenizer.model_max_length = config.get("model_max_length", 1000000)
|
| 514 |
+
|
| 515 |
+
tokenizer.name_or_path = pretrained_model_name_or_path
|
| 516 |
+
logger.info(f"Successfully loaded tokenizer from {pretrained_model_name_or_path}")
|
| 517 |
+
|
| 518 |
+
return tokenizer
|
| 519 |
+
|
| 520 |
+
def save_vocabulary(self, save_directory: str, filename_prefix: Optional[str] = None) -> Tuple[str]:
|
| 521 |
+
"""Save vocabulary to file (legacy method)"""
|
| 522 |
+
if not os.path.isdir(save_directory):
|
| 523 |
+
logger.error(f"Vocabulary path ({save_directory}) should be a directory")
|
| 524 |
+
return
|
| 525 |
+
|
| 526 |
+
vocab_file = os.path.join(
|
| 527 |
+
save_directory,
|
| 528 |
+
(filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
|
| 529 |
+
)
|
| 530 |
+
|
| 531 |
+
with open(vocab_file, "w", encoding="utf-8") as f:
|
| 532 |
+
f.write(json.dumps(self._vocab, indent=2, sort_keys=True, ensure_ascii=False) + "\n")
|
| 533 |
+
|
| 534 |
+
return (vocab_file,)
|
| 535 |
+
|
| 536 |
+
@property
|
| 537 |
+
def unique_identifiers(self) -> Dict[str,Any]:
|
| 538 |
+
"""
|
| 539 |
+
Megatron will call .unique_identifiers when it encounters
|
| 540 |
+
this object during its JSON‐dump of the dataset config.
|
| 541 |
+
Must be JSON-serializable.
|
| 542 |
+
"""
|
| 543 |
+
return {
|
| 544 |
+
"tokenizer_class": self.__class__.__name__,
|
| 545 |
+
"name_or_path": getattr(self, "name_or_path", None),
|
| 546 |
+
"vocab_size": self.vocab_size,
|
| 547 |
+
}
|
| 548 |
+
# Compatibility methods for the CENO tokenizer interface
|
| 549 |
+
def tokenize_batch(self, text_batch: Union[List[str], str]) -> Union[List[List[int]], List[int]]:
|
| 550 |
+
"""Batch tokenization matching the CENO tokenizer interface"""
|
| 551 |
+
if isinstance(text_batch, str):
|
| 552 |
+
return self._tokenize(text_batch)
|
| 553 |
+
return [self._tokenize(text) for text in text_batch]
|
| 554 |
+
|
| 555 |
+
def detokenize(self, token_ids: Union[List[int], torch.Tensor]) -> str:
|
| 556 |
+
"""Alias for decode method matching the CENO tokenizer interface"""
|
| 557 |
+
return self.decode(token_ids, skip_special_tokens=True)
|
| 558 |
+
|
| 559 |
+
def detokenize_batch(self, token_ids_batch: Union[List[List[int]], torch.Tensor]) -> List[str]:
|
| 560 |
+
"""Batch detokenization matching the CENO tokenizer interface"""
|
| 561 |
+
return self.batch_decode(token_ids_batch, skip_special_tokens=True)
|
| 562 |
+
|
| 563 |
+
@property
|
| 564 |
+
def eod(self) -> int:
|
| 565 |
+
"""End of document token ID"""
|
| 566 |
+
return self.eod_id
|
| 567 |
+
|
| 568 |
+
@property
|
| 569 |
+
def eos(self) -> int:
|
| 570 |
+
"""End of sequence token ID"""
|
| 571 |
+
return self.eos_id
|
config.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"CENOForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"attention_head_dim": null,
|
| 8 |
+
"auto_map": {
|
| 9 |
+
"AutoConfig": "configuration_ceno.CENOConfig",
|
| 10 |
+
"AutoModelForCausalLM": "modeling_ceno.CENOForCausalLM",
|
| 11 |
+
"AutoTokenizer": [
|
| 12 |
+
"ceno_tokenizer.CENOCharLevelTokenizer",
|
| 13 |
+
null
|
| 14 |
+
]
|
| 15 |
+
},
|
| 16 |
+
"bos_token_id": 0,
|
| 17 |
+
"chunk_size": 128,
|
| 18 |
+
"conv_kernel": 4,
|
| 19 |
+
"eos_token_id": 0,
|
| 20 |
+
"expand": 2,
|
| 21 |
+
"head_dim": 128,
|
| 22 |
+
"hidden_dropout": 0.0,
|
| 23 |
+
"hidden_size": 2560,
|
| 24 |
+
"hybrid_override_pattern": "MEMEMEME*EMEMEMEM*MEMEMEME*EMEMEME*MEMEMEM",
|
| 25 |
+
"initializer_range": 0.02,
|
| 26 |
+
"intermediate_size": 10240,
|
| 27 |
+
"layer_norm_epsilon": 1e-05,
|
| 28 |
+
"mamba_head_dim": 64,
|
| 29 |
+
"mamba_hidden_act": "silu",
|
| 30 |
+
"mamba_in_proj_layernorm": true,
|
| 31 |
+
"mamba_num_heads": 80,
|
| 32 |
+
"mamba_proj_bias": false,
|
| 33 |
+
"mamba_ssm_cache_dtype": "bfloat16",
|
| 34 |
+
"max_position_embeddings": 1048576,
|
| 35 |
+
"mlp_bias": false,
|
| 36 |
+
"mlp_fc1_layernorm": false,
|
| 37 |
+
"mlp_hidden_act": "relu2",
|
| 38 |
+
"mlp_use_swiglu": false,
|
| 39 |
+
"model_type": "ceno",
|
| 40 |
+
"moe_intermediate_size": 10240,
|
| 41 |
+
"moe_router_dtype": "bfloat16",
|
| 42 |
+
"moe_router_pre_softmax": false,
|
| 43 |
+
"moe_shared_expert_intermediate_size": 10240,
|
| 44 |
+
"moe_top_k": 2,
|
| 45 |
+
"n_group": 1,
|
| 46 |
+
"n_groups": 8,
|
| 47 |
+
"n_routed_experts": 8,
|
| 48 |
+
"n_shared_experts": 0,
|
| 49 |
+
"norm_topk_prob": true,
|
| 50 |
+
"num_attention_heads": 20,
|
| 51 |
+
"num_experts": 8,
|
| 52 |
+
"num_experts_per_tok": 2,
|
| 53 |
+
"num_hidden_layers": 42,
|
| 54 |
+
"num_key_value_heads": 20,
|
| 55 |
+
"num_logits_to_keep": 1,
|
| 56 |
+
"pad_token_id": 1,
|
| 57 |
+
"qkv_layernorm": true,
|
| 58 |
+
"rescale_prenorm_residual": true,
|
| 59 |
+
"residual_in_fp32": false,
|
| 60 |
+
"routed_scaling_factor": 1.0,
|
| 61 |
+
"sliding_window": null,
|
| 62 |
+
"ssm_state_size": 128,
|
| 63 |
+
"tie_word_embeddings": false,
|
| 64 |
+
"time_step_floor": 0.0001,
|
| 65 |
+
"time_step_limit": [
|
| 66 |
+
0.0,
|
| 67 |
+
1e+30
|
| 68 |
+
],
|
| 69 |
+
"time_step_max": 0.1,
|
| 70 |
+
"time_step_min": 0.001,
|
| 71 |
+
"topk_group": 1,
|
| 72 |
+
"torch_dtype": "bfloat16",
|
| 73 |
+
"transformers_version": "4.48.3",
|
| 74 |
+
"use_bias": false,
|
| 75 |
+
"use_cache": true,
|
| 76 |
+
"use_conv_bias": true,
|
| 77 |
+
"use_mamba_kernels": true,
|
| 78 |
+
"vocab_size": 512,
|
| 79 |
+
"ceno_training_precision": false,
|
| 80 |
+
"ceno_mamba_gate_in_ssm": true,
|
| 81 |
+
"ceno_rmsnorm_mode": "torch",
|
| 82 |
+
"ceno_reference_cp_size": 1,
|
| 83 |
+
"ceno_reference_context_length": null
|
| 84 |
+
}
|
configuration_ceno.py
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# coding=utf-8
|
| 2 |
+
# Copyright 2024 AI21 Labs Ltd. and the HuggingFace Inc. team. All rights reserved.
|
| 3 |
+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
|
| 4 |
+
# Copyright (c) 2026, CENO Team. All rights reserved.
|
| 5 |
+
#
|
| 6 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 7 |
+
# you may not use this file except in compliance with the License.
|
| 8 |
+
# You may obtain a copy of the License at
|
| 9 |
+
#
|
| 10 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 11 |
+
#
|
| 12 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 13 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 14 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 15 |
+
# See the License for the specific language governing permissions and
|
| 16 |
+
# limitations under the License.
|
| 17 |
+
"""CENO model configuration"""
|
| 18 |
+
|
| 19 |
+
import re
|
| 20 |
+
|
| 21 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 22 |
+
from transformers.utils import logging
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
logger = logging.get_logger(__name__)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
class CENOConfig(PretrainedConfig):
|
| 29 |
+
r"""
|
| 30 |
+
This is the configuration class to store the configuration of a [`CENOModel`]. It is used to instantiate a
|
| 31 |
+
CENO model according to the specified arguments, defining the model architecture. Instantiating a configuration
|
| 32 |
+
with the defaults will yield a similar configuration to that of the CENO-v0.1 model.
|
| 33 |
+
|
| 34 |
+
[todo](todo)
|
| 35 |
+
|
| 36 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
| 37 |
+
documentation from [`PretrainedConfig`] for more information.
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
Args:
|
| 41 |
+
vocab_size (`int`, *optional*, defaults to 131072):
|
| 42 |
+
Vocabulary size of the CENO model. Defines the number of different tokens that can be represented by the
|
| 43 |
+
`inputs_ids` passed when calling [`CENOModel`]
|
| 44 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
|
| 45 |
+
Whether the model's input and output word embeddings should be tied. Note that this is only relevant if the
|
| 46 |
+
model has a output word embedding layer.
|
| 47 |
+
hidden_size (`int`, *optional*, defaults to 4096):
|
| 48 |
+
Dimension of the hidden representations.
|
| 49 |
+
intermediate_size (`int`, *optional*, defaults to 21504):
|
| 50 |
+
Dimension of the MLP representations.
|
| 51 |
+
num_hidden_layers (`int`, *optional*, defaults to 52):
|
| 52 |
+
Number of hidden layers in the Transformer encoder.
|
| 53 |
+
hybrid_override_pattern (`str`, *optional*, defaults to `"MMMM*MMMMM*MMMMM*MMMMM*MMMMMM"`):
|
| 54 |
+
The pattern of the hybrid model. The pattern is a string of characters where each character represents one layer: M=Mamba, *=Attention, -=MLP, E=MoE
|
| 55 |
+
num_attention_heads (`int`, *optional*, defaults to 32):
|
| 56 |
+
Number of attention heads for each attention layer in the Transformer encoder.
|
| 57 |
+
attention_head_dim (`int`, *optional*, defaults to 128):
|
| 58 |
+
Dimension of each attention head.
|
| 59 |
+
num_key_value_heads (`int`, *optional*, defaults to 8):
|
| 60 |
+
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
| 61 |
+
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
|
| 62 |
+
`num_key_value_heads=1` the model will use Multi Query Attention (MQA) otherwise GQA is used.
|
| 63 |
+
mlp_hidden_act (`str`, *optional*, defaults to "relu2"):
|
| 64 |
+
The non-linear activation function in the MLP layers.
|
| 65 |
+
mlp_use_swiglu (`bool`, *optional*, defaults to `False`):
|
| 66 |
+
Whether to use SwiGLU activation (gated linear unit) in MLP layers.
|
| 67 |
+
num_experts (`int`, *optional*, defaults to 8):
|
| 68 |
+
Number of experts for MoE layers.
|
| 69 |
+
top_k (`int`, *optional*, defaults to 2):
|
| 70 |
+
Number of experts to select for each token in MoE layers.
|
| 71 |
+
attention_bias (`bool`, *optional*, defaults to `False`):
|
| 72 |
+
Whether to use bias in attention layers.
|
| 73 |
+
mlp_bias (`bool`, *optional*, defaults to `False`):
|
| 74 |
+
Whether to use bias in MLP layers.
|
| 75 |
+
use_bias (`bool`, *optional*, defaults to `False`):
|
| 76 |
+
Whether to use bias in the model.
|
| 77 |
+
initializer_range (`float`, *optional*, defaults to 0.02):
|
| 78 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
| 79 |
+
layer_norm_epsilon (`float`, *optional*, defaults to 1e-5):
|
| 80 |
+
The epsilon used by the layer normalization layers.
|
| 81 |
+
residual_in_fp32 (`bool`, *optional*, defaults to `False`):
|
| 82 |
+
Whether or not residuals should be in `float32`. If set to `False` residuals will keep the same `dtype` as the rest of the model.
|
| 83 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
| 84 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
| 85 |
+
relevant if `config.is_decoder=True`.
|
| 86 |
+
num_logits_to_keep (`int` or `None`, *optional*, defaults to 1):
|
| 87 |
+
Number of prompt logits to calculate during generation. If `None`, all logits will be calculated. If an
|
| 88 |
+
integer value, only last `num_logits_to_keep` logits will be calculated.
|
| 89 |
+
pad_token_id (`int`, *optional*, defaults to 1):
|
| 90 |
+
The id of the padding token.
|
| 91 |
+
bos_token_id (`int`, *optional*, defaults to 0):
|
| 92 |
+
The id of the "beginning-of-sequence" token.
|
| 93 |
+
eos_token_id (`int`, *optional*, defaults to 0):
|
| 94 |
+
The id of the "end-of-sequence" token.
|
| 95 |
+
sliding_window (`int`, *optional*, defaults to None):
|
| 96 |
+
Sliding window attention window size.
|
| 97 |
+
max_position_embeddings (`int`, *optional*, defaults to 4096):
|
| 98 |
+
The maximum sequence length that this model might ever be used with.
|
| 99 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
| 100 |
+
The dropout ratio for the attention probabilities.
|
| 101 |
+
hidden_dropout (`float`, *optional*, defaults to 0.0):
|
| 102 |
+
The dropout ratio for the hidden states.
|
| 103 |
+
use_mamba_kernels (`bool`, *optional*, defaults to `True`):
|
| 104 |
+
Flag indicating whether or not to use the fast mamba kernels. These are available only if `mamba-ssm` and
|
| 105 |
+
`causal-conv1d` are installed, and the mamba modules are running on a CUDA device.
|
| 106 |
+
ssm_state_size (`int`, *optional*, defaults to 128):
|
| 107 |
+
The dimension of the mamba state space latents.
|
| 108 |
+
mamba_num_heads (`int`, *optional*, defaults to 128):
|
| 109 |
+
Number of heads in Mamba layers.
|
| 110 |
+
mamba_n_groups (`int`, *optional*, defaults to 8):
|
| 111 |
+
Number of groups in Mamba layers.
|
| 112 |
+
mamba_head_dim (`int`, *optional*, defaults to 64):
|
| 113 |
+
Dimension of each Mamba head.
|
| 114 |
+
mamba_d_conv (`int`, *optional*, defaults to 4):
|
| 115 |
+
The size of the mamba convolution kernel.
|
| 116 |
+
mamba_expand (`int`, *optional*, defaults to 2):
|
| 117 |
+
Expanding factor used to determine the mamba intermediate size.
|
| 118 |
+
mamba_hidden_act (`str`, *optional*, defaults to "silu"):
|
| 119 |
+
The non-linear activation function in the Mamba layers.
|
| 120 |
+
mamba_dt_min (`float`, *optional*, defaults to 0.001):
|
| 121 |
+
Minimum value for the time step in Mamba.
|
| 122 |
+
mamba_dt_max (`float`, *optional*, defaults to 0.1):
|
| 123 |
+
Maximum value for the time step in Mamba.
|
| 124 |
+
mamba_dt_limit (`tuple`, *optional*, defaults to (0.0, float("inf"))):
|
| 125 |
+
Limits for the time step in Mamba.
|
| 126 |
+
mamba_dt_init_floor (`float`, *optional*, defaults to 1e-4):
|
| 127 |
+
Floor value for time step initialization in Mamba.
|
| 128 |
+
mamba_conv_bias (`bool`, *optional*, defaults to `True`):
|
| 129 |
+
Whether to use bias in the convolution layer of the mamba mixer block.
|
| 130 |
+
mamba_proj_bias (`bool`, *optional*, defaults to `False`):
|
| 131 |
+
Whether to use bias in the input and output projections of the mamba mixer block.
|
| 132 |
+
mamba_in_proj_layernorm (`bool`, *optional*, defaults to `False`):
|
| 133 |
+
Whether to apply an additional RMSNorm before the Mamba in-projection. This matches
|
| 134 |
+
Megatron's TELayerNormColumnParallelLinear fused Mamba in_proj norm when enabled.
|
| 135 |
+
mamba_chunk_size (`int`, *optional*, defaults to 256):
|
| 136 |
+
Size of chunks for Mamba processing.
|
| 137 |
+
rescale_prenorm_residual (`bool`, *optional*, defaults to `True`):
|
| 138 |
+
Whether to rescale the pre-normalization residual connections.
|
| 139 |
+
num_experts (`int`, *optional*, defaults to 8):
|
| 140 |
+
Number of experts in MoE layers.
|
| 141 |
+
moe_top_k (`int`, *optional*, defaults to 2):
|
| 142 |
+
Number of experts to route to in MoE layers (renamed from top_k to avoid generation config conflicts).
|
| 143 |
+
qkv_layernorm (`bool`, *optional*, defaults to `False`):
|
| 144 |
+
Whether to apply an additional RMSNorm before QKV projections in attention layers. This matches
|
| 145 |
+
Megatron's TELayerNormColumnParallelLinear fused QKV norm when enabled.
|
| 146 |
+
intra_encoding_pattern (`str`, *optional*, defaults to `None`):
|
| 147 |
+
Per-layer switch (length must equal `num_hidden_layers`) to control which layers use intra-sequence
|
| 148 |
+
isolation. Characters in `{1, Y, y, S, s, T, t, +}` enable isolation; `{0, N, n, F, f, ., -}` disable.
|
| 149 |
+
If omitted, intra-sequence isolation is disabled (legacy behavior).
|
| 150 |
+
"""
|
| 151 |
+
|
| 152 |
+
model_type = "ceno"
|
| 153 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
| 154 |
+
|
| 155 |
+
def __init__(
|
| 156 |
+
self,
|
| 157 |
+
vocab_size=131072,
|
| 158 |
+
tie_word_embeddings=False,
|
| 159 |
+
hidden_size=4096,
|
| 160 |
+
intermediate_size=21504,
|
| 161 |
+
num_hidden_layers=52,
|
| 162 |
+
hybrid_override_pattern="MMMM*MMMMM*MMMMM*MMMMM*MMMMMM",
|
| 163 |
+
num_attention_heads=32,
|
| 164 |
+
attention_head_dim=128,
|
| 165 |
+
num_key_value_heads=8, # nemo: num_query_groups
|
| 166 |
+
mlp_hidden_act="relu2",
|
| 167 |
+
mlp_use_swiglu=False,
|
| 168 |
+
num_experts=8,
|
| 169 |
+
moe_top_k=2,
|
| 170 |
+
moe_router_pre_softmax=False,
|
| 171 |
+
attention_bias=False,
|
| 172 |
+
qkv_layernorm=False,
|
| 173 |
+
mlp_bias=False,
|
| 174 |
+
use_bias=False,
|
| 175 |
+
initializer_range=0.02, # nemo: init_method_std
|
| 176 |
+
layer_norm_epsilon=1e-5, # nemo: layernorm_epsilon
|
| 177 |
+
residual_in_fp32=False, # Megatron Core default value
|
| 178 |
+
use_cache=True,
|
| 179 |
+
num_logits_to_keep=1,
|
| 180 |
+
pad_token_id=1,
|
| 181 |
+
bos_token_id=0,
|
| 182 |
+
eos_token_id=0,
|
| 183 |
+
sliding_window=None,
|
| 184 |
+
max_position_embeddings=4096,
|
| 185 |
+
attention_dropout=0.0,
|
| 186 |
+
hidden_dropout=0.0, # * ADDED
|
| 187 |
+
use_mamba_kernels=True,
|
| 188 |
+
ssm_state_size=128, # mamba_state_size
|
| 189 |
+
mamba_num_heads=128,
|
| 190 |
+
mamba_n_groups=8, # nemo: mamba_ssm_ngroups = num_heads
|
| 191 |
+
mamba_head_dim=64,
|
| 192 |
+
mamba_d_conv=4,
|
| 193 |
+
mamba_expand=2,
|
| 194 |
+
mamba_hidden_act="silu",
|
| 195 |
+
mamba_dt_min=0.001,
|
| 196 |
+
mamba_dt_max=0.1,
|
| 197 |
+
mamba_dt_limit=(0.0, float("inf")),
|
| 198 |
+
mamba_dt_init_floor=1e-4,
|
| 199 |
+
mamba_conv_bias=True,
|
| 200 |
+
mamba_proj_bias=False,
|
| 201 |
+
mamba_in_proj_layernorm=False,
|
| 202 |
+
mamba_chunk_size=256,
|
| 203 |
+
rescale_prenorm_residual=True,
|
| 204 |
+
ceno_training_precision=False,
|
| 205 |
+
ceno_mamba_gate_in_ssm=False,
|
| 206 |
+
ceno_rmsnorm_mode="torch",
|
| 207 |
+
ceno_reference_cp_size=1,
|
| 208 |
+
ceno_reference_context_length=None,
|
| 209 |
+
intra_encoding_pattern=None,
|
| 210 |
+
**kwargs,
|
| 211 |
+
):
|
| 212 |
+
# Explicit inference reference; never inferred from a serving batch or prefix.
|
| 213 |
+
self.ceno_training_precision = ceno_training_precision
|
| 214 |
+
self.ceno_mamba_gate_in_ssm = ceno_mamba_gate_in_ssm
|
| 215 |
+
self.ceno_rmsnorm_mode = ceno_rmsnorm_mode
|
| 216 |
+
self.ceno_reference_cp_size = ceno_reference_cp_size
|
| 217 |
+
self.ceno_reference_context_length = ceno_reference_context_length
|
| 218 |
+
self.vocab_size = vocab_size
|
| 219 |
+
self.tie_word_embeddings = tie_word_embeddings
|
| 220 |
+
self.hidden_size = hidden_size
|
| 221 |
+
self.intermediate_size = intermediate_size
|
| 222 |
+
self.num_hidden_layers = num_hidden_layers
|
| 223 |
+
self.hybrid_override_pattern = hybrid_override_pattern
|
| 224 |
+
self.num_attention_heads = num_attention_heads
|
| 225 |
+
self.attention_head_dim = attention_head_dim
|
| 226 |
+
self.sliding_window = sliding_window
|
| 227 |
+
self.max_position_embeddings = max_position_embeddings
|
| 228 |
+
self.attention_dropout = attention_dropout
|
| 229 |
+
self.hidden_dropout = hidden_dropout
|
| 230 |
+
self.qkv_layernorm = qkv_layernorm
|
| 231 |
+
|
| 232 |
+
# Validate and process hybrid_override_pattern
|
| 233 |
+
# M: Mamba, *: Attention, -: MLP, E: MoE
|
| 234 |
+
if self.hybrid_override_pattern is None:
|
| 235 |
+
# Default pattern with even distribution of attention layers
|
| 236 |
+
self.hybrid_override_pattern = self._generate_default_pattern()
|
| 237 |
+
|
| 238 |
+
# Pattern should be a string where each character represents one layer
|
| 239 |
+
# No processing needed since '-' represents MLP layers, not separators
|
| 240 |
+
|
| 241 |
+
# For the default pattern, adjust it if num_hidden_layers doesn't match
|
| 242 |
+
if len(self.hybrid_override_pattern) != self.num_hidden_layers:
|
| 243 |
+
# If using default pattern and layers don't match, regenerate
|
| 244 |
+
if self.hybrid_override_pattern == "MMMM*MMMMM*MMMMM*MMMMM*MMMMMM":
|
| 245 |
+
self.hybrid_override_pattern = self._generate_default_pattern()
|
| 246 |
+
else:
|
| 247 |
+
# Only assert if it's a user-provided pattern
|
| 248 |
+
assert len(self.hybrid_override_pattern) == self.num_hidden_layers, f"hybrid_override_pattern length ({len(self.hybrid_override_pattern)}) must match num_hidden_layers ({self.num_hidden_layers})"
|
| 249 |
+
|
| 250 |
+
assert re.match(r"^[M*\-E]+$", self.hybrid_override_pattern), "hybrid_override_pattern must only contain characters 'M', '*', '-', or 'E'"
|
| 251 |
+
|
| 252 |
+
# for backward compatibility
|
| 253 |
+
if num_key_value_heads is None:
|
| 254 |
+
num_key_value_heads = num_attention_heads
|
| 255 |
+
|
| 256 |
+
self.num_key_value_heads = num_key_value_heads
|
| 257 |
+
self.mlp_hidden_act = mlp_hidden_act
|
| 258 |
+
self.mlp_use_swiglu = mlp_use_swiglu
|
| 259 |
+
self.num_experts = num_experts
|
| 260 |
+
self.moe_top_k = moe_top_k
|
| 261 |
+
# Megatron MoE routing: default is post-topk softmax (i.e., softmax after selecting top-k experts).
|
| 262 |
+
# This flag mirrors Megatron's `--moe-router-pre-softmax`.
|
| 263 |
+
self.moe_router_pre_softmax = moe_router_pre_softmax
|
| 264 |
+
self.attention_bias = attention_bias
|
| 265 |
+
self.mlp_bias = mlp_bias
|
| 266 |
+
self.use_bias = use_bias
|
| 267 |
+
self.initializer_range = initializer_range
|
| 268 |
+
self.layer_norm_epsilon = layer_norm_epsilon
|
| 269 |
+
self.residual_in_fp32 = residual_in_fp32
|
| 270 |
+
|
| 271 |
+
self.use_cache = use_cache
|
| 272 |
+
self.num_logits_to_keep = num_logits_to_keep
|
| 273 |
+
|
| 274 |
+
self.use_mamba_kernels = use_mamba_kernels
|
| 275 |
+
self.n_groups = mamba_n_groups
|
| 276 |
+
self.mamba_head_dim = mamba_head_dim
|
| 277 |
+
self.ssm_state_size = ssm_state_size
|
| 278 |
+
self.mamba_num_heads = mamba_num_heads
|
| 279 |
+
self.conv_kernel = mamba_d_conv
|
| 280 |
+
self.expand = mamba_expand
|
| 281 |
+
self.mamba_hidden_act = mamba_hidden_act
|
| 282 |
+
self.time_step_min = mamba_dt_min
|
| 283 |
+
self.time_step_max = mamba_dt_max
|
| 284 |
+
self.time_step_limit = mamba_dt_limit
|
| 285 |
+
self.time_step_floor = mamba_dt_init_floor
|
| 286 |
+
self.use_conv_bias = mamba_conv_bias
|
| 287 |
+
self.mamba_proj_bias = mamba_proj_bias
|
| 288 |
+
self.mamba_in_proj_layernorm = mamba_in_proj_layernorm
|
| 289 |
+
self.chunk_size = mamba_chunk_size
|
| 290 |
+
self.rescale_prenorm_residual = rescale_prenorm_residual
|
| 291 |
+
self.intra_encoding_pattern = intra_encoding_pattern
|
| 292 |
+
|
| 293 |
+
# MoE parameters
|
| 294 |
+
self.num_experts = num_experts
|
| 295 |
+
self.moe_top_k = moe_top_k
|
| 296 |
+
|
| 297 |
+
super().__init__(
|
| 298 |
+
pad_token_id=pad_token_id,
|
| 299 |
+
bos_token_id=bos_token_id,
|
| 300 |
+
eos_token_id=eos_token_id,
|
| 301 |
+
tie_word_embeddings=tie_word_embeddings,
|
| 302 |
+
**kwargs,
|
| 303 |
+
)
|
| 304 |
+
|
| 305 |
+
def _generate_default_pattern(self):
|
| 306 |
+
"""Generate default hybrid pattern with even distribution of attention layers"""
|
| 307 |
+
# Default to mostly Mamba with some attention layers evenly distributed
|
| 308 |
+
pattern = ["M"] * self.num_hidden_layers
|
| 309 |
+
|
| 310 |
+
# Place attention layers at roughly even intervals
|
| 311 |
+
if self.num_hidden_layers >= 4:
|
| 312 |
+
# For larger models, place attention every 4-5 layers
|
| 313 |
+
attention_interval = max(4, self.num_hidden_layers // 8)
|
| 314 |
+
for i in range(attention_interval - 1, self.num_hidden_layers, attention_interval):
|
| 315 |
+
pattern[i] = "*"
|
| 316 |
+
|
| 317 |
+
return ''.join(pattern)
|
| 318 |
+
|
| 319 |
+
@property
|
| 320 |
+
def layers_block_type(self):
|
| 321 |
+
return [
|
| 322 |
+
"mamba" if self.hybrid_override_pattern[i] == "M" else
|
| 323 |
+
"attention" if self.hybrid_override_pattern[i] == "*" else
|
| 324 |
+
"mlp" if self.hybrid_override_pattern[i] == "-" else "moe"
|
| 325 |
+
for i in range(self.num_hidden_layers)]
|
| 326 |
+
|
| 327 |
+
@property
|
| 328 |
+
def intra_encoding_mask(self):
|
| 329 |
+
"""
|
| 330 |
+
Per-layer boolean mask for intra-sequence isolation.
|
| 331 |
+
If `intra_encoding_pattern` is provided, it is used; otherwise isolation is disabled.
|
| 332 |
+
"""
|
| 333 |
+
if getattr(self, "intra_encoding_pattern", None) is not None:
|
| 334 |
+
pat = self.intra_encoding_pattern
|
| 335 |
+
if len(pat) != self.num_hidden_layers:
|
| 336 |
+
raise ValueError(
|
| 337 |
+
f"intra_encoding_pattern length ({len(pat)}) must match num_hidden_layers ({self.num_hidden_layers})"
|
| 338 |
+
)
|
| 339 |
+
enable_set = {"1", "Y", "y", "S", "s", "T", "t", "+"}
|
| 340 |
+
disable_set = {"0", "N", "n", "F", "f", ".", "-"}
|
| 341 |
+
return [c in enable_set if c in enable_set.union(disable_set) else True for c in pat]
|
| 342 |
+
|
| 343 |
+
# Default/legacy: no intra-sequence isolation
|
| 344 |
+
return [False for _ in range(self.num_hidden_layers)]
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": 0,
|
| 5 |
+
"pad_token_id": 1,
|
| 6 |
+
"transformers_version": "4.48.3"
|
| 7 |
+
}
|
model.safetensors.index.json
ADDED
|
@@ -0,0 +1,570 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"metadata": {
|
| 3 |
+
"total_size": 17857248160
|
| 4 |
+
},
|
| 5 |
+
"weight_map": {
|
| 6 |
+
"backbone.embeddings.weight": "model-00001-of-00004.safetensors",
|
| 7 |
+
"backbone.layers.0.mixer.A_log": "model-00001-of-00004.safetensors",
|
| 8 |
+
"backbone.layers.0.mixer.D": "model-00001-of-00004.safetensors",
|
| 9 |
+
"backbone.layers.0.mixer.conv1d.bias": "model-00001-of-00004.safetensors",
|
| 10 |
+
"backbone.layers.0.mixer.conv1d.weight": "model-00001-of-00004.safetensors",
|
| 11 |
+
"backbone.layers.0.mixer.dt_bias": "model-00001-of-00004.safetensors",
|
| 12 |
+
"backbone.layers.0.mixer.in_proj.weight": "model-00001-of-00004.safetensors",
|
| 13 |
+
"backbone.layers.0.mixer.in_proj_norm.weight": "model-00001-of-00004.safetensors",
|
| 14 |
+
"backbone.layers.0.mixer.norm.weight": "model-00001-of-00004.safetensors",
|
| 15 |
+
"backbone.layers.0.mixer.out_proj.weight": "model-00001-of-00004.safetensors",
|
| 16 |
+
"backbone.layers.1.mixer.experts.0.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 17 |
+
"backbone.layers.1.mixer.experts.0.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 18 |
+
"backbone.layers.1.mixer.experts.1.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 19 |
+
"backbone.layers.1.mixer.experts.1.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 20 |
+
"backbone.layers.1.mixer.experts.2.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 21 |
+
"backbone.layers.1.mixer.experts.2.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 22 |
+
"backbone.layers.1.mixer.experts.3.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 23 |
+
"backbone.layers.1.mixer.experts.3.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 24 |
+
"backbone.layers.1.mixer.experts.4.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 25 |
+
"backbone.layers.1.mixer.experts.4.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 26 |
+
"backbone.layers.1.mixer.experts.5.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 27 |
+
"backbone.layers.1.mixer.experts.5.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 28 |
+
"backbone.layers.1.mixer.experts.6.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 29 |
+
"backbone.layers.1.mixer.experts.6.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 30 |
+
"backbone.layers.1.mixer.experts.7.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 31 |
+
"backbone.layers.1.mixer.experts.7.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 32 |
+
"backbone.layers.1.mixer.gate.weight": "model-00001-of-00004.safetensors",
|
| 33 |
+
"backbone.layers.1.norm.weight": "model-00001-of-00004.safetensors",
|
| 34 |
+
"backbone.layers.1.pre_mlp_norm.weight": "model-00001-of-00004.safetensors",
|
| 35 |
+
"backbone.layers.10.mixer.A_log": "model-00001-of-00004.safetensors",
|
| 36 |
+
"backbone.layers.10.mixer.D": "model-00001-of-00004.safetensors",
|
| 37 |
+
"backbone.layers.10.mixer.conv1d.bias": "model-00001-of-00004.safetensors",
|
| 38 |
+
"backbone.layers.10.mixer.conv1d.weight": "model-00001-of-00004.safetensors",
|
| 39 |
+
"backbone.layers.10.mixer.dt_bias": "model-00001-of-00004.safetensors",
|
| 40 |
+
"backbone.layers.10.mixer.in_proj.weight": "model-00001-of-00004.safetensors",
|
| 41 |
+
"backbone.layers.10.mixer.in_proj_norm.weight": "model-00001-of-00004.safetensors",
|
| 42 |
+
"backbone.layers.10.mixer.norm.weight": "model-00001-of-00004.safetensors",
|
| 43 |
+
"backbone.layers.10.mixer.out_proj.weight": "model-00001-of-00004.safetensors",
|
| 44 |
+
"backbone.layers.11.mixer.experts.0.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 45 |
+
"backbone.layers.11.mixer.experts.0.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 46 |
+
"backbone.layers.11.mixer.experts.1.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 47 |
+
"backbone.layers.11.mixer.experts.1.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 48 |
+
"backbone.layers.11.mixer.experts.2.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 49 |
+
"backbone.layers.11.mixer.experts.2.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 50 |
+
"backbone.layers.11.mixer.experts.3.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 51 |
+
"backbone.layers.11.mixer.experts.3.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 52 |
+
"backbone.layers.11.mixer.experts.4.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 53 |
+
"backbone.layers.11.mixer.experts.4.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 54 |
+
"backbone.layers.11.mixer.experts.5.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 55 |
+
"backbone.layers.11.mixer.experts.5.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 56 |
+
"backbone.layers.11.mixer.experts.6.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 57 |
+
"backbone.layers.11.mixer.experts.6.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 58 |
+
"backbone.layers.11.mixer.experts.7.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 59 |
+
"backbone.layers.11.mixer.experts.7.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 60 |
+
"backbone.layers.11.mixer.gate.weight": "model-00001-of-00004.safetensors",
|
| 61 |
+
"backbone.layers.11.norm.weight": "model-00001-of-00004.safetensors",
|
| 62 |
+
"backbone.layers.11.pre_mlp_norm.weight": "model-00002-of-00004.safetensors",
|
| 63 |
+
"backbone.layers.12.mixer.A_log": "model-00002-of-00004.safetensors",
|
| 64 |
+
"backbone.layers.12.mixer.D": "model-00002-of-00004.safetensors",
|
| 65 |
+
"backbone.layers.12.mixer.conv1d.bias": "model-00002-of-00004.safetensors",
|
| 66 |
+
"backbone.layers.12.mixer.conv1d.weight": "model-00002-of-00004.safetensors",
|
| 67 |
+
"backbone.layers.12.mixer.dt_bias": "model-00002-of-00004.safetensors",
|
| 68 |
+
"backbone.layers.12.mixer.in_proj.weight": "model-00002-of-00004.safetensors",
|
| 69 |
+
"backbone.layers.12.mixer.in_proj_norm.weight": "model-00002-of-00004.safetensors",
|
| 70 |
+
"backbone.layers.12.mixer.norm.weight": "model-00002-of-00004.safetensors",
|
| 71 |
+
"backbone.layers.12.mixer.out_proj.weight": "model-00002-of-00004.safetensors",
|
| 72 |
+
"backbone.layers.13.mixer.experts.0.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 73 |
+
"backbone.layers.13.mixer.experts.0.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 74 |
+
"backbone.layers.13.mixer.experts.1.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 75 |
+
"backbone.layers.13.mixer.experts.1.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 76 |
+
"backbone.layers.13.mixer.experts.2.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 77 |
+
"backbone.layers.13.mixer.experts.2.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 78 |
+
"backbone.layers.13.mixer.experts.3.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 79 |
+
"backbone.layers.13.mixer.experts.3.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 80 |
+
"backbone.layers.13.mixer.experts.4.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 81 |
+
"backbone.layers.13.mixer.experts.4.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 82 |
+
"backbone.layers.13.mixer.experts.5.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 83 |
+
"backbone.layers.13.mixer.experts.5.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 84 |
+
"backbone.layers.13.mixer.experts.6.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 85 |
+
"backbone.layers.13.mixer.experts.6.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 86 |
+
"backbone.layers.13.mixer.experts.7.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 87 |
+
"backbone.layers.13.mixer.experts.7.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 88 |
+
"backbone.layers.13.mixer.gate.weight": "model-00002-of-00004.safetensors",
|
| 89 |
+
"backbone.layers.13.norm.weight": "model-00002-of-00004.safetensors",
|
| 90 |
+
"backbone.layers.13.pre_mlp_norm.weight": "model-00002-of-00004.safetensors",
|
| 91 |
+
"backbone.layers.14.mixer.A_log": "model-00002-of-00004.safetensors",
|
| 92 |
+
"backbone.layers.14.mixer.D": "model-00002-of-00004.safetensors",
|
| 93 |
+
"backbone.layers.14.mixer.conv1d.bias": "model-00002-of-00004.safetensors",
|
| 94 |
+
"backbone.layers.14.mixer.conv1d.weight": "model-00002-of-00004.safetensors",
|
| 95 |
+
"backbone.layers.14.mixer.dt_bias": "model-00002-of-00004.safetensors",
|
| 96 |
+
"backbone.layers.14.mixer.in_proj.weight": "model-00002-of-00004.safetensors",
|
| 97 |
+
"backbone.layers.14.mixer.in_proj_norm.weight": "model-00002-of-00004.safetensors",
|
| 98 |
+
"backbone.layers.14.mixer.norm.weight": "model-00002-of-00004.safetensors",
|
| 99 |
+
"backbone.layers.14.mixer.out_proj.weight": "model-00002-of-00004.safetensors",
|
| 100 |
+
"backbone.layers.15.mixer.experts.0.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 101 |
+
"backbone.layers.15.mixer.experts.0.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 102 |
+
"backbone.layers.15.mixer.experts.1.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 103 |
+
"backbone.layers.15.mixer.experts.1.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 104 |
+
"backbone.layers.15.mixer.experts.2.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 105 |
+
"backbone.layers.15.mixer.experts.2.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 106 |
+
"backbone.layers.15.mixer.experts.3.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 107 |
+
"backbone.layers.15.mixer.experts.3.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 108 |
+
"backbone.layers.15.mixer.experts.4.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 109 |
+
"backbone.layers.15.mixer.experts.4.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 110 |
+
"backbone.layers.15.mixer.experts.5.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 111 |
+
"backbone.layers.15.mixer.experts.5.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 112 |
+
"backbone.layers.15.mixer.experts.6.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 113 |
+
"backbone.layers.15.mixer.experts.6.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 114 |
+
"backbone.layers.15.mixer.experts.7.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 115 |
+
"backbone.layers.15.mixer.experts.7.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 116 |
+
"backbone.layers.15.mixer.gate.weight": "model-00002-of-00004.safetensors",
|
| 117 |
+
"backbone.layers.15.norm.weight": "model-00002-of-00004.safetensors",
|
| 118 |
+
"backbone.layers.15.pre_mlp_norm.weight": "model-00002-of-00004.safetensors",
|
| 119 |
+
"backbone.layers.16.mixer.A_log": "model-00002-of-00004.safetensors",
|
| 120 |
+
"backbone.layers.16.mixer.D": "model-00002-of-00004.safetensors",
|
| 121 |
+
"backbone.layers.16.mixer.conv1d.bias": "model-00002-of-00004.safetensors",
|
| 122 |
+
"backbone.layers.16.mixer.conv1d.weight": "model-00002-of-00004.safetensors",
|
| 123 |
+
"backbone.layers.16.mixer.dt_bias": "model-00002-of-00004.safetensors",
|
| 124 |
+
"backbone.layers.16.mixer.in_proj.weight": "model-00002-of-00004.safetensors",
|
| 125 |
+
"backbone.layers.16.mixer.in_proj_norm.weight": "model-00002-of-00004.safetensors",
|
| 126 |
+
"backbone.layers.16.mixer.norm.weight": "model-00002-of-00004.safetensors",
|
| 127 |
+
"backbone.layers.16.mixer.out_proj.weight": "model-00002-of-00004.safetensors",
|
| 128 |
+
"backbone.layers.17.mixer.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 129 |
+
"backbone.layers.17.mixer.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 130 |
+
"backbone.layers.17.mixer.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 131 |
+
"backbone.layers.17.mixer.qkv_norm.weight": "model-00002-of-00004.safetensors",
|
| 132 |
+
"backbone.layers.17.mixer.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 133 |
+
"backbone.layers.17.norm.weight": "model-00002-of-00004.safetensors",
|
| 134 |
+
"backbone.layers.17.pre_mlp_norm.weight": "model-00002-of-00004.safetensors",
|
| 135 |
+
"backbone.layers.18.mixer.A_log": "model-00002-of-00004.safetensors",
|
| 136 |
+
"backbone.layers.18.mixer.D": "model-00002-of-00004.safetensors",
|
| 137 |
+
"backbone.layers.18.mixer.conv1d.bias": "model-00002-of-00004.safetensors",
|
| 138 |
+
"backbone.layers.18.mixer.conv1d.weight": "model-00002-of-00004.safetensors",
|
| 139 |
+
"backbone.layers.18.mixer.dt_bias": "model-00002-of-00004.safetensors",
|
| 140 |
+
"backbone.layers.18.mixer.in_proj.weight": "model-00002-of-00004.safetensors",
|
| 141 |
+
"backbone.layers.18.mixer.in_proj_norm.weight": "model-00002-of-00004.safetensors",
|
| 142 |
+
"backbone.layers.18.mixer.norm.weight": "model-00002-of-00004.safetensors",
|
| 143 |
+
"backbone.layers.18.mixer.out_proj.weight": "model-00002-of-00004.safetensors",
|
| 144 |
+
"backbone.layers.19.mixer.experts.0.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 145 |
+
"backbone.layers.19.mixer.experts.0.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 146 |
+
"backbone.layers.19.mixer.experts.1.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 147 |
+
"backbone.layers.19.mixer.experts.1.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 148 |
+
"backbone.layers.19.mixer.experts.2.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 149 |
+
"backbone.layers.19.mixer.experts.2.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 150 |
+
"backbone.layers.19.mixer.experts.3.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 151 |
+
"backbone.layers.19.mixer.experts.3.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 152 |
+
"backbone.layers.19.mixer.experts.4.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 153 |
+
"backbone.layers.19.mixer.experts.4.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 154 |
+
"backbone.layers.19.mixer.experts.5.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 155 |
+
"backbone.layers.19.mixer.experts.5.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 156 |
+
"backbone.layers.19.mixer.experts.6.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 157 |
+
"backbone.layers.19.mixer.experts.6.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 158 |
+
"backbone.layers.19.mixer.experts.7.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 159 |
+
"backbone.layers.19.mixer.experts.7.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 160 |
+
"backbone.layers.19.mixer.gate.weight": "model-00002-of-00004.safetensors",
|
| 161 |
+
"backbone.layers.19.norm.weight": "model-00002-of-00004.safetensors",
|
| 162 |
+
"backbone.layers.19.pre_mlp_norm.weight": "model-00002-of-00004.safetensors",
|
| 163 |
+
"backbone.layers.2.mixer.A_log": "model-00001-of-00004.safetensors",
|
| 164 |
+
"backbone.layers.2.mixer.D": "model-00001-of-00004.safetensors",
|
| 165 |
+
"backbone.layers.2.mixer.conv1d.bias": "model-00001-of-00004.safetensors",
|
| 166 |
+
"backbone.layers.2.mixer.conv1d.weight": "model-00001-of-00004.safetensors",
|
| 167 |
+
"backbone.layers.2.mixer.dt_bias": "model-00001-of-00004.safetensors",
|
| 168 |
+
"backbone.layers.2.mixer.in_proj.weight": "model-00001-of-00004.safetensors",
|
| 169 |
+
"backbone.layers.2.mixer.in_proj_norm.weight": "model-00001-of-00004.safetensors",
|
| 170 |
+
"backbone.layers.2.mixer.norm.weight": "model-00001-of-00004.safetensors",
|
| 171 |
+
"backbone.layers.2.mixer.out_proj.weight": "model-00001-of-00004.safetensors",
|
| 172 |
+
"backbone.layers.20.mixer.A_log": "model-00002-of-00004.safetensors",
|
| 173 |
+
"backbone.layers.20.mixer.D": "model-00002-of-00004.safetensors",
|
| 174 |
+
"backbone.layers.20.mixer.conv1d.bias": "model-00002-of-00004.safetensors",
|
| 175 |
+
"backbone.layers.20.mixer.conv1d.weight": "model-00002-of-00004.safetensors",
|
| 176 |
+
"backbone.layers.20.mixer.dt_bias": "model-00002-of-00004.safetensors",
|
| 177 |
+
"backbone.layers.20.mixer.in_proj.weight": "model-00002-of-00004.safetensors",
|
| 178 |
+
"backbone.layers.20.mixer.in_proj_norm.weight": "model-00002-of-00004.safetensors",
|
| 179 |
+
"backbone.layers.20.mixer.norm.weight": "model-00002-of-00004.safetensors",
|
| 180 |
+
"backbone.layers.20.mixer.out_proj.weight": "model-00002-of-00004.safetensors",
|
| 181 |
+
"backbone.layers.21.mixer.experts.0.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 182 |
+
"backbone.layers.21.mixer.experts.0.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 183 |
+
"backbone.layers.21.mixer.experts.1.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 184 |
+
"backbone.layers.21.mixer.experts.1.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 185 |
+
"backbone.layers.21.mixer.experts.2.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 186 |
+
"backbone.layers.21.mixer.experts.2.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 187 |
+
"backbone.layers.21.mixer.experts.3.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 188 |
+
"backbone.layers.21.mixer.experts.3.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 189 |
+
"backbone.layers.21.mixer.experts.4.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 190 |
+
"backbone.layers.21.mixer.experts.4.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 191 |
+
"backbone.layers.21.mixer.experts.5.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 192 |
+
"backbone.layers.21.mixer.experts.5.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 193 |
+
"backbone.layers.21.mixer.experts.6.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 194 |
+
"backbone.layers.21.mixer.experts.6.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 195 |
+
"backbone.layers.21.mixer.experts.7.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 196 |
+
"backbone.layers.21.mixer.experts.7.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 197 |
+
"backbone.layers.21.mixer.gate.weight": "model-00002-of-00004.safetensors",
|
| 198 |
+
"backbone.layers.21.norm.weight": "model-00002-of-00004.safetensors",
|
| 199 |
+
"backbone.layers.21.pre_mlp_norm.weight": "model-00002-of-00004.safetensors",
|
| 200 |
+
"backbone.layers.22.mixer.A_log": "model-00002-of-00004.safetensors",
|
| 201 |
+
"backbone.layers.22.mixer.D": "model-00002-of-00004.safetensors",
|
| 202 |
+
"backbone.layers.22.mixer.conv1d.bias": "model-00002-of-00004.safetensors",
|
| 203 |
+
"backbone.layers.22.mixer.conv1d.weight": "model-00002-of-00004.safetensors",
|
| 204 |
+
"backbone.layers.22.mixer.dt_bias": "model-00002-of-00004.safetensors",
|
| 205 |
+
"backbone.layers.22.mixer.in_proj.weight": "model-00002-of-00004.safetensors",
|
| 206 |
+
"backbone.layers.22.mixer.in_proj_norm.weight": "model-00002-of-00004.safetensors",
|
| 207 |
+
"backbone.layers.22.mixer.norm.weight": "model-00002-of-00004.safetensors",
|
| 208 |
+
"backbone.layers.22.mixer.out_proj.weight": "model-00002-of-00004.safetensors",
|
| 209 |
+
"backbone.layers.23.mixer.experts.0.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 210 |
+
"backbone.layers.23.mixer.experts.0.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 211 |
+
"backbone.layers.23.mixer.experts.1.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 212 |
+
"backbone.layers.23.mixer.experts.1.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 213 |
+
"backbone.layers.23.mixer.experts.2.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 214 |
+
"backbone.layers.23.mixer.experts.2.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 215 |
+
"backbone.layers.23.mixer.experts.3.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 216 |
+
"backbone.layers.23.mixer.experts.3.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 217 |
+
"backbone.layers.23.mixer.experts.4.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 218 |
+
"backbone.layers.23.mixer.experts.4.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 219 |
+
"backbone.layers.23.mixer.experts.5.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 220 |
+
"backbone.layers.23.mixer.experts.5.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 221 |
+
"backbone.layers.23.mixer.experts.6.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 222 |
+
"backbone.layers.23.mixer.experts.6.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 223 |
+
"backbone.layers.23.mixer.experts.7.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 224 |
+
"backbone.layers.23.mixer.experts.7.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 225 |
+
"backbone.layers.23.mixer.gate.weight": "model-00002-of-00004.safetensors",
|
| 226 |
+
"backbone.layers.23.norm.weight": "model-00002-of-00004.safetensors",
|
| 227 |
+
"backbone.layers.23.pre_mlp_norm.weight": "model-00003-of-00004.safetensors",
|
| 228 |
+
"backbone.layers.24.mixer.A_log": "model-00003-of-00004.safetensors",
|
| 229 |
+
"backbone.layers.24.mixer.D": "model-00003-of-00004.safetensors",
|
| 230 |
+
"backbone.layers.24.mixer.conv1d.bias": "model-00003-of-00004.safetensors",
|
| 231 |
+
"backbone.layers.24.mixer.conv1d.weight": "model-00003-of-00004.safetensors",
|
| 232 |
+
"backbone.layers.24.mixer.dt_bias": "model-00003-of-00004.safetensors",
|
| 233 |
+
"backbone.layers.24.mixer.in_proj.weight": "model-00003-of-00004.safetensors",
|
| 234 |
+
"backbone.layers.24.mixer.in_proj_norm.weight": "model-00003-of-00004.safetensors",
|
| 235 |
+
"backbone.layers.24.mixer.norm.weight": "model-00003-of-00004.safetensors",
|
| 236 |
+
"backbone.layers.24.mixer.out_proj.weight": "model-00003-of-00004.safetensors",
|
| 237 |
+
"backbone.layers.25.mixer.experts.0.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 238 |
+
"backbone.layers.25.mixer.experts.0.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 239 |
+
"backbone.layers.25.mixer.experts.1.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 240 |
+
"backbone.layers.25.mixer.experts.1.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 241 |
+
"backbone.layers.25.mixer.experts.2.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 242 |
+
"backbone.layers.25.mixer.experts.2.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 243 |
+
"backbone.layers.25.mixer.experts.3.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 244 |
+
"backbone.layers.25.mixer.experts.3.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 245 |
+
"backbone.layers.25.mixer.experts.4.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 246 |
+
"backbone.layers.25.mixer.experts.4.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 247 |
+
"backbone.layers.25.mixer.experts.5.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 248 |
+
"backbone.layers.25.mixer.experts.5.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 249 |
+
"backbone.layers.25.mixer.experts.6.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 250 |
+
"backbone.layers.25.mixer.experts.6.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 251 |
+
"backbone.layers.25.mixer.experts.7.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 252 |
+
"backbone.layers.25.mixer.experts.7.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 253 |
+
"backbone.layers.25.mixer.gate.weight": "model-00003-of-00004.safetensors",
|
| 254 |
+
"backbone.layers.25.norm.weight": "model-00003-of-00004.safetensors",
|
| 255 |
+
"backbone.layers.25.pre_mlp_norm.weight": "model-00003-of-00004.safetensors",
|
| 256 |
+
"backbone.layers.26.mixer.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 257 |
+
"backbone.layers.26.mixer.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 258 |
+
"backbone.layers.26.mixer.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 259 |
+
"backbone.layers.26.mixer.qkv_norm.weight": "model-00003-of-00004.safetensors",
|
| 260 |
+
"backbone.layers.26.mixer.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 261 |
+
"backbone.layers.26.norm.weight": "model-00003-of-00004.safetensors",
|
| 262 |
+
"backbone.layers.26.pre_mlp_norm.weight": "model-00003-of-00004.safetensors",
|
| 263 |
+
"backbone.layers.27.mixer.experts.0.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 264 |
+
"backbone.layers.27.mixer.experts.0.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 265 |
+
"backbone.layers.27.mixer.experts.1.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 266 |
+
"backbone.layers.27.mixer.experts.1.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 267 |
+
"backbone.layers.27.mixer.experts.2.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 268 |
+
"backbone.layers.27.mixer.experts.2.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 269 |
+
"backbone.layers.27.mixer.experts.3.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 270 |
+
"backbone.layers.27.mixer.experts.3.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 271 |
+
"backbone.layers.27.mixer.experts.4.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 272 |
+
"backbone.layers.27.mixer.experts.4.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 273 |
+
"backbone.layers.27.mixer.experts.5.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 274 |
+
"backbone.layers.27.mixer.experts.5.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 275 |
+
"backbone.layers.27.mixer.experts.6.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 276 |
+
"backbone.layers.27.mixer.experts.6.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 277 |
+
"backbone.layers.27.mixer.experts.7.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 278 |
+
"backbone.layers.27.mixer.experts.7.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 279 |
+
"backbone.layers.27.mixer.gate.weight": "model-00003-of-00004.safetensors",
|
| 280 |
+
"backbone.layers.27.norm.weight": "model-00003-of-00004.safetensors",
|
| 281 |
+
"backbone.layers.27.pre_mlp_norm.weight": "model-00003-of-00004.safetensors",
|
| 282 |
+
"backbone.layers.28.mixer.A_log": "model-00003-of-00004.safetensors",
|
| 283 |
+
"backbone.layers.28.mixer.D": "model-00003-of-00004.safetensors",
|
| 284 |
+
"backbone.layers.28.mixer.conv1d.bias": "model-00003-of-00004.safetensors",
|
| 285 |
+
"backbone.layers.28.mixer.conv1d.weight": "model-00003-of-00004.safetensors",
|
| 286 |
+
"backbone.layers.28.mixer.dt_bias": "model-00003-of-00004.safetensors",
|
| 287 |
+
"backbone.layers.28.mixer.in_proj.weight": "model-00003-of-00004.safetensors",
|
| 288 |
+
"backbone.layers.28.mixer.in_proj_norm.weight": "model-00003-of-00004.safetensors",
|
| 289 |
+
"backbone.layers.28.mixer.norm.weight": "model-00003-of-00004.safetensors",
|
| 290 |
+
"backbone.layers.28.mixer.out_proj.weight": "model-00003-of-00004.safetensors",
|
| 291 |
+
"backbone.layers.29.mixer.experts.0.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 292 |
+
"backbone.layers.29.mixer.experts.0.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 293 |
+
"backbone.layers.29.mixer.experts.1.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 294 |
+
"backbone.layers.29.mixer.experts.1.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 295 |
+
"backbone.layers.29.mixer.experts.2.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 296 |
+
"backbone.layers.29.mixer.experts.2.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 297 |
+
"backbone.layers.29.mixer.experts.3.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 298 |
+
"backbone.layers.29.mixer.experts.3.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 299 |
+
"backbone.layers.29.mixer.experts.4.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 300 |
+
"backbone.layers.29.mixer.experts.4.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 301 |
+
"backbone.layers.29.mixer.experts.5.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 302 |
+
"backbone.layers.29.mixer.experts.5.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 303 |
+
"backbone.layers.29.mixer.experts.6.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 304 |
+
"backbone.layers.29.mixer.experts.6.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 305 |
+
"backbone.layers.29.mixer.experts.7.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 306 |
+
"backbone.layers.29.mixer.experts.7.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 307 |
+
"backbone.layers.29.mixer.gate.weight": "model-00003-of-00004.safetensors",
|
| 308 |
+
"backbone.layers.29.norm.weight": "model-00003-of-00004.safetensors",
|
| 309 |
+
"backbone.layers.29.pre_mlp_norm.weight": "model-00003-of-00004.safetensors",
|
| 310 |
+
"backbone.layers.3.mixer.experts.0.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 311 |
+
"backbone.layers.3.mixer.experts.0.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 312 |
+
"backbone.layers.3.mixer.experts.1.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 313 |
+
"backbone.layers.3.mixer.experts.1.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 314 |
+
"backbone.layers.3.mixer.experts.2.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 315 |
+
"backbone.layers.3.mixer.experts.2.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 316 |
+
"backbone.layers.3.mixer.experts.3.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 317 |
+
"backbone.layers.3.mixer.experts.3.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 318 |
+
"backbone.layers.3.mixer.experts.4.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 319 |
+
"backbone.layers.3.mixer.experts.4.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 320 |
+
"backbone.layers.3.mixer.experts.5.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 321 |
+
"backbone.layers.3.mixer.experts.5.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 322 |
+
"backbone.layers.3.mixer.experts.6.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 323 |
+
"backbone.layers.3.mixer.experts.6.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 324 |
+
"backbone.layers.3.mixer.experts.7.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 325 |
+
"backbone.layers.3.mixer.experts.7.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 326 |
+
"backbone.layers.3.mixer.gate.weight": "model-00001-of-00004.safetensors",
|
| 327 |
+
"backbone.layers.3.norm.weight": "model-00001-of-00004.safetensors",
|
| 328 |
+
"backbone.layers.3.pre_mlp_norm.weight": "model-00001-of-00004.safetensors",
|
| 329 |
+
"backbone.layers.30.mixer.A_log": "model-00003-of-00004.safetensors",
|
| 330 |
+
"backbone.layers.30.mixer.D": "model-00003-of-00004.safetensors",
|
| 331 |
+
"backbone.layers.30.mixer.conv1d.bias": "model-00003-of-00004.safetensors",
|
| 332 |
+
"backbone.layers.30.mixer.conv1d.weight": "model-00003-of-00004.safetensors",
|
| 333 |
+
"backbone.layers.30.mixer.dt_bias": "model-00003-of-00004.safetensors",
|
| 334 |
+
"backbone.layers.30.mixer.in_proj.weight": "model-00003-of-00004.safetensors",
|
| 335 |
+
"backbone.layers.30.mixer.in_proj_norm.weight": "model-00003-of-00004.safetensors",
|
| 336 |
+
"backbone.layers.30.mixer.norm.weight": "model-00003-of-00004.safetensors",
|
| 337 |
+
"backbone.layers.30.mixer.out_proj.weight": "model-00003-of-00004.safetensors",
|
| 338 |
+
"backbone.layers.31.mixer.experts.0.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 339 |
+
"backbone.layers.31.mixer.experts.0.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 340 |
+
"backbone.layers.31.mixer.experts.1.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 341 |
+
"backbone.layers.31.mixer.experts.1.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 342 |
+
"backbone.layers.31.mixer.experts.2.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 343 |
+
"backbone.layers.31.mixer.experts.2.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 344 |
+
"backbone.layers.31.mixer.experts.3.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 345 |
+
"backbone.layers.31.mixer.experts.3.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 346 |
+
"backbone.layers.31.mixer.experts.4.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 347 |
+
"backbone.layers.31.mixer.experts.4.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 348 |
+
"backbone.layers.31.mixer.experts.5.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 349 |
+
"backbone.layers.31.mixer.experts.5.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 350 |
+
"backbone.layers.31.mixer.experts.6.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 351 |
+
"backbone.layers.31.mixer.experts.6.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 352 |
+
"backbone.layers.31.mixer.experts.7.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 353 |
+
"backbone.layers.31.mixer.experts.7.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 354 |
+
"backbone.layers.31.mixer.gate.weight": "model-00003-of-00004.safetensors",
|
| 355 |
+
"backbone.layers.31.norm.weight": "model-00003-of-00004.safetensors",
|
| 356 |
+
"backbone.layers.31.pre_mlp_norm.weight": "model-00003-of-00004.safetensors",
|
| 357 |
+
"backbone.layers.32.mixer.A_log": "model-00003-of-00004.safetensors",
|
| 358 |
+
"backbone.layers.32.mixer.D": "model-00003-of-00004.safetensors",
|
| 359 |
+
"backbone.layers.32.mixer.conv1d.bias": "model-00003-of-00004.safetensors",
|
| 360 |
+
"backbone.layers.32.mixer.conv1d.weight": "model-00003-of-00004.safetensors",
|
| 361 |
+
"backbone.layers.32.mixer.dt_bias": "model-00003-of-00004.safetensors",
|
| 362 |
+
"backbone.layers.32.mixer.in_proj.weight": "model-00003-of-00004.safetensors",
|
| 363 |
+
"backbone.layers.32.mixer.in_proj_norm.weight": "model-00003-of-00004.safetensors",
|
| 364 |
+
"backbone.layers.32.mixer.norm.weight": "model-00003-of-00004.safetensors",
|
| 365 |
+
"backbone.layers.32.mixer.out_proj.weight": "model-00003-of-00004.safetensors",
|
| 366 |
+
"backbone.layers.33.mixer.experts.0.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 367 |
+
"backbone.layers.33.mixer.experts.0.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 368 |
+
"backbone.layers.33.mixer.experts.1.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 369 |
+
"backbone.layers.33.mixer.experts.1.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 370 |
+
"backbone.layers.33.mixer.experts.2.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 371 |
+
"backbone.layers.33.mixer.experts.2.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 372 |
+
"backbone.layers.33.mixer.experts.3.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 373 |
+
"backbone.layers.33.mixer.experts.3.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 374 |
+
"backbone.layers.33.mixer.experts.4.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 375 |
+
"backbone.layers.33.mixer.experts.4.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 376 |
+
"backbone.layers.33.mixer.experts.5.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 377 |
+
"backbone.layers.33.mixer.experts.5.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 378 |
+
"backbone.layers.33.mixer.experts.6.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 379 |
+
"backbone.layers.33.mixer.experts.6.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 380 |
+
"backbone.layers.33.mixer.experts.7.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 381 |
+
"backbone.layers.33.mixer.experts.7.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 382 |
+
"backbone.layers.33.mixer.gate.weight": "model-00003-of-00004.safetensors",
|
| 383 |
+
"backbone.layers.33.norm.weight": "model-00003-of-00004.safetensors",
|
| 384 |
+
"backbone.layers.33.pre_mlp_norm.weight": "model-00003-of-00004.safetensors",
|
| 385 |
+
"backbone.layers.34.mixer.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 386 |
+
"backbone.layers.34.mixer.o_proj.weight": "model-00004-of-00004.safetensors",
|
| 387 |
+
"backbone.layers.34.mixer.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 388 |
+
"backbone.layers.34.mixer.qkv_norm.weight": "model-00003-of-00004.safetensors",
|
| 389 |
+
"backbone.layers.34.mixer.v_proj.weight": "model-00004-of-00004.safetensors",
|
| 390 |
+
"backbone.layers.34.norm.weight": "model-00003-of-00004.safetensors",
|
| 391 |
+
"backbone.layers.34.pre_mlp_norm.weight": "model-00004-of-00004.safetensors",
|
| 392 |
+
"backbone.layers.35.mixer.A_log": "model-00004-of-00004.safetensors",
|
| 393 |
+
"backbone.layers.35.mixer.D": "model-00004-of-00004.safetensors",
|
| 394 |
+
"backbone.layers.35.mixer.conv1d.bias": "model-00004-of-00004.safetensors",
|
| 395 |
+
"backbone.layers.35.mixer.conv1d.weight": "model-00004-of-00004.safetensors",
|
| 396 |
+
"backbone.layers.35.mixer.dt_bias": "model-00004-of-00004.safetensors",
|
| 397 |
+
"backbone.layers.35.mixer.in_proj.weight": "model-00004-of-00004.safetensors",
|
| 398 |
+
"backbone.layers.35.mixer.in_proj_norm.weight": "model-00004-of-00004.safetensors",
|
| 399 |
+
"backbone.layers.35.mixer.norm.weight": "model-00004-of-00004.safetensors",
|
| 400 |
+
"backbone.layers.35.mixer.out_proj.weight": "model-00004-of-00004.safetensors",
|
| 401 |
+
"backbone.layers.36.mixer.experts.0.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 402 |
+
"backbone.layers.36.mixer.experts.0.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 403 |
+
"backbone.layers.36.mixer.experts.1.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 404 |
+
"backbone.layers.36.mixer.experts.1.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 405 |
+
"backbone.layers.36.mixer.experts.2.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 406 |
+
"backbone.layers.36.mixer.experts.2.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 407 |
+
"backbone.layers.36.mixer.experts.3.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 408 |
+
"backbone.layers.36.mixer.experts.3.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 409 |
+
"backbone.layers.36.mixer.experts.4.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 410 |
+
"backbone.layers.36.mixer.experts.4.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 411 |
+
"backbone.layers.36.mixer.experts.5.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 412 |
+
"backbone.layers.36.mixer.experts.5.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 413 |
+
"backbone.layers.36.mixer.experts.6.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 414 |
+
"backbone.layers.36.mixer.experts.6.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 415 |
+
"backbone.layers.36.mixer.experts.7.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 416 |
+
"backbone.layers.36.mixer.experts.7.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 417 |
+
"backbone.layers.36.mixer.gate.weight": "model-00004-of-00004.safetensors",
|
| 418 |
+
"backbone.layers.36.norm.weight": "model-00004-of-00004.safetensors",
|
| 419 |
+
"backbone.layers.36.pre_mlp_norm.weight": "model-00004-of-00004.safetensors",
|
| 420 |
+
"backbone.layers.37.mixer.A_log": "model-00004-of-00004.safetensors",
|
| 421 |
+
"backbone.layers.37.mixer.D": "model-00004-of-00004.safetensors",
|
| 422 |
+
"backbone.layers.37.mixer.conv1d.bias": "model-00004-of-00004.safetensors",
|
| 423 |
+
"backbone.layers.37.mixer.conv1d.weight": "model-00004-of-00004.safetensors",
|
| 424 |
+
"backbone.layers.37.mixer.dt_bias": "model-00004-of-00004.safetensors",
|
| 425 |
+
"backbone.layers.37.mixer.in_proj.weight": "model-00004-of-00004.safetensors",
|
| 426 |
+
"backbone.layers.37.mixer.in_proj_norm.weight": "model-00004-of-00004.safetensors",
|
| 427 |
+
"backbone.layers.37.mixer.norm.weight": "model-00004-of-00004.safetensors",
|
| 428 |
+
"backbone.layers.37.mixer.out_proj.weight": "model-00004-of-00004.safetensors",
|
| 429 |
+
"backbone.layers.38.mixer.experts.0.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 430 |
+
"backbone.layers.38.mixer.experts.0.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 431 |
+
"backbone.layers.38.mixer.experts.1.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 432 |
+
"backbone.layers.38.mixer.experts.1.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 433 |
+
"backbone.layers.38.mixer.experts.2.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 434 |
+
"backbone.layers.38.mixer.experts.2.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 435 |
+
"backbone.layers.38.mixer.experts.3.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 436 |
+
"backbone.layers.38.mixer.experts.3.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 437 |
+
"backbone.layers.38.mixer.experts.4.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 438 |
+
"backbone.layers.38.mixer.experts.4.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 439 |
+
"backbone.layers.38.mixer.experts.5.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 440 |
+
"backbone.layers.38.mixer.experts.5.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 441 |
+
"backbone.layers.38.mixer.experts.6.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 442 |
+
"backbone.layers.38.mixer.experts.6.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 443 |
+
"backbone.layers.38.mixer.experts.7.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 444 |
+
"backbone.layers.38.mixer.experts.7.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 445 |
+
"backbone.layers.38.mixer.gate.weight": "model-00004-of-00004.safetensors",
|
| 446 |
+
"backbone.layers.38.norm.weight": "model-00004-of-00004.safetensors",
|
| 447 |
+
"backbone.layers.38.pre_mlp_norm.weight": "model-00004-of-00004.safetensors",
|
| 448 |
+
"backbone.layers.39.mixer.A_log": "model-00004-of-00004.safetensors",
|
| 449 |
+
"backbone.layers.39.mixer.D": "model-00004-of-00004.safetensors",
|
| 450 |
+
"backbone.layers.39.mixer.conv1d.bias": "model-00004-of-00004.safetensors",
|
| 451 |
+
"backbone.layers.39.mixer.conv1d.weight": "model-00004-of-00004.safetensors",
|
| 452 |
+
"backbone.layers.39.mixer.dt_bias": "model-00004-of-00004.safetensors",
|
| 453 |
+
"backbone.layers.39.mixer.in_proj.weight": "model-00004-of-00004.safetensors",
|
| 454 |
+
"backbone.layers.39.mixer.in_proj_norm.weight": "model-00004-of-00004.safetensors",
|
| 455 |
+
"backbone.layers.39.mixer.norm.weight": "model-00004-of-00004.safetensors",
|
| 456 |
+
"backbone.layers.39.mixer.out_proj.weight": "model-00004-of-00004.safetensors",
|
| 457 |
+
"backbone.layers.4.mixer.A_log": "model-00001-of-00004.safetensors",
|
| 458 |
+
"backbone.layers.4.mixer.D": "model-00001-of-00004.safetensors",
|
| 459 |
+
"backbone.layers.4.mixer.conv1d.bias": "model-00001-of-00004.safetensors",
|
| 460 |
+
"backbone.layers.4.mixer.conv1d.weight": "model-00001-of-00004.safetensors",
|
| 461 |
+
"backbone.layers.4.mixer.dt_bias": "model-00001-of-00004.safetensors",
|
| 462 |
+
"backbone.layers.4.mixer.in_proj.weight": "model-00001-of-00004.safetensors",
|
| 463 |
+
"backbone.layers.4.mixer.in_proj_norm.weight": "model-00001-of-00004.safetensors",
|
| 464 |
+
"backbone.layers.4.mixer.norm.weight": "model-00001-of-00004.safetensors",
|
| 465 |
+
"backbone.layers.4.mixer.out_proj.weight": "model-00001-of-00004.safetensors",
|
| 466 |
+
"backbone.layers.40.mixer.experts.0.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 467 |
+
"backbone.layers.40.mixer.experts.0.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 468 |
+
"backbone.layers.40.mixer.experts.1.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 469 |
+
"backbone.layers.40.mixer.experts.1.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 470 |
+
"backbone.layers.40.mixer.experts.2.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 471 |
+
"backbone.layers.40.mixer.experts.2.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 472 |
+
"backbone.layers.40.mixer.experts.3.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 473 |
+
"backbone.layers.40.mixer.experts.3.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 474 |
+
"backbone.layers.40.mixer.experts.4.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 475 |
+
"backbone.layers.40.mixer.experts.4.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 476 |
+
"backbone.layers.40.mixer.experts.5.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 477 |
+
"backbone.layers.40.mixer.experts.5.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 478 |
+
"backbone.layers.40.mixer.experts.6.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 479 |
+
"backbone.layers.40.mixer.experts.6.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 480 |
+
"backbone.layers.40.mixer.experts.7.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 481 |
+
"backbone.layers.40.mixer.experts.7.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 482 |
+
"backbone.layers.40.mixer.gate.weight": "model-00004-of-00004.safetensors",
|
| 483 |
+
"backbone.layers.40.norm.weight": "model-00004-of-00004.safetensors",
|
| 484 |
+
"backbone.layers.40.pre_mlp_norm.weight": "model-00004-of-00004.safetensors",
|
| 485 |
+
"backbone.layers.41.mixer.A_log": "model-00004-of-00004.safetensors",
|
| 486 |
+
"backbone.layers.41.mixer.D": "model-00004-of-00004.safetensors",
|
| 487 |
+
"backbone.layers.41.mixer.conv1d.bias": "model-00004-of-00004.safetensors",
|
| 488 |
+
"backbone.layers.41.mixer.conv1d.weight": "model-00004-of-00004.safetensors",
|
| 489 |
+
"backbone.layers.41.mixer.dt_bias": "model-00004-of-00004.safetensors",
|
| 490 |
+
"backbone.layers.41.mixer.in_proj.weight": "model-00004-of-00004.safetensors",
|
| 491 |
+
"backbone.layers.41.mixer.in_proj_norm.weight": "model-00004-of-00004.safetensors",
|
| 492 |
+
"backbone.layers.41.mixer.norm.weight": "model-00004-of-00004.safetensors",
|
| 493 |
+
"backbone.layers.41.mixer.out_proj.weight": "model-00004-of-00004.safetensors",
|
| 494 |
+
"backbone.layers.5.mixer.experts.0.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 495 |
+
"backbone.layers.5.mixer.experts.0.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 496 |
+
"backbone.layers.5.mixer.experts.1.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 497 |
+
"backbone.layers.5.mixer.experts.1.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 498 |
+
"backbone.layers.5.mixer.experts.2.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 499 |
+
"backbone.layers.5.mixer.experts.2.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 500 |
+
"backbone.layers.5.mixer.experts.3.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 501 |
+
"backbone.layers.5.mixer.experts.3.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 502 |
+
"backbone.layers.5.mixer.experts.4.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 503 |
+
"backbone.layers.5.mixer.experts.4.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 504 |
+
"backbone.layers.5.mixer.experts.5.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 505 |
+
"backbone.layers.5.mixer.experts.5.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 506 |
+
"backbone.layers.5.mixer.experts.6.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 507 |
+
"backbone.layers.5.mixer.experts.6.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 508 |
+
"backbone.layers.5.mixer.experts.7.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 509 |
+
"backbone.layers.5.mixer.experts.7.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 510 |
+
"backbone.layers.5.mixer.gate.weight": "model-00001-of-00004.safetensors",
|
| 511 |
+
"backbone.layers.5.norm.weight": "model-00001-of-00004.safetensors",
|
| 512 |
+
"backbone.layers.5.pre_mlp_norm.weight": "model-00001-of-00004.safetensors",
|
| 513 |
+
"backbone.layers.6.mixer.A_log": "model-00001-of-00004.safetensors",
|
| 514 |
+
"backbone.layers.6.mixer.D": "model-00001-of-00004.safetensors",
|
| 515 |
+
"backbone.layers.6.mixer.conv1d.bias": "model-00001-of-00004.safetensors",
|
| 516 |
+
"backbone.layers.6.mixer.conv1d.weight": "model-00001-of-00004.safetensors",
|
| 517 |
+
"backbone.layers.6.mixer.dt_bias": "model-00001-of-00004.safetensors",
|
| 518 |
+
"backbone.layers.6.mixer.in_proj.weight": "model-00001-of-00004.safetensors",
|
| 519 |
+
"backbone.layers.6.mixer.in_proj_norm.weight": "model-00001-of-00004.safetensors",
|
| 520 |
+
"backbone.layers.6.mixer.norm.weight": "model-00001-of-00004.safetensors",
|
| 521 |
+
"backbone.layers.6.mixer.out_proj.weight": "model-00001-of-00004.safetensors",
|
| 522 |
+
"backbone.layers.7.mixer.experts.0.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 523 |
+
"backbone.layers.7.mixer.experts.0.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 524 |
+
"backbone.layers.7.mixer.experts.1.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 525 |
+
"backbone.layers.7.mixer.experts.1.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 526 |
+
"backbone.layers.7.mixer.experts.2.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 527 |
+
"backbone.layers.7.mixer.experts.2.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 528 |
+
"backbone.layers.7.mixer.experts.3.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 529 |
+
"backbone.layers.7.mixer.experts.3.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 530 |
+
"backbone.layers.7.mixer.experts.4.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 531 |
+
"backbone.layers.7.mixer.experts.4.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 532 |
+
"backbone.layers.7.mixer.experts.5.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 533 |
+
"backbone.layers.7.mixer.experts.5.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 534 |
+
"backbone.layers.7.mixer.experts.6.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 535 |
+
"backbone.layers.7.mixer.experts.6.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 536 |
+
"backbone.layers.7.mixer.experts.7.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 537 |
+
"backbone.layers.7.mixer.experts.7.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 538 |
+
"backbone.layers.7.mixer.gate.weight": "model-00001-of-00004.safetensors",
|
| 539 |
+
"backbone.layers.7.norm.weight": "model-00001-of-00004.safetensors",
|
| 540 |
+
"backbone.layers.7.pre_mlp_norm.weight": "model-00001-of-00004.safetensors",
|
| 541 |
+
"backbone.layers.8.mixer.k_proj.weight": "model-00001-of-00004.safetensors",
|
| 542 |
+
"backbone.layers.8.mixer.o_proj.weight": "model-00001-of-00004.safetensors",
|
| 543 |
+
"backbone.layers.8.mixer.q_proj.weight": "model-00001-of-00004.safetensors",
|
| 544 |
+
"backbone.layers.8.mixer.qkv_norm.weight": "model-00001-of-00004.safetensors",
|
| 545 |
+
"backbone.layers.8.mixer.v_proj.weight": "model-00001-of-00004.safetensors",
|
| 546 |
+
"backbone.layers.8.norm.weight": "model-00001-of-00004.safetensors",
|
| 547 |
+
"backbone.layers.8.pre_mlp_norm.weight": "model-00001-of-00004.safetensors",
|
| 548 |
+
"backbone.layers.9.mixer.experts.0.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 549 |
+
"backbone.layers.9.mixer.experts.0.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 550 |
+
"backbone.layers.9.mixer.experts.1.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 551 |
+
"backbone.layers.9.mixer.experts.1.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 552 |
+
"backbone.layers.9.mixer.experts.2.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 553 |
+
"backbone.layers.9.mixer.experts.2.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 554 |
+
"backbone.layers.9.mixer.experts.3.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 555 |
+
"backbone.layers.9.mixer.experts.3.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 556 |
+
"backbone.layers.9.mixer.experts.4.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 557 |
+
"backbone.layers.9.mixer.experts.4.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 558 |
+
"backbone.layers.9.mixer.experts.5.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 559 |
+
"backbone.layers.9.mixer.experts.5.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 560 |
+
"backbone.layers.9.mixer.experts.6.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 561 |
+
"backbone.layers.9.mixer.experts.6.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 562 |
+
"backbone.layers.9.mixer.experts.7.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 563 |
+
"backbone.layers.9.mixer.experts.7.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 564 |
+
"backbone.layers.9.mixer.gate.weight": "model-00001-of-00004.safetensors",
|
| 565 |
+
"backbone.layers.9.norm.weight": "model-00001-of-00004.safetensors",
|
| 566 |
+
"backbone.layers.9.pre_mlp_norm.weight": "model-00001-of-00004.safetensors",
|
| 567 |
+
"backbone.norm_f.weight": "model-00004-of-00004.safetensors",
|
| 568 |
+
"lm_head.weight": "model-00004-of-00004.safetensors"
|
| 569 |
+
}
|
| 570 |
+
}
|
modeling_ceno.py
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"eos_token": "<eos>",
|
| 3 |
+
"pad_token": "<pad>",
|
| 4 |
+
"unk_token": "<unk>"
|
| 5 |
+
}
|
third_party/TransformerEngine-LICENSE
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tokenizer_class": "CENOCharLevelTokenizer",
|
| 3 |
+
"vocab_size": 512,
|
| 4 |
+
"eos_token": "<eos>",
|
| 5 |
+
"pad_token": "<pad>",
|
| 6 |
+
"unk_token": "<unk>",
|
| 7 |
+
"eod_id": 0,
|
| 8 |
+
"eos_id": 0,
|
| 9 |
+
"pad_id": 1,
|
| 10 |
+
"unk_id": 2,
|
| 11 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 12 |
+
"clean_up_tokenization_spaces": true,
|
| 13 |
+
"tokenize_chinese_chars": false,
|
| 14 |
+
"strip_accents": null,
|
| 15 |
+
"do_lower_case": false,
|
| 16 |
+
"do_basic_tokenize": false,
|
| 17 |
+
"never_split": null,
|
| 18 |
+
"tokenizer_type": "CharLevelTokenizer",
|
| 19 |
+
"name_or_path": "./ceno_tokenizer",
|
| 20 |
+
"auto_map": {
|
| 21 |
+
"AutoTokenizer": [
|
| 22 |
+
"ceno_tokenizer.CENOCharLevelTokenizer",
|
| 23 |
+
null
|
| 24 |
+
]
|
| 25 |
+
}
|
| 26 |
+
}
|
training_precision.py
ADDED
|
@@ -0,0 +1,654 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Opt-in HF inference against the same BF16 Megatron reference as vLLM.
|
| 2 |
+
|
| 3 |
+
Use from the repository with the existing training image (Mamba 2.2.4 / FA2).
|
| 4 |
+
Defaults in exported checkpoints are unchanged. This adapter is inference-only,
|
| 5 |
+
single-GPU, BF16, unpadded uniform-length batches. Its prefill token budget is
|
| 6 |
+
bounded to avoid the old Mamba kernels' large-stride indexing paths.
|
| 7 |
+
"""
|
| 8 |
+
import contextlib
|
| 9 |
+
import contextvars
|
| 10 |
+
import functools
|
| 11 |
+
import os
|
| 12 |
+
import types
|
| 13 |
+
|
| 14 |
+
_CHUNK = 128
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def _local_module(name):
|
| 18 |
+
import importlib
|
| 19 |
+
return importlib.import_module(f"{__package__}.{name}" if __package__ else name)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def configure_backend():
|
| 23 |
+
"""Set the cuBLASLt workspace limit; call before the first CUDA GEMM.
|
| 24 |
+
|
| 25 |
+
The reference GEMMs run through cuBLASLt (see ``backend_scope``) with a
|
| 26 |
+
1 KiB workspace, which is what fixes their algorithm and hence their bits.
|
| 27 |
+
That is the only process-level setting. ``CUBLAS_WORKSPACE_CONFIG`` is not
|
| 28 |
+
set: it only sizes the legacy cuBLAS handle workspace, which these GEMMs do
|
| 29 |
+
not use (outputs are bit-identical with or without it), and under torch 2.7
|
| 30 |
+
it adds ~30-40 us of host time to every GEMM call, the main cost of B=1
|
| 31 |
+
decode. The torch backend flags are applied only inside precision-enabled
|
| 32 |
+
forwards, so the surrounding program (e.g. an FP32 head trained with TF32)
|
| 33 |
+
keeps its own settings.
|
| 34 |
+
"""
|
| 35 |
+
os.environ["CUBLASLT_WORKSPACE_SIZE"] = "1"
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
@contextlib.contextmanager
|
| 39 |
+
def backend_scope():
|
| 40 |
+
"""Apply the reference GEMM flags inside the block and restore them on exit."""
|
| 41 |
+
import torch
|
| 42 |
+
matmul, cudnn = torch.backends.cuda.matmul, torch.backends.cudnn
|
| 43 |
+
has_cuda = torch.version.cuda is not None
|
| 44 |
+
saved = (matmul.allow_bf16_reduced_precision_reduction,
|
| 45 |
+
matmul.allow_fp16_reduced_precision_reduction,
|
| 46 |
+
matmul.allow_tf32, cudnn.allow_tf32,
|
| 47 |
+
torch.backends.cuda.preferred_blas_library() if has_cuda else None)
|
| 48 |
+
matmul.allow_bf16_reduced_precision_reduction = False
|
| 49 |
+
matmul.allow_fp16_reduced_precision_reduction = False
|
| 50 |
+
matmul.allow_tf32 = False
|
| 51 |
+
cudnn.allow_tf32 = False
|
| 52 |
+
if has_cuda:
|
| 53 |
+
torch.backends.cuda.preferred_blas_library("cublaslt")
|
| 54 |
+
try:
|
| 55 |
+
yield
|
| 56 |
+
finally:
|
| 57 |
+
(matmul.allow_bf16_reduced_precision_reduction,
|
| 58 |
+
matmul.allow_fp16_reduced_precision_reduction,
|
| 59 |
+
matmul.allow_tf32, cudnn.allow_tf32) = saved[:4]
|
| 60 |
+
if has_cuda:
|
| 61 |
+
torch.backends.cuda.preferred_blas_library(saved[4])
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def _pin_scan():
|
| 65 |
+
from mamba_ssm.ops.triton import ssd_bmm, ssd_chunk_scan, ssd_chunk_state, ssd_state_passing
|
| 66 |
+
choices = [
|
| 67 |
+
(ssd_chunk_state, "_chunk_cumsum_fwd_kernel", {"BLOCK_SIZE_H": 4}, 4, 2),
|
| 68 |
+
(ssd_chunk_state, "_chunk_state_fwd_kernel",
|
| 69 |
+
{"BLOCK_SIZE_M": 64, "BLOCK_SIZE_N": 128, "BLOCK_SIZE_K": 32}, 4, 4),
|
| 70 |
+
(ssd_chunk_scan, "_chunk_scan_fwd_kernel",
|
| 71 |
+
{"BLOCK_SIZE_M": 128, "BLOCK_SIZE_N": 64, "BLOCK_SIZE_K": 32}, 4, 4),
|
| 72 |
+
(ssd_bmm, "_bmm_chunk_fwd_kernel",
|
| 73 |
+
{"BLOCK_SIZE_M": 64, "BLOCK_SIZE_N": 64, "BLOCK_SIZE_K": 32}, 2, 4),
|
| 74 |
+
(ssd_state_passing, "_state_passing_fwd_kernel", {"BLOCK_SIZE": 256}, 4, 2),
|
| 75 |
+
]
|
| 76 |
+
for module, name, wanted, warps, stages in choices:
|
| 77 |
+
kernel = getattr(module, name)
|
| 78 |
+
matches = [c for c in kernel.configs if c.kwargs == wanted
|
| 79 |
+
and c.num_warps == warps and c.num_stages == stages]
|
| 80 |
+
if len(matches) != 1:
|
| 81 |
+
raise RuntimeError(f"Unsupported HF Mamba kernel profile: {name}")
|
| 82 |
+
kernel.configs[:] = matches
|
| 83 |
+
kernel.cache.clear()
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def _cache_buffers(cache):
|
| 87 |
+
if not hasattr(cache, "_ceno_chunks"):
|
| 88 |
+
cache._ceno_chunks = {}
|
| 89 |
+
original = cache.reorder_cache
|
| 90 |
+
|
| 91 |
+
def reorder(beam_idx):
|
| 92 |
+
result = original(beam_idx)
|
| 93 |
+
for state in cache._ceno_chunks.values():
|
| 94 |
+
for key in ("initial", "x", "dt", "B", "C", "z"):
|
| 95 |
+
value = state[key]
|
| 96 |
+
state[key] = value.index_select(0, beam_idx.to(value.device))
|
| 97 |
+
state["states_in"] = None # derived from "initial"; rebuild lazily
|
| 98 |
+
return result
|
| 99 |
+
|
| 100 |
+
cache.reorder_cache = reorder
|
| 101 |
+
return cache._ceno_chunks
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
def _install_scan_hooks(module):
|
| 105 |
+
"""Namespace hooks are inactive unless a precision-enabled mixer sets context."""
|
| 106 |
+
import importlib
|
| 107 |
+
import torch
|
| 108 |
+
if hasattr(module, "_ceno_scan_context"):
|
| 109 |
+
return module._ceno_scan_context
|
| 110 |
+
context = contextvars.ContextVar("ceno_hf_mixer", default=None)
|
| 111 |
+
scan, update = module.mamba_chunk_scan_combined, module.selective_state_update
|
| 112 |
+
|
| 113 |
+
def scan_with_cache(x, dt, A, B, C, *args, **kwargs):
|
| 114 |
+
result = scan(x, dt, A, B, C, *args, **kwargs)
|
| 115 |
+
active = context.get()
|
| 116 |
+
if active is None or active[1] is None:
|
| 117 |
+
return result
|
| 118 |
+
mixer, cache = active
|
| 119 |
+
z = kwargs.get("z")
|
| 120 |
+
if z is None or result[1].dtype != torch.float32:
|
| 121 |
+
raise ValueError("HF precision needs the training gate and FP32 final state")
|
| 122 |
+
batch, length, heads, dim = x.shape
|
| 123 |
+
groups, state_dim = B.shape[2:]
|
| 124 |
+
count = length % _CHUNK
|
| 125 |
+
complete = length - count
|
| 126 |
+
if count == 0:
|
| 127 |
+
initial = result[1].clone()
|
| 128 |
+
elif complete:
|
| 129 |
+
prefix_kwargs = dict(kwargs, z=z[:, :complete].contiguous())
|
| 130 |
+
initial = scan(x[:, :complete].contiguous(), dt[:, :complete].contiguous(),
|
| 131 |
+
A, B[:, :complete].contiguous(), C[:, :complete].contiguous(),
|
| 132 |
+
*args, **prefix_kwargs)[1]
|
| 133 |
+
else:
|
| 134 |
+
initial = torch.zeros_like(result[1])
|
| 135 |
+
state = {"initial": initial, "pos": count, "states_in": None}
|
| 136 |
+
values = {"x": x, "dt": dt, "B": B, "C": C, "z": z}
|
| 137 |
+
for key, value in values.items():
|
| 138 |
+
buffer = torch.zeros((batch, _CHUNK, *value.shape[2:]),
|
| 139 |
+
device=x.device, dtype=value.dtype)
|
| 140 |
+
if count:
|
| 141 |
+
buffer[:, :count].copy_(value[:, -count:])
|
| 142 |
+
state[key] = buffer
|
| 143 |
+
_cache_buffers(cache)[mixer.layer_idx] = state
|
| 144 |
+
return result
|
| 145 |
+
|
| 146 |
+
# The combined scan's own building blocks. Off the chunk boundary only the
|
| 147 |
+
# output row is needed, so chunk_state/state_passing (which only produce the
|
| 148 |
+
# final state) are skipped; the remaining calls receive exactly the inputs the
|
| 149 |
+
# combined forward would pass them, so the row is bit-identical.
|
| 150 |
+
parts = importlib.import_module(scan.__module__)
|
| 151 |
+
fast = all(hasattr(parts, name) for name in
|
| 152 |
+
("_chunk_cumsum_fwd", "_bmm_chunk_fwd", "_chunk_scan_fwd", "_state_passing_fwd"))
|
| 153 |
+
|
| 154 |
+
def chunk_row(mixer, state, pos):
|
| 155 |
+
if state.get("states_in") is None:
|
| 156 |
+
# Entering-chunk state exactly as _state_passing_fwd emits it for chunk 0
|
| 157 |
+
# (FP32 initial stored in C's dtype).
|
| 158 |
+
initial = state["initial"]
|
| 159 |
+
batch, heads, dim, dstate = initial.shape
|
| 160 |
+
flat = initial.reshape(batch, heads, dim * dstate)
|
| 161 |
+
out, _ = parts._state_passing_fwd(
|
| 162 |
+
torch.zeros((batch, 1, heads, dim * dstate), device=flat.device, dtype=torch.float32),
|
| 163 |
+
torch.zeros((batch, heads, 1), device=flat.device, dtype=torch.float32),
|
| 164 |
+
initial_states=flat, chunk_size=_CHUNK, out_dtype=state["C"].dtype)
|
| 165 |
+
state["states_in"] = out.view(batch, 1, heads, dim, dstate)
|
| 166 |
+
dA_cumsum, dt = parts._chunk_cumsum_fwd(
|
| 167 |
+
state["dt"], state["A"], _CHUNK, dt_bias=mixer.dt_bias, dt_softplus=True,
|
| 168 |
+
dt_limit=mixer.time_step_limit)
|
| 169 |
+
CB = parts._bmm_chunk_fwd(state["C"], state["B"], _CHUNK, seq_idx=None,
|
| 170 |
+
output_dtype=torch.float32)
|
| 171 |
+
D = mixer.D if mixer.D.stride(-1) == 1 else mixer.D.contiguous()
|
| 172 |
+
out, _ = parts._chunk_scan_fwd(CB, state["x"], dt, dA_cumsum, state["C"],
|
| 173 |
+
state["states_in"], D=D, z=state["z"], seq_idx=None)
|
| 174 |
+
return out[:, pos]
|
| 175 |
+
|
| 176 |
+
def update_from_chunk(state_tensor, x, dt, A, B, C, D, *args, **kwargs):
|
| 177 |
+
active = context.get()
|
| 178 |
+
if active is None:
|
| 179 |
+
return update(state_tensor, x, dt, A, B, C, D, *args, **kwargs)
|
| 180 |
+
mixer, cache = active
|
| 181 |
+
state = _cache_buffers(cache)[mixer.layer_idx]
|
| 182 |
+
state["decoded"] = True # decode kernels have run eagerly once (graph warm-up)
|
| 183 |
+
pos = state["pos"]
|
| 184 |
+
# The recurrent update's output was never used and state_tensor is only
|
| 185 |
+
# read back at the chunk boundary below, so it is not run per token.
|
| 186 |
+
for key, value in (("x", x), ("dt", dt[:, :, 0]), ("B", B), ("C", C),
|
| 187 |
+
("z", kwargs["z"])):
|
| 188 |
+
if pos == 0:
|
| 189 |
+
state[key].zero_()
|
| 190 |
+
state[key][:, pos].copy_(value)
|
| 191 |
+
if "A" not in state:
|
| 192 |
+
state["A"] = -torch.exp(mixer.A_log.float())
|
| 193 |
+
if pos == _CHUNK - 1 or not fast:
|
| 194 |
+
y, final = scan(state["x"], state["dt"], state["A"],
|
| 195 |
+
state["B"], state["C"], chunk_size=_CHUNK, D=mixer.D,
|
| 196 |
+
z=state["z"], dt_bias=mixer.dt_bias, dt_softplus=True,
|
| 197 |
+
dt_limit=mixer.time_step_limit, initial_states=state["initial"],
|
| 198 |
+
return_final_states=True)
|
| 199 |
+
y = y[:, pos]
|
| 200 |
+
else:
|
| 201 |
+
y = chunk_row(mixer, state, pos)
|
| 202 |
+
if pos == _CHUNK - 1:
|
| 203 |
+
state["initial"].copy_(final)
|
| 204 |
+
state_tensor.copy_(final)
|
| 205 |
+
state["states_in"] = None
|
| 206 |
+
state["pos"] = (pos + 1) % _CHUNK
|
| 207 |
+
return y
|
| 208 |
+
|
| 209 |
+
module.mamba_chunk_scan_combined = scan_with_cache
|
| 210 |
+
module.selective_state_update = update_from_chunk
|
| 211 |
+
module._ceno_scan_context = context
|
| 212 |
+
module._ceno_scan_parts = parts if fast else None
|
| 213 |
+
return context
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
class _DecodeGraph:
|
| 217 |
+
"""Batch-1 cached decode replayed as CUDA graphs, one per span between attention layers.
|
| 218 |
+
|
| 219 |
+
Every kernel is the one the eager decode step launches, with the same shapes and
|
| 220 |
+
inputs, so replay is bit-identical; only the host work is removed. Three eager
|
| 221 |
+
pieces remain: the attention mixers (growing KV cache), the chunk-boundary step
|
| 222 |
+
(full scan, handled by the caller falling back to eager) and the chunk-buffer
|
| 223 |
+
reset at chunk position 0. Two data-dependent host decisions are moved onto the
|
| 224 |
+
device: the chunk position (an index tensor) and the MoE expert loop (every
|
| 225 |
+
expert runs on the single token; a non-selected expert's result is discarded by
|
| 226 |
+
torch.where, a selected one goes through the same index_add_ as eagerly).
|
| 227 |
+
"""
|
| 228 |
+
|
| 229 |
+
_KEYS = ("x", "dt", "B", "C", "z")
|
| 230 |
+
|
| 231 |
+
def __init__(self, model, modeling, cache):
|
| 232 |
+
import torch
|
| 233 |
+
self.model, self.modeling, self.cache = model, modeling, cache
|
| 234 |
+
self.parts = modeling._ceno_scan_parts
|
| 235 |
+
self.layers = model.backbone.layers
|
| 236 |
+
self.chunks = cache._ceno_chunks
|
| 237 |
+
self.mamba = [i for i, b in enumerate(self.layers) if b.block_type == "mamba"]
|
| 238 |
+
self.attention = [i for i, b in enumerate(self.layers) if b.block_type == "attention"]
|
| 239 |
+
self.inference = torch.is_inference_mode_enabled()
|
| 240 |
+
self.key = self._key()
|
| 241 |
+
device = model.device
|
| 242 |
+
self.ids = torch.zeros((1, 1), device=device, dtype=torch.long)
|
| 243 |
+
self.pos = torch.zeros((1,), device=device, dtype=torch.long)
|
| 244 |
+
self.row0 = torch.zeros((1,), device=device, dtype=torch.long)
|
| 245 |
+
hidden = model.config.hidden_size
|
| 246 |
+
self.attn_out = [torch.zeros((1, 1, hidden), device=device, dtype=model.dtype)
|
| 247 |
+
for _ in self.attention]
|
| 248 |
+
self.attn_in, self.attn_res, self.graphs = [None] * len(self.attention), [None] * len(self.attention), []
|
| 249 |
+
self.logits = None
|
| 250 |
+
self._capture()
|
| 251 |
+
|
| 252 |
+
def _key(self):
|
| 253 |
+
import torch
|
| 254 |
+
ptrs = [self.cache.conv_states[i].data_ptr() for i in self.mamba]
|
| 255 |
+
for i in self.mamba:
|
| 256 |
+
state = self.chunks[i]
|
| 257 |
+
ptrs += [state[k].data_ptr() for k in self._KEYS + ("initial", "A")]
|
| 258 |
+
return (torch.is_inference_mode_enabled(), tuple(ptrs))
|
| 259 |
+
|
| 260 |
+
def valid(self, cache):
|
| 261 |
+
return cache is self.cache and self._key() == self.key
|
| 262 |
+
|
| 263 |
+
# ----- graph bodies: same module calls / kernels as the eager decode path -----
|
| 264 |
+
def _mamba(self, i, hidden_states):
|
| 265 |
+
import torch
|
| 266 |
+
mixer, cache, state = self.layers[i].mixer, self.cache, self.chunks[i]
|
| 267 |
+
hidden_states = mixer._maybe_apply_in_proj_norm(hidden_states)
|
| 268 |
+
projected_states = mixer.in_proj(hidden_states)
|
| 269 |
+
batch_size = hidden_states.shape[0]
|
| 270 |
+
groups_time_state_size = mixer.n_groups * mixer.ssm_state_size
|
| 271 |
+
d_mlp = (projected_states.shape[-1] - 2 * mixer.intermediate_size
|
| 272 |
+
- 2 * groups_time_state_size - mixer.num_heads) // 2
|
| 273 |
+
_, _, gate, hidden_states_B_C, dt = projected_states.squeeze(1).split(
|
| 274 |
+
[d_mlp, d_mlp, mixer.intermediate_size, mixer.conv_dim, mixer.num_heads], dim=-1)
|
| 275 |
+
hidden_states_B_C = self.modeling.causal_conv1d_update(
|
| 276 |
+
hidden_states_B_C, cache.conv_states[i], mixer.conv1d.weight.squeeze(1),
|
| 277 |
+
mixer.conv1d.bias, mixer.activation)
|
| 278 |
+
x, B, C = torch.split(hidden_states_B_C,
|
| 279 |
+
[mixer.intermediate_size, groups_time_state_size, groups_time_state_size], dim=-1)
|
| 280 |
+
values = (x.view(batch_size, mixer.num_heads, mixer.head_dim), dt,
|
| 281 |
+
B.view(batch_size, mixer.n_groups, -1), C.view(batch_size, mixer.n_groups, -1),
|
| 282 |
+
gate.view(batch_size, mixer.num_heads, mixer.head_dim))
|
| 283 |
+
for key, value in zip(self._KEYS, values):
|
| 284 |
+
state[key].index_copy_(1, self.pos, value.unsqueeze(1))
|
| 285 |
+
parts = self.parts
|
| 286 |
+
initial = state["initial"]
|
| 287 |
+
batch, heads, dim, dstate = initial.shape
|
| 288 |
+
flat = initial.reshape(batch, heads, dim * dstate)
|
| 289 |
+
states_in, _ = parts._state_passing_fwd(
|
| 290 |
+
torch.zeros((batch, 1, heads, dim * dstate), device=flat.device, dtype=torch.float32),
|
| 291 |
+
torch.zeros((batch, heads, 1), device=flat.device, dtype=torch.float32),
|
| 292 |
+
initial_states=flat, chunk_size=_CHUNK, out_dtype=state["C"].dtype)
|
| 293 |
+
states_in = states_in.view(batch, 1, heads, dim, dstate)
|
| 294 |
+
dA_cumsum, dt = parts._chunk_cumsum_fwd(
|
| 295 |
+
state["dt"], state["A"], _CHUNK, dt_bias=mixer.dt_bias, dt_softplus=True,
|
| 296 |
+
dt_limit=mixer.time_step_limit)
|
| 297 |
+
CB = parts._bmm_chunk_fwd(state["C"], state["B"], _CHUNK, seq_idx=None, output_dtype=torch.float32)
|
| 298 |
+
D = mixer.D if mixer.D.stride(-1) == 1 else mixer.D.contiguous()
|
| 299 |
+
out, _ = parts._chunk_scan_fwd(CB, state["x"], dt, dA_cumsum, state["C"], states_in,
|
| 300 |
+
D=D, z=state["z"], seq_idx=None)
|
| 301 |
+
y = out.index_select(1, self.pos).view(batch_size, mixer.num_heads * mixer.head_dim)
|
| 302 |
+
y = mixer.norm(y, None)
|
| 303 |
+
return mixer.out_proj(y)[:, None, ...]
|
| 304 |
+
|
| 305 |
+
def _moe(self, moe, hidden_states):
|
| 306 |
+
import torch
|
| 307 |
+
batch_size, seq_len, hidden_dim = hidden_states.shape
|
| 308 |
+
router_softmax = getattr(moe, "_ceno_router_softmax", torch.nn.functional.softmax)
|
| 309 |
+
flat = hidden_states.view(-1, hidden_dim)
|
| 310 |
+
if str(getattr(moe.config, "moe_router_dtype", "")).lower() == "fp32":
|
| 311 |
+
router_logits = torch.nn.functional.linear(flat.to(torch.float32), moe.gate.weight.to(torch.float32), bias=None)
|
| 312 |
+
else:
|
| 313 |
+
router_logits = moe.gate(flat).to(torch.float32)
|
| 314 |
+
topk_logits, selected = torch.topk(router_logits, moe.top_k, dim=-1)
|
| 315 |
+
weights = router_softmax(topk_logits, dim=-1)
|
| 316 |
+
final = torch.zeros_like(flat)
|
| 317 |
+
for expert_idx in range(moe.num_experts):
|
| 318 |
+
hit = selected[0] == expert_idx # (top_k,)
|
| 319 |
+
weight = torch.where(hit, weights[0], 0.).sum().view(1, 1).to(flat.dtype)
|
| 320 |
+
out = moe.experts[expert_idx](flat, per_token_scale=weight)
|
| 321 |
+
added = final.index_add(0, self.row0, out.to(hidden_states.dtype))
|
| 322 |
+
final = torch.where(hit.any(), added, final)
|
| 323 |
+
return final.view(batch_size, seq_len, hidden_dim)
|
| 324 |
+
|
| 325 |
+
def _span(self, start, end, hidden_states):
|
| 326 |
+
for i in range(start, end):
|
| 327 |
+
block = self.layers[i]
|
| 328 |
+
if block.block_type == "mamba":
|
| 329 |
+
residual = hidden_states
|
| 330 |
+
if block.norm is not None:
|
| 331 |
+
hidden_states = block.norm(hidden_states.to(dtype=block.norm.weight.dtype))
|
| 332 |
+
if block.residual_in_fp32:
|
| 333 |
+
residual = residual.to(self._fp32)
|
| 334 |
+
hidden_states = residual + self._mamba(i, hidden_states)
|
| 335 |
+
elif block.block_type in ("moe", "mlp"):
|
| 336 |
+
input_ln_out = block.norm(hidden_states.to(dtype=block.norm.weight.dtype))
|
| 337 |
+
residual = input_ln_out
|
| 338 |
+
if block.residual_in_fp32:
|
| 339 |
+
residual = residual.to(self._fp32)
|
| 340 |
+
pre = block.pre_mlp_norm(input_ln_out.to(dtype=block.pre_mlp_norm.weight.dtype))
|
| 341 |
+
out = self._moe(block.mixer, pre) if block.block_type == "moe" else block.mixer(pre)
|
| 342 |
+
hidden_states = residual + out
|
| 343 |
+
else:
|
| 344 |
+
raise RuntimeError("attention layers are span boundaries")
|
| 345 |
+
return hidden_states
|
| 346 |
+
|
| 347 |
+
def _segment(self, k):
|
| 348 |
+
"""Span k: after attention k-1 (or the embedding) up to attention k's input norm."""
|
| 349 |
+
bounds = [-1] + self.attention + [len(self.layers)]
|
| 350 |
+
start, end = bounds[k] + 1, bounds[k + 1]
|
| 351 |
+
if k == 0:
|
| 352 |
+
hidden_states = self.model.backbone.embeddings(self.ids)
|
| 353 |
+
else:
|
| 354 |
+
block = self.layers[bounds[k]]
|
| 355 |
+
hidden_states = self.attn_res[k - 1] + self.attn_out[k - 1]
|
| 356 |
+
hidden_states = block.pre_mlp_norm(hidden_states.to(dtype=block.pre_mlp_norm.weight.dtype))
|
| 357 |
+
hidden_states = self._span(start, end, hidden_states)
|
| 358 |
+
if k < len(self.attention):
|
| 359 |
+
block = self.layers[end]
|
| 360 |
+
residual = hidden_states
|
| 361 |
+
self.attn_in[k] = block.norm(hidden_states.to(dtype=block.norm.weight.dtype))
|
| 362 |
+
self.attn_res[k] = residual.to(self._fp32) if block.residual_in_fp32 else residual
|
| 363 |
+
else:
|
| 364 |
+
hidden_states = self.model.backbone.norm_f(hidden_states)
|
| 365 |
+
lm_head = self.model.lm_head
|
| 366 |
+
self.logits = lm_head(hidden_states.to(lm_head.weight.dtype)).float()
|
| 367 |
+
|
| 368 |
+
def _capture(self):
|
| 369 |
+
import torch
|
| 370 |
+
self._fp32 = torch.float32
|
| 371 |
+
segments = len(self.attention) + 1
|
| 372 |
+
# The warm-up really runs the bodies: it shifts the conv states and writes the
|
| 373 |
+
# chunk buffers. Snapshot everything it can write and restore it afterwards.
|
| 374 |
+
mutable = [self.cache.conv_states[i] for i in self.mamba]
|
| 375 |
+
mutable += [self.chunks[i][key] for i in self.mamba for key in self._KEYS]
|
| 376 |
+
snapshot = [t.clone() for t in mutable]
|
| 377 |
+
stream = torch.cuda.Stream()
|
| 378 |
+
stream.wait_stream(torch.cuda.current_stream())
|
| 379 |
+
with torch.cuda.stream(stream):
|
| 380 |
+
for k in range(segments):
|
| 381 |
+
self._segment(k)
|
| 382 |
+
torch.cuda.current_stream().wait_stream(stream)
|
| 383 |
+
for tensor, saved in zip(mutable, snapshot):
|
| 384 |
+
tensor.copy_(saved)
|
| 385 |
+
del snapshot
|
| 386 |
+
pool = torch.cuda.graph_pool_handle()
|
| 387 |
+
for k in range(segments):
|
| 388 |
+
graph = torch.cuda.CUDAGraph()
|
| 389 |
+
with torch.cuda.graph(graph, pool=pool, stream=stream):
|
| 390 |
+
self._segment(k)
|
| 391 |
+
self.graphs.append(graph)
|
| 392 |
+
torch.cuda.synchronize()
|
| 393 |
+
|
| 394 |
+
def step(self, input_ids, pos):
|
| 395 |
+
if pos == 0:
|
| 396 |
+
for i in self.mamba:
|
| 397 |
+
for key in self._KEYS:
|
| 398 |
+
self.chunks[i][key].zero_()
|
| 399 |
+
self.ids.copy_(input_ids)
|
| 400 |
+
self.pos.fill_(pos)
|
| 401 |
+
for k, graph in enumerate(self.graphs):
|
| 402 |
+
graph.replay()
|
| 403 |
+
if k < len(self.attention):
|
| 404 |
+
mixer = self.layers[self.attention[k]].mixer
|
| 405 |
+
out = mixer(self.attn_in[k], attention_mask=None, past_key_value=self.cache,
|
| 406 |
+
use_cache=True, cache_position=None)[0]
|
| 407 |
+
self.attn_out[k].copy_(out)
|
| 408 |
+
for i in self.mamba:
|
| 409 |
+
self.chunks[i]["pos"] = pos + 1
|
| 410 |
+
return self.logits.clone()
|
| 411 |
+
|
| 412 |
+
|
| 413 |
+
def _decode_graph_step(model, modeling, kwargs):
|
| 414 |
+
"""Return logits from the graph path, or None to run the eager forward."""
|
| 415 |
+
if os.environ.get("CENO_HF_DECODE_GRAPH", "1") == "0" or getattr(modeling, "_ceno_scan_parts", None) is None:
|
| 416 |
+
return None
|
| 417 |
+
if any(kwargs.get(k) is not None for k in ("inputs_embeds", "labels", "seq_idx")) or any(
|
| 418 |
+
kwargs.get(k) for k in ("output_attentions", "output_hidden_states")):
|
| 419 |
+
return None
|
| 420 |
+
if kwargs.get("use_cache") is False or (kwargs.get("use_cache") is None and not model.config.use_cache):
|
| 421 |
+
return None
|
| 422 |
+
ids = kwargs.get("input_ids")
|
| 423 |
+
cache = kwargs.get("cache_params") or kwargs.get("past_key_values")
|
| 424 |
+
position = kwargs.get("cache_position")
|
| 425 |
+
if (ids is None or tuple(ids.shape) != (1, 1) or cache is None or position is None
|
| 426 |
+
or position.numel() != 1 or model.config.output_hidden_states or model.config.output_attentions):
|
| 427 |
+
return None
|
| 428 |
+
chunks = getattr(cache, "_ceno_chunks", None)
|
| 429 |
+
layers = model.backbone.layers
|
| 430 |
+
mamba = [i for i, b in enumerate(layers) if b.block_type == "mamba"]
|
| 431 |
+
if not mamba or not chunks or any(i not in chunks or not chunks[i].get("decoded") for i in mamba):
|
| 432 |
+
return None
|
| 433 |
+
positions = {chunks[i]["pos"] for i in mamba}
|
| 434 |
+
if len(positions) != 1 or any(len(cache.key_cache[i].shape) != 4 for i in cache.attention_layers):
|
| 435 |
+
return None
|
| 436 |
+
pos = positions.pop()
|
| 437 |
+
if pos == _CHUNK - 1:
|
| 438 |
+
return None # chunk boundary: full scan in the eager path
|
| 439 |
+
runner = getattr(cache, "_ceno_decode_graph", None)
|
| 440 |
+
with backend_scope():
|
| 441 |
+
if runner is None or not runner.valid(cache):
|
| 442 |
+
runner = cache._ceno_decode_graph = None
|
| 443 |
+
if pos == 0: # the eager reset happens in step(); capture after it
|
| 444 |
+
for i in mamba:
|
| 445 |
+
for key in _DecodeGraph._KEYS:
|
| 446 |
+
chunks[i][key].zero_()
|
| 447 |
+
runner = cache._ceno_decode_graph = _DecodeGraph(model, modeling, cache)
|
| 448 |
+
return runner.step(ids, pos)
|
| 449 |
+
|
| 450 |
+
|
| 451 |
+
def _attention(q, k, v, causal):
|
| 452 |
+
"""Ordinary FA2 always; dense FA2 can change arithmetic with query length."""
|
| 453 |
+
import torch
|
| 454 |
+
from flash_attn.flash_attn_interface import _flash_attn_varlen_forward
|
| 455 |
+
q, k, v = q.contiguous(), k.contiguous(), v.contiguous()
|
| 456 |
+
# Build [0, n] on the device: torch.tensor(..., device=cuda) copies from
|
| 457 |
+
# pageable host memory and synchronizes the stream on every call.
|
| 458 |
+
steps = torch.arange(2, device=q.device, dtype=torch.int32)
|
| 459 |
+
cuq, cuk = steps * len(q), steps * len(k)
|
| 460 |
+
result = _flash_attn_varlen_forward(
|
| 461 |
+
q, k, v, cuq, cuk, len(q), len(k), dropout_p=0., softmax_scale=q.shape[-1] ** -.5,
|
| 462 |
+
causal=causal, window_size_left=-1, window_size_right=0 if causal else -1,
|
| 463 |
+
softcap=0., alibi_slopes=None, return_softmax=False, block_table=None,
|
| 464 |
+
)
|
| 465 |
+
return result[0], result[1]
|
| 466 |
+
|
| 467 |
+
|
| 468 |
+
def _cp_attention(q, k, v, reference_length):
|
| 469 |
+
import torch
|
| 470 |
+
combine = _local_module("ceno_cp_math").combine
|
| 471 |
+
cp = 8
|
| 472 |
+
block = reference_length // (2 * cp)
|
| 473 |
+
length, begin = len(k), len(k) - len(q)
|
| 474 |
+
out = torch.empty_like(q)
|
| 475 |
+
|
| 476 |
+
def segment(x, chunk):
|
| 477 |
+
return x[chunk * block:min((chunk + 1) * block, length)]
|
| 478 |
+
|
| 479 |
+
def part(x, rank, both):
|
| 480 |
+
first = segment(x, rank)
|
| 481 |
+
return torch.cat([first, segment(x, 2 * cp - rank - 1)]) if both else first
|
| 482 |
+
|
| 483 |
+
for rank in range(cp):
|
| 484 |
+
intervals = []
|
| 485 |
+
for chunk in (rank, 2 * cp - rank - 1):
|
| 486 |
+
start, end = max(begin, chunk * block), min(length, (chunk + 1) * block)
|
| 487 |
+
intervals.append((start - begin, end - begin) if end > start else (0, 0))
|
| 488 |
+
(a0, a1), (b0, b1) = intervals
|
| 489 |
+
first, second = a1 - a0, b1 - b0
|
| 490 |
+
if not first + second:
|
| 491 |
+
continue
|
| 492 |
+
query = torch.cat([q[a0:a1], q[b0:b1]])
|
| 493 |
+
pieces, offsets = [], []
|
| 494 |
+
for step in range(cp):
|
| 495 |
+
if step > rank and not second:
|
| 496 |
+
continue
|
| 497 |
+
src, both = (rank - step) % cp, step == 0 or step > rank
|
| 498 |
+
query_part = query if step <= rank else query[first:]
|
| 499 |
+
pieces.append(_attention(query_part, part(k, src, both), part(v, src, both), step == 0))
|
| 500 |
+
offsets.append(0 if step <= rank else first)
|
| 501 |
+
result = combine(pieces, offsets)
|
| 502 |
+
if first:
|
| 503 |
+
out[a0:a1].copy_(result[:first])
|
| 504 |
+
if second:
|
| 505 |
+
out[b0:b1].copy_(result[first:])
|
| 506 |
+
return out
|
| 507 |
+
|
| 508 |
+
|
| 509 |
+
def enable_training_precision(model, *, norm_mode=None, reference_cp_size=None,
|
| 510 |
+
reference_context_length=None):
|
| 511 |
+
"""Attach the common inference implementation to an already loaded HF model."""
|
| 512 |
+
if hasattr(model, "ceno_precision_reference"):
|
| 513 |
+
return model
|
| 514 |
+
configure_backend()
|
| 515 |
+
import sys
|
| 516 |
+
import torch
|
| 517 |
+
norm_module = _local_module("ceno_norm")
|
| 518 |
+
te_rms_norm, te_rms_norm_eager = norm_module.te_rms_norm, norm_module._te_rms_norm_impl
|
| 519 |
+
|
| 520 |
+
config = model.config
|
| 521 |
+
modeling = sys.modules[type(model).__module__]
|
| 522 |
+
prefix = type(model).__name__.removesuffix("ForCausalLM")
|
| 523 |
+
norm_mode = norm_mode or getattr(config, "ceno_rmsnorm_mode", "te-tuned")
|
| 524 |
+
reference_cp_size = (getattr(config, "ceno_reference_cp_size", 1)
|
| 525 |
+
if reference_cp_size is None else reference_cp_size)
|
| 526 |
+
reference_context_length = (getattr(config, "ceno_reference_context_length", None)
|
| 527 |
+
if reference_context_length is None else reference_context_length)
|
| 528 |
+
expected = dict(hidden_size=(512, 1024), mamba_num_heads=(16, 32), mamba_head_dim=(64,),
|
| 529 |
+
n_groups=(8,), ssm_state_size=(128,), chunk_size=(128,),
|
| 530 |
+
num_attention_heads=(8, 16), num_experts=(8,), moe_top_k=(2,))
|
| 531 |
+
if (prefix not in ("NemotronH", "CENO")
|
| 532 |
+
or any(getattr(config, key, None) not in values for key, values in expected.items())
|
| 533 |
+
or config.num_key_value_heads != config.num_attention_heads):
|
| 534 |
+
raise ValueError("HF training precision supports ungrouped CENO 80M/300M/600M/1B")
|
| 535 |
+
if (getattr(model, "is_quantized", False)
|
| 536 |
+
or getattr(config, "moe_router_pre_softmax", False)
|
| 537 |
+
or getattr(config, "mlp_use_swiglu", False)
|
| 538 |
+
or getattr(config, "mlp_hidden_act", "relu2") not in ("relu2", "squared_relu")
|
| 539 |
+
or tuple(getattr(config, "time_step_limit", (0., float("inf")))) not in ((0., float("inf")), (0., 1e30))):
|
| 540 |
+
raise ValueError("HF precision requires unquantized post-topk ReLU2 and default Mamba dt limits")
|
| 541 |
+
if norm_mode not in ("te-general", "te-tuned") or reference_cp_size not in (1, 8):
|
| 542 |
+
raise ValueError("Choose an explicit norm and CP reference")
|
| 543 |
+
if reference_cp_size == 8 and (
|
| 544 |
+
norm_mode != "te-tuned" or not isinstance(reference_context_length, int)
|
| 545 |
+
or reference_context_length <= 0 or reference_context_length % 1024
|
| 546 |
+
):
|
| 547 |
+
raise ValueError("CP8 requires te-tuned norm and a fixed reference window divisible by 1024")
|
| 548 |
+
if model.device.type != "cuda" or model.dtype != torch.bfloat16 or not modeling.is_fast_path_available:
|
| 549 |
+
raise ValueError("HF precision requires single-GPU BF16 and the CUDA Mamba/FA2 environment")
|
| 550 |
+
if any(p.device != model.device for p in model.parameters()):
|
| 551 |
+
raise ValueError("HF training precision requires one CUDA device")
|
| 552 |
+
mark = getattr(modeling, "_mark_backend_scope", None)
|
| 553 |
+
if mark is None:
|
| 554 |
+
raise ValueError("HF precision requires a modeling file with scoped backend flags")
|
| 555 |
+
mark(model)
|
| 556 |
+
config.ceno_mamba_gate_in_ssm = True
|
| 557 |
+
config.ceno_rmsnorm_mode = norm_mode
|
| 558 |
+
config.ceno_reference_cp_size = reference_cp_size
|
| 559 |
+
config.ceno_reference_context_length = reference_context_length
|
| 560 |
+
_pin_scan()
|
| 561 |
+
context = _install_scan_hooks(modeling)
|
| 562 |
+
def norm(self, x):
|
| 563 |
+
# Same Triton kernel; the registered op is only needed under torch.compile.
|
| 564 |
+
op = te_rms_norm if torch.compiler.is_compiling() else te_rms_norm_eager
|
| 565 |
+
return op(x, self.weight, self.variance_epsilon, norm_mode)
|
| 566 |
+
|
| 567 |
+
def softmax(x, dim=-1):
|
| 568 |
+
exp = torch.exp(x - torch.amax(x, dim=dim, keepdim=True))
|
| 569 |
+
return exp / torch.sum(exp, dim=dim, keepdim=True)
|
| 570 |
+
|
| 571 |
+
def attention(q, k, v, mask, query_length, **kwargs):
|
| 572 |
+
if kwargs.get("sliding_window") is not None or kwargs.get("dropout", 0) != 0:
|
| 573 |
+
raise ValueError("Only full causal inference attention is validated")
|
| 574 |
+
if reference_cp_size == 8 and k.shape[1] > reference_context_length:
|
| 575 |
+
raise ValueError("Sequence exceeds the fixed CP reference window")
|
| 576 |
+
results = []
|
| 577 |
+
for batch in range(q.shape[0]):
|
| 578 |
+
if reference_cp_size == 1 or k.shape[1] <= reference_context_length // 16:
|
| 579 |
+
results.append(_attention(q[batch], k[batch], v[batch], True)[0])
|
| 580 |
+
else:
|
| 581 |
+
results.append(_cp_attention(q[batch], k[batch], v[batch], reference_context_length))
|
| 582 |
+
return torch.stack(results)
|
| 583 |
+
|
| 584 |
+
for child in model.modules():
|
| 585 |
+
if isinstance(child, getattr(modeling, prefix + "RMSNorm")):
|
| 586 |
+
child.forward = types.MethodType(norm, child)
|
| 587 |
+
elif isinstance(child, getattr(modeling, prefix + "MoE")):
|
| 588 |
+
child._ceno_router_softmax = softmax
|
| 589 |
+
elif isinstance(child, getattr(modeling, prefix + "Attention")):
|
| 590 |
+
child.__class__ = getattr(modeling, prefix + "FlashAttention2")
|
| 591 |
+
child._flash_attn_uses_top_left_mask = False
|
| 592 |
+
child._ceno_attention = attention
|
| 593 |
+
elif isinstance(child, getattr(modeling, prefix + "Mamba2Mixer")):
|
| 594 |
+
original = child.cuda_kernels_forward
|
| 595 |
+
|
| 596 |
+
def mixer_forward(self, hidden_states, cache_params=None, *args,
|
| 597 |
+
_original=original, **kwargs):
|
| 598 |
+
token = context.set((self, cache_params))
|
| 599 |
+
try:
|
| 600 |
+
return _original(hidden_states, cache_params, *args, **kwargs)
|
| 601 |
+
finally:
|
| 602 |
+
context.reset(token)
|
| 603 |
+
|
| 604 |
+
child.cuda_kernels_forward = types.MethodType(mixer_forward, child)
|
| 605 |
+
|
| 606 |
+
original_forward = model.forward
|
| 607 |
+
|
| 608 |
+
@functools.wraps(original_forward)
|
| 609 |
+
def checked_forward(*args, **kwargs):
|
| 610 |
+
if model.training or torch.is_grad_enabled():
|
| 611 |
+
raise ValueError("Training precision is inference-only; use eval and no_grad/inference_mode")
|
| 612 |
+
if kwargs.get("output_attentions") or model.config.output_attentions:
|
| 613 |
+
raise ValueError("Reload with attn_implementation='eager' to inspect attention maps")
|
| 614 |
+
ids = args[0] if args else kwargs.get("input_ids")
|
| 615 |
+
inputs = ids if ids is not None else kwargs.get("inputs_embeds")
|
| 616 |
+
if inputs is not None and inputs.shape[0] * inputs.shape[1] > 131072:
|
| 617 |
+
raise ValueError("HF precision prefill budget is 131072 tokens; use vLLM for larger prefill")
|
| 618 |
+
if kwargs.get("seq_idx") is not None:
|
| 619 |
+
raise ValueError("Base generation precision does not implement MSA segments")
|
| 620 |
+
mask = kwargs.get("attention_mask")
|
| 621 |
+
if mask is not None and not bool(torch.all(mask)):
|
| 622 |
+
raise ValueError("HF precision currently requires unpadded uniform-length batches")
|
| 623 |
+
if len(args) <= 1 and not (args and "input_ids" in kwargs):
|
| 624 |
+
graph_kwargs = dict(kwargs, input_ids=args[0]) if args else kwargs
|
| 625 |
+
logits = _decode_graph_step(model, modeling, graph_kwargs)
|
| 626 |
+
if logits is not None:
|
| 627 |
+
cache = kwargs.get("cache_params") or kwargs.get("past_key_values")
|
| 628 |
+
if kwargs.get("return_dict", model.config.use_return_dict) is False:
|
| 629 |
+
return (logits, cache)
|
| 630 |
+
return modeling.CENOCausalLMOutput(logits=logits, cache_params=cache,
|
| 631 |
+
past_key_values=cache)
|
| 632 |
+
return original_forward(*args, **kwargs)
|
| 633 |
+
|
| 634 |
+
model.forward = checked_forward
|
| 635 |
+
model.ceno_precision_reference = dict(dtype="bfloat16", norm=norm_mode,
|
| 636 |
+
cp_size=reference_cp_size, context_length=reference_context_length)
|
| 637 |
+
return model
|
| 638 |
+
|
| 639 |
+
|
| 640 |
+
def load_model(model_dir, *, norm_mode="te-tuned", reference_cp_size=None,
|
| 641 |
+
reference_context_length=None, device="cuda"):
|
| 642 |
+
"""Load the same implementation used by a configured AutoModel checkpoint."""
|
| 643 |
+
configure_backend()
|
| 644 |
+
import torch
|
| 645 |
+
CENOConfig = _local_module("configuration_ceno").CENOConfig
|
| 646 |
+
CENOForCausalLM = _local_module("modeling_ceno").CENOForCausalLM
|
| 647 |
+
|
| 648 |
+
config = CENOConfig.from_pretrained(model_dir)
|
| 649 |
+
model = CENOForCausalLM.from_pretrained(
|
| 650 |
+
model_dir, config=config, torch_dtype=torch.bfloat16,
|
| 651 |
+
attn_implementation="flash_attention_2",
|
| 652 |
+
).to(device).eval()
|
| 653 |
+
return enable_training_precision(model, norm_mode=norm_mode,
|
| 654 |
+
reference_cp_size=reference_cp_size, reference_context_length=reference_context_length)
|
vocab.json
ADDED
|
@@ -0,0 +1,485 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
" ": 32,
|
| 3 |
+
"!": 33,
|
| 4 |
+
"\"": 34,
|
| 5 |
+
"#": 35,
|
| 6 |
+
"$": 36,
|
| 7 |
+
"%": 37,
|
| 8 |
+
"&": 38,
|
| 9 |
+
"'": 39,
|
| 10 |
+
"(": 40,
|
| 11 |
+
")": 41,
|
| 12 |
+
"*": 42,
|
| 13 |
+
"+": 43,
|
| 14 |
+
",": 44,
|
| 15 |
+
"-": 45,
|
| 16 |
+
".": 46,
|
| 17 |
+
"/": 47,
|
| 18 |
+
"0": 48,
|
| 19 |
+
"1": 49,
|
| 20 |
+
"2": 50,
|
| 21 |
+
"3": 51,
|
| 22 |
+
"4": 52,
|
| 23 |
+
"5": 53,
|
| 24 |
+
"6": 54,
|
| 25 |
+
"7": 55,
|
| 26 |
+
"8": 56,
|
| 27 |
+
"9": 57,
|
| 28 |
+
":": 58,
|
| 29 |
+
";": 59,
|
| 30 |
+
"<": 60,
|
| 31 |
+
"<byte_127>": 127,
|
| 32 |
+
"<byte_128>": 128,
|
| 33 |
+
"<byte_129>": 129,
|
| 34 |
+
"<byte_130>": 130,
|
| 35 |
+
"<byte_131>": 131,
|
| 36 |
+
"<byte_132>": 132,
|
| 37 |
+
"<byte_133>": 133,
|
| 38 |
+
"<byte_134>": 134,
|
| 39 |
+
"<byte_135>": 135,
|
| 40 |
+
"<byte_136>": 136,
|
| 41 |
+
"<byte_137>": 137,
|
| 42 |
+
"<byte_138>": 138,
|
| 43 |
+
"<byte_139>": 139,
|
| 44 |
+
"<byte_140>": 140,
|
| 45 |
+
"<byte_141>": 141,
|
| 46 |
+
"<byte_142>": 142,
|
| 47 |
+
"<byte_143>": 143,
|
| 48 |
+
"<byte_144>": 144,
|
| 49 |
+
"<byte_145>": 145,
|
| 50 |
+
"<byte_146>": 146,
|
| 51 |
+
"<byte_147>": 147,
|
| 52 |
+
"<byte_148>": 148,
|
| 53 |
+
"<byte_149>": 149,
|
| 54 |
+
"<byte_150>": 150,
|
| 55 |
+
"<byte_151>": 151,
|
| 56 |
+
"<byte_152>": 152,
|
| 57 |
+
"<byte_153>": 153,
|
| 58 |
+
"<byte_154>": 154,
|
| 59 |
+
"<byte_155>": 155,
|
| 60 |
+
"<byte_156>": 156,
|
| 61 |
+
"<byte_157>": 157,
|
| 62 |
+
"<byte_158>": 158,
|
| 63 |
+
"<byte_159>": 159,
|
| 64 |
+
"<byte_160>": 160,
|
| 65 |
+
"<byte_161>": 161,
|
| 66 |
+
"<byte_162>": 162,
|
| 67 |
+
"<byte_163>": 163,
|
| 68 |
+
"<byte_164>": 164,
|
| 69 |
+
"<byte_165>": 165,
|
| 70 |
+
"<byte_166>": 166,
|
| 71 |
+
"<byte_167>": 167,
|
| 72 |
+
"<byte_168>": 168,
|
| 73 |
+
"<byte_169>": 169,
|
| 74 |
+
"<byte_170>": 170,
|
| 75 |
+
"<byte_171>": 171,
|
| 76 |
+
"<byte_172>": 172,
|
| 77 |
+
"<byte_173>": 173,
|
| 78 |
+
"<byte_174>": 174,
|
| 79 |
+
"<byte_175>": 175,
|
| 80 |
+
"<byte_176>": 176,
|
| 81 |
+
"<byte_177>": 177,
|
| 82 |
+
"<byte_178>": 178,
|
| 83 |
+
"<byte_179>": 179,
|
| 84 |
+
"<byte_180>": 180,
|
| 85 |
+
"<byte_181>": 181,
|
| 86 |
+
"<byte_182>": 182,
|
| 87 |
+
"<byte_183>": 183,
|
| 88 |
+
"<byte_184>": 184,
|
| 89 |
+
"<byte_185>": 185,
|
| 90 |
+
"<byte_186>": 186,
|
| 91 |
+
"<byte_187>": 187,
|
| 92 |
+
"<byte_188>": 188,
|
| 93 |
+
"<byte_189>": 189,
|
| 94 |
+
"<byte_190>": 190,
|
| 95 |
+
"<byte_191>": 191,
|
| 96 |
+
"<byte_192>": 192,
|
| 97 |
+
"<byte_193>": 193,
|
| 98 |
+
"<byte_194>": 194,
|
| 99 |
+
"<byte_195>": 195,
|
| 100 |
+
"<byte_196>": 196,
|
| 101 |
+
"<byte_197>": 197,
|
| 102 |
+
"<byte_198>": 198,
|
| 103 |
+
"<byte_199>": 199,
|
| 104 |
+
"<byte_200>": 200,
|
| 105 |
+
"<byte_201>": 201,
|
| 106 |
+
"<byte_202>": 202,
|
| 107 |
+
"<byte_203>": 203,
|
| 108 |
+
"<byte_204>": 204,
|
| 109 |
+
"<byte_205>": 205,
|
| 110 |
+
"<byte_206>": 206,
|
| 111 |
+
"<byte_207>": 207,
|
| 112 |
+
"<byte_208>": 208,
|
| 113 |
+
"<byte_209>": 209,
|
| 114 |
+
"<byte_210>": 210,
|
| 115 |
+
"<byte_211>": 211,
|
| 116 |
+
"<byte_212>": 212,
|
| 117 |
+
"<byte_213>": 213,
|
| 118 |
+
"<byte_214>": 214,
|
| 119 |
+
"<byte_215>": 215,
|
| 120 |
+
"<byte_216>": 216,
|
| 121 |
+
"<byte_217>": 217,
|
| 122 |
+
"<byte_218>": 218,
|
| 123 |
+
"<byte_219>": 219,
|
| 124 |
+
"<byte_220>": 220,
|
| 125 |
+
"<byte_221>": 221,
|
| 126 |
+
"<byte_222>": 222,
|
| 127 |
+
"<byte_223>": 223,
|
| 128 |
+
"<byte_224>": 224,
|
| 129 |
+
"<byte_225>": 225,
|
| 130 |
+
"<byte_226>": 226,
|
| 131 |
+
"<byte_227>": 227,
|
| 132 |
+
"<byte_228>": 228,
|
| 133 |
+
"<byte_229>": 229,
|
| 134 |
+
"<byte_230>": 230,
|
| 135 |
+
"<byte_231>": 231,
|
| 136 |
+
"<byte_232>": 232,
|
| 137 |
+
"<byte_233>": 233,
|
| 138 |
+
"<byte_234>": 234,
|
| 139 |
+
"<byte_235>": 235,
|
| 140 |
+
"<byte_236>": 236,
|
| 141 |
+
"<byte_237>": 237,
|
| 142 |
+
"<byte_238>": 238,
|
| 143 |
+
"<byte_239>": 239,
|
| 144 |
+
"<byte_240>": 240,
|
| 145 |
+
"<byte_241>": 241,
|
| 146 |
+
"<byte_242>": 242,
|
| 147 |
+
"<byte_243>": 243,
|
| 148 |
+
"<byte_244>": 244,
|
| 149 |
+
"<byte_245>": 245,
|
| 150 |
+
"<byte_246>": 246,
|
| 151 |
+
"<byte_247>": 247,
|
| 152 |
+
"<byte_248>": 248,
|
| 153 |
+
"<byte_249>": 249,
|
| 154 |
+
"<byte_250>": 250,
|
| 155 |
+
"<byte_251>": 251,
|
| 156 |
+
"<byte_252>": 252,
|
| 157 |
+
"<byte_253>": 253,
|
| 158 |
+
"<byte_254>": 254,
|
| 159 |
+
"<byte_255>": 255,
|
| 160 |
+
"<byte_256>": 256,
|
| 161 |
+
"<byte_257>": 257,
|
| 162 |
+
"<byte_258>": 258,
|
| 163 |
+
"<byte_259>": 259,
|
| 164 |
+
"<byte_260>": 260,
|
| 165 |
+
"<byte_261>": 261,
|
| 166 |
+
"<byte_262>": 262,
|
| 167 |
+
"<byte_263>": 263,
|
| 168 |
+
"<byte_264>": 264,
|
| 169 |
+
"<byte_265>": 265,
|
| 170 |
+
"<byte_266>": 266,
|
| 171 |
+
"<byte_267>": 267,
|
| 172 |
+
"<byte_268>": 268,
|
| 173 |
+
"<byte_269>": 269,
|
| 174 |
+
"<byte_270>": 270,
|
| 175 |
+
"<byte_271>": 271,
|
| 176 |
+
"<byte_272>": 272,
|
| 177 |
+
"<byte_273>": 273,
|
| 178 |
+
"<byte_274>": 274,
|
| 179 |
+
"<byte_275>": 275,
|
| 180 |
+
"<byte_276>": 276,
|
| 181 |
+
"<byte_277>": 277,
|
| 182 |
+
"<byte_278>": 278,
|
| 183 |
+
"<byte_279>": 279,
|
| 184 |
+
"<byte_280>": 280,
|
| 185 |
+
"<byte_281>": 281,
|
| 186 |
+
"<byte_282>": 282,
|
| 187 |
+
"<byte_283>": 283,
|
| 188 |
+
"<byte_284>": 284,
|
| 189 |
+
"<byte_285>": 285,
|
| 190 |
+
"<byte_286>": 286,
|
| 191 |
+
"<byte_287>": 287,
|
| 192 |
+
"<byte_288>": 288,
|
| 193 |
+
"<byte_289>": 289,
|
| 194 |
+
"<byte_290>": 290,
|
| 195 |
+
"<byte_291>": 291,
|
| 196 |
+
"<byte_292>": 292,
|
| 197 |
+
"<byte_293>": 293,
|
| 198 |
+
"<byte_294>": 294,
|
| 199 |
+
"<byte_295>": 295,
|
| 200 |
+
"<byte_296>": 296,
|
| 201 |
+
"<byte_297>": 297,
|
| 202 |
+
"<byte_298>": 298,
|
| 203 |
+
"<byte_299>": 299,
|
| 204 |
+
"<byte_300>": 300,
|
| 205 |
+
"<byte_301>": 301,
|
| 206 |
+
"<byte_302>": 302,
|
| 207 |
+
"<byte_303>": 303,
|
| 208 |
+
"<byte_304>": 304,
|
| 209 |
+
"<byte_305>": 305,
|
| 210 |
+
"<byte_306>": 306,
|
| 211 |
+
"<byte_307>": 307,
|
| 212 |
+
"<byte_308>": 308,
|
| 213 |
+
"<byte_309>": 309,
|
| 214 |
+
"<byte_310>": 310,
|
| 215 |
+
"<byte_311>": 311,
|
| 216 |
+
"<byte_312>": 312,
|
| 217 |
+
"<byte_313>": 313,
|
| 218 |
+
"<byte_314>": 314,
|
| 219 |
+
"<byte_315>": 315,
|
| 220 |
+
"<byte_316>": 316,
|
| 221 |
+
"<byte_317>": 317,
|
| 222 |
+
"<byte_318>": 318,
|
| 223 |
+
"<byte_319>": 319,
|
| 224 |
+
"<byte_320>": 320,
|
| 225 |
+
"<byte_321>": 321,
|
| 226 |
+
"<byte_322>": 322,
|
| 227 |
+
"<byte_323>": 323,
|
| 228 |
+
"<byte_324>": 324,
|
| 229 |
+
"<byte_325>": 325,
|
| 230 |
+
"<byte_326>": 326,
|
| 231 |
+
"<byte_327>": 327,
|
| 232 |
+
"<byte_328>": 328,
|
| 233 |
+
"<byte_329>": 329,
|
| 234 |
+
"<byte_330>": 330,
|
| 235 |
+
"<byte_331>": 331,
|
| 236 |
+
"<byte_332>": 332,
|
| 237 |
+
"<byte_333>": 333,
|
| 238 |
+
"<byte_334>": 334,
|
| 239 |
+
"<byte_335>": 335,
|
| 240 |
+
"<byte_336>": 336,
|
| 241 |
+
"<byte_337>": 337,
|
| 242 |
+
"<byte_338>": 338,
|
| 243 |
+
"<byte_339>": 339,
|
| 244 |
+
"<byte_340>": 340,
|
| 245 |
+
"<byte_341>": 341,
|
| 246 |
+
"<byte_342>": 342,
|
| 247 |
+
"<byte_343>": 343,
|
| 248 |
+
"<byte_344>": 344,
|
| 249 |
+
"<byte_345>": 345,
|
| 250 |
+
"<byte_346>": 346,
|
| 251 |
+
"<byte_347>": 347,
|
| 252 |
+
"<byte_348>": 348,
|
| 253 |
+
"<byte_349>": 349,
|
| 254 |
+
"<byte_350>": 350,
|
| 255 |
+
"<byte_351>": 351,
|
| 256 |
+
"<byte_352>": 352,
|
| 257 |
+
"<byte_353>": 353,
|
| 258 |
+
"<byte_354>": 354,
|
| 259 |
+
"<byte_355>": 355,
|
| 260 |
+
"<byte_356>": 356,
|
| 261 |
+
"<byte_357>": 357,
|
| 262 |
+
"<byte_358>": 358,
|
| 263 |
+
"<byte_359>": 359,
|
| 264 |
+
"<byte_360>": 360,
|
| 265 |
+
"<byte_361>": 361,
|
| 266 |
+
"<byte_362>": 362,
|
| 267 |
+
"<byte_363>": 363,
|
| 268 |
+
"<byte_364>": 364,
|
| 269 |
+
"<byte_365>": 365,
|
| 270 |
+
"<byte_366>": 366,
|
| 271 |
+
"<byte_367>": 367,
|
| 272 |
+
"<byte_368>": 368,
|
| 273 |
+
"<byte_369>": 369,
|
| 274 |
+
"<byte_370>": 370,
|
| 275 |
+
"<byte_371>": 371,
|
| 276 |
+
"<byte_372>": 372,
|
| 277 |
+
"<byte_373>": 373,
|
| 278 |
+
"<byte_374>": 374,
|
| 279 |
+
"<byte_375>": 375,
|
| 280 |
+
"<byte_376>": 376,
|
| 281 |
+
"<byte_377>": 377,
|
| 282 |
+
"<byte_378>": 378,
|
| 283 |
+
"<byte_379>": 379,
|
| 284 |
+
"<byte_380>": 380,
|
| 285 |
+
"<byte_381>": 381,
|
| 286 |
+
"<byte_382>": 382,
|
| 287 |
+
"<byte_383>": 383,
|
| 288 |
+
"<byte_384>": 384,
|
| 289 |
+
"<byte_385>": 385,
|
| 290 |
+
"<byte_386>": 386,
|
| 291 |
+
"<byte_387>": 387,
|
| 292 |
+
"<byte_388>": 388,
|
| 293 |
+
"<byte_389>": 389,
|
| 294 |
+
"<byte_390>": 390,
|
| 295 |
+
"<byte_391>": 391,
|
| 296 |
+
"<byte_392>": 392,
|
| 297 |
+
"<byte_393>": 393,
|
| 298 |
+
"<byte_394>": 394,
|
| 299 |
+
"<byte_395>": 395,
|
| 300 |
+
"<byte_396>": 396,
|
| 301 |
+
"<byte_397>": 397,
|
| 302 |
+
"<byte_398>": 398,
|
| 303 |
+
"<byte_399>": 399,
|
| 304 |
+
"<byte_400>": 400,
|
| 305 |
+
"<byte_401>": 401,
|
| 306 |
+
"<byte_402>": 402,
|
| 307 |
+
"<byte_403>": 403,
|
| 308 |
+
"<byte_404>": 404,
|
| 309 |
+
"<byte_405>": 405,
|
| 310 |
+
"<byte_406>": 406,
|
| 311 |
+
"<byte_407>": 407,
|
| 312 |
+
"<byte_408>": 408,
|
| 313 |
+
"<byte_409>": 409,
|
| 314 |
+
"<byte_410>": 410,
|
| 315 |
+
"<byte_411>": 411,
|
| 316 |
+
"<byte_412>": 412,
|
| 317 |
+
"<byte_413>": 413,
|
| 318 |
+
"<byte_414>": 414,
|
| 319 |
+
"<byte_415>": 415,
|
| 320 |
+
"<byte_416>": 416,
|
| 321 |
+
"<byte_417>": 417,
|
| 322 |
+
"<byte_418>": 418,
|
| 323 |
+
"<byte_419>": 419,
|
| 324 |
+
"<byte_420>": 420,
|
| 325 |
+
"<byte_421>": 421,
|
| 326 |
+
"<byte_422>": 422,
|
| 327 |
+
"<byte_423>": 423,
|
| 328 |
+
"<byte_424>": 424,
|
| 329 |
+
"<byte_425>": 425,
|
| 330 |
+
"<byte_426>": 426,
|
| 331 |
+
"<byte_427>": 427,
|
| 332 |
+
"<byte_428>": 428,
|
| 333 |
+
"<byte_429>": 429,
|
| 334 |
+
"<byte_430>": 430,
|
| 335 |
+
"<byte_431>": 431,
|
| 336 |
+
"<byte_432>": 432,
|
| 337 |
+
"<byte_433>": 433,
|
| 338 |
+
"<byte_434>": 434,
|
| 339 |
+
"<byte_435>": 435,
|
| 340 |
+
"<byte_436>": 436,
|
| 341 |
+
"<byte_437>": 437,
|
| 342 |
+
"<byte_438>": 438,
|
| 343 |
+
"<byte_439>": 439,
|
| 344 |
+
"<byte_440>": 440,
|
| 345 |
+
"<byte_441>": 441,
|
| 346 |
+
"<byte_442>": 442,
|
| 347 |
+
"<byte_443>": 443,
|
| 348 |
+
"<byte_444>": 444,
|
| 349 |
+
"<byte_445>": 445,
|
| 350 |
+
"<byte_446>": 446,
|
| 351 |
+
"<byte_447>": 447,
|
| 352 |
+
"<byte_448>": 448,
|
| 353 |
+
"<byte_449>": 449,
|
| 354 |
+
"<byte_450>": 450,
|
| 355 |
+
"<byte_451>": 451,
|
| 356 |
+
"<byte_452>": 452,
|
| 357 |
+
"<byte_453>": 453,
|
| 358 |
+
"<byte_454>": 454,
|
| 359 |
+
"<byte_455>": 455,
|
| 360 |
+
"<byte_456>": 456,
|
| 361 |
+
"<byte_457>": 457,
|
| 362 |
+
"<byte_458>": 458,
|
| 363 |
+
"<byte_459>": 459,
|
| 364 |
+
"<byte_460>": 460,
|
| 365 |
+
"<byte_461>": 461,
|
| 366 |
+
"<byte_462>": 462,
|
| 367 |
+
"<byte_463>": 463,
|
| 368 |
+
"<byte_464>": 464,
|
| 369 |
+
"<byte_465>": 465,
|
| 370 |
+
"<byte_466>": 466,
|
| 371 |
+
"<byte_467>": 467,
|
| 372 |
+
"<byte_468>": 468,
|
| 373 |
+
"<byte_469>": 469,
|
| 374 |
+
"<byte_470>": 470,
|
| 375 |
+
"<byte_471>": 471,
|
| 376 |
+
"<byte_472>": 472,
|
| 377 |
+
"<byte_473>": 473,
|
| 378 |
+
"<byte_474>": 474,
|
| 379 |
+
"<byte_475>": 475,
|
| 380 |
+
"<byte_476>": 476,
|
| 381 |
+
"<byte_477>": 477,
|
| 382 |
+
"<byte_478>": 478,
|
| 383 |
+
"<byte_479>": 479,
|
| 384 |
+
"<byte_480>": 480,
|
| 385 |
+
"<byte_481>": 481,
|
| 386 |
+
"<byte_482>": 482,
|
| 387 |
+
"<byte_483>": 483,
|
| 388 |
+
"<byte_484>": 484,
|
| 389 |
+
"<byte_485>": 485,
|
| 390 |
+
"<byte_486>": 486,
|
| 391 |
+
"<byte_487>": 487,
|
| 392 |
+
"<byte_488>": 488,
|
| 393 |
+
"<byte_489>": 489,
|
| 394 |
+
"<byte_490>": 490,
|
| 395 |
+
"<byte_491>": 491,
|
| 396 |
+
"<byte_492>": 492,
|
| 397 |
+
"<byte_493>": 493,
|
| 398 |
+
"<byte_494>": 494,
|
| 399 |
+
"<byte_495>": 495,
|
| 400 |
+
"<byte_496>": 496,
|
| 401 |
+
"<byte_497>": 497,
|
| 402 |
+
"<byte_498>": 498,
|
| 403 |
+
"<byte_499>": 499,
|
| 404 |
+
"<byte_500>": 500,
|
| 405 |
+
"<byte_501>": 501,
|
| 406 |
+
"<byte_502>": 502,
|
| 407 |
+
"<byte_503>": 503,
|
| 408 |
+
"<byte_504>": 504,
|
| 409 |
+
"<byte_505>": 505,
|
| 410 |
+
"<byte_506>": 506,
|
| 411 |
+
"<byte_507>": 507,
|
| 412 |
+
"<byte_508>": 508,
|
| 413 |
+
"<byte_509>": 509,
|
| 414 |
+
"<byte_510>": 510,
|
| 415 |
+
"<byte_511>": 511,
|
| 416 |
+
"<eos>": 0,
|
| 417 |
+
"<pad>": 1,
|
| 418 |
+
"<unk>": 2,
|
| 419 |
+
"=": 61,
|
| 420 |
+
">": 62,
|
| 421 |
+
"?": 63,
|
| 422 |
+
"@": 64,
|
| 423 |
+
"A": 65,
|
| 424 |
+
"B": 66,
|
| 425 |
+
"C": 67,
|
| 426 |
+
"D": 68,
|
| 427 |
+
"E": 69,
|
| 428 |
+
"F": 70,
|
| 429 |
+
"G": 71,
|
| 430 |
+
"H": 72,
|
| 431 |
+
"I": 73,
|
| 432 |
+
"J": 74,
|
| 433 |
+
"K": 75,
|
| 434 |
+
"L": 76,
|
| 435 |
+
"M": 77,
|
| 436 |
+
"N": 78,
|
| 437 |
+
"O": 79,
|
| 438 |
+
"P": 80,
|
| 439 |
+
"Q": 81,
|
| 440 |
+
"R": 82,
|
| 441 |
+
"S": 83,
|
| 442 |
+
"T": 84,
|
| 443 |
+
"U": 85,
|
| 444 |
+
"V": 86,
|
| 445 |
+
"W": 87,
|
| 446 |
+
"X": 88,
|
| 447 |
+
"Y": 89,
|
| 448 |
+
"Z": 90,
|
| 449 |
+
"[": 91,
|
| 450 |
+
"\\": 92,
|
| 451 |
+
"]": 93,
|
| 452 |
+
"^": 94,
|
| 453 |
+
"_": 95,
|
| 454 |
+
"`": 96,
|
| 455 |
+
"a": 97,
|
| 456 |
+
"b": 98,
|
| 457 |
+
"c": 99,
|
| 458 |
+
"d": 100,
|
| 459 |
+
"e": 101,
|
| 460 |
+
"f": 102,
|
| 461 |
+
"g": 103,
|
| 462 |
+
"h": 104,
|
| 463 |
+
"i": 105,
|
| 464 |
+
"j": 106,
|
| 465 |
+
"k": 107,
|
| 466 |
+
"l": 108,
|
| 467 |
+
"m": 109,
|
| 468 |
+
"n": 110,
|
| 469 |
+
"o": 111,
|
| 470 |
+
"p": 112,
|
| 471 |
+
"q": 113,
|
| 472 |
+
"r": 114,
|
| 473 |
+
"s": 115,
|
| 474 |
+
"t": 116,
|
| 475 |
+
"u": 117,
|
| 476 |
+
"v": 118,
|
| 477 |
+
"w": 119,
|
| 478 |
+
"x": 120,
|
| 479 |
+
"y": 121,
|
| 480 |
+
"z": 122,
|
| 481 |
+
"{": 123,
|
| 482 |
+
"|": 124,
|
| 483 |
+
"}": 125,
|
| 484 |
+
"~": 126
|
| 485 |
+
}
|