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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
- ExecuTorch
|
| 17 |
- audioprocessing
|
| 18 |
- transformer
|
| 19 |
+
---
|
| 20 |
+
# Model Card for Model ID
|
| 21 |
+
|
| 22 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
| 23 |
+
|
| 24 |
+
Conformer is a popular Transformer based speech recognition network, suitable for embedded devices. This repository contains FP32 trained weights and the associated tokenizer for an implementation of Conformer. We also include exported quantized program with ExecuTorch, quantized for the ExecuTorch Ethos-U backend allowing an easy deployment on SoCs with an Arm® Ethos™-U NPU.
|
| 25 |
+
## Model Details
|
| 26 |
+
|
| 27 |
+
### Model Description
|
| 28 |
+
|
| 29 |
+
Conformer is a popular Neural Network for speech recognition. This repository contains trained weights for the Conformer implementation in https://github.com/sooftware/conformer/
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
- **Developed by:** Arm
|
| 33 |
+
- **Model type:** Transformer
|
| 34 |
+
- **Language(s) (NLP):** English
|
| 35 |
+
- **License:** Apache-2
|
| 36 |
+
|
| 37 |
+
### Model Sources [optional]
|
| 38 |
+
|
| 39 |
+
<!-- Provide the basic links for the model. -->
|
| 40 |
+
|
| 41 |
+
- **Repository:** https://github.com/sooftware/conformer/
|
| 42 |
+
- **Paper [optional]:** https://arxiv.org/abs/2005.08100
|
| 43 |
+
|
| 44 |
+
## Uses
|
| 45 |
+
|
| 46 |
+
You need to install ExecuTorch 1.0 with $ pip install executorch.
|
| 47 |
+
|
| 48 |
+
By downloading the quantized exported graph module, you can directly call the to_edge_transform_and_lower API of ExecuTorch. This will produce a pte file for your variant of the Ethos-U. Example for producing a pte file for an Ethos-U85 with 256 MACs in Shared_Sram memory mode:
|
| 49 |
+
Below is an example script to produce a pte file for Ethos-U85 256 MAC configuration in Shared_Sram memory mode.
|
| 50 |
+
```
|
| 51 |
+
import torch
|
| 52 |
+
from executorch.backends.arm.ethosu import EthosUPartitioner, EthosUCompileSpec
|
| 53 |
+
from executorch.backends.arm.quantizer import (
|
| 54 |
+
EthosUQuantizer,
|
| 55 |
+
get_symmetric_quantization_config,
|
| 56 |
+
)
|
| 57 |
+
from executorch.exir import (
|
| 58 |
+
EdgeCompileConfig,
|
| 59 |
+
ExecutorchBackendConfig,
|
| 60 |
+
to_edge_transform_and_lower,
|
| 61 |
+
)
|
| 62 |
+
from executorch.extension.export_util.utils import save_pte_program
|
| 63 |
+
|
| 64 |
+
def main():
|
| 65 |
+
quant_exported_program = torch.export.load("Conformer_ArmQuantizer_quant_exported_program.pt2")
|
| 66 |
+
compile_spec = EthosUCompileSpec(
|
| 67 |
+
target="ethos-u85-256",
|
| 68 |
+
system_config="Ethos_U85_SYS_Flash_High",
|
| 69 |
+
memory_mode="Shared_Sram",
|
| 70 |
+
extra_flags=["--output-format=raw", "--debug-force-regor"],
|
| 71 |
+
)
|
| 72 |
+
partitioner = EthosUPartitioner(compile_spec)
|
| 73 |
+
print(
|
| 74 |
+
"Calling to_edge_transform_and_lower - lowering to TOSA and compiling for the Ethos-U hardware"
|
| 75 |
+
)
|
| 76 |
+
# Lower the exported program to the Ethos-U backend
|
| 77 |
+
edge_program_manager = to_edge_transform_and_lower(
|
| 78 |
+
quant_exported_program,
|
| 79 |
+
partitioner=[partitioner],
|
| 80 |
+
compile_config=EdgeCompileConfig(
|
| 81 |
+
_check_ir_validity=False,
|
| 82 |
+
),
|
| 83 |
+
)
|
| 84 |
+
executorch_program_manager = edge_program_manager.to_executorch(
|
| 85 |
+
config=ExecutorchBackendConfig(extract_delegate_segments=False)
|
| 86 |
+
)
|
| 87 |
+
save_pte_program(
|
| 88 |
+
executorch_program_manager, f"conformer_quantized.pte"
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
if __name__ == "__main__":
|
| 93 |
+
main()
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
### Direct Use
|
| 98 |
+
|
| 99 |
+
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 100 |
+
|
| 101 |
+
[More Information Needed]
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
[More Information Needed]
|
| 105 |
+
|
| 106 |
+
### Out-of-Scope Use
|
| 107 |
+
|
| 108 |
+
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 109 |
+
|
| 110 |
+
[More Information Needed]
|
| 111 |
+
|
| 112 |
+
## Bias, Risks, and Limitations
|
| 113 |
+
|
| 114 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 115 |
+
|
| 116 |
+
[More Information Needed]
|
| 117 |
+
|
| 118 |
+
### Recommendations
|
| 119 |
+
|
| 120 |
+
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 121 |
+
|
| 122 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 123 |
+
|
| 124 |
+
## How to Get Started with the Model
|
| 125 |
+
|
| 126 |
+
Use the code below to get started with the model.
|
| 127 |
+
|
| 128 |
+
[More Information Needed]
|
| 129 |
+
|
| 130 |
+
## Training Details
|
| 131 |
+
|
| 132 |
+
### Training Data
|
| 133 |
+
|
| 134 |
+
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 135 |
+
|
| 136 |
+
[More Information Needed]
|
| 137 |
+
|
| 138 |
+
### Training Procedure
|
| 139 |
+
|
| 140 |
+
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 141 |
+
|
| 142 |
+
#### Preprocessing [optional]
|
| 143 |
+
|
| 144 |
+
[More Information Needed]
|
| 145 |
+
|
| 146 |
+
|
| 147 |
+
#### Training Hyperparameters
|
| 148 |
+
|
| 149 |
+
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 150 |
+
|
| 151 |
+
#### Speeds, Sizes, Times [optional]
|
| 152 |
+
|
| 153 |
+
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 154 |
+
|
| 155 |
+
[More Information Needed]
|
| 156 |
+
|
| 157 |
+
## Evaluation
|
| 158 |
+
|
| 159 |
+
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 160 |
+
|
| 161 |
+
### Testing Data, Factors & Metrics
|
| 162 |
+
|
| 163 |
+
#### Testing Data
|
| 164 |
+
|
| 165 |
+
<!-- This should link to a Dataset Card if possible. -->
|
| 166 |
+
|
| 167 |
+
[More Information Needed]
|
| 168 |
+
|
| 169 |
+
#### Factors
|
| 170 |
+
|
| 171 |
+
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 172 |
+
|
| 173 |
+
[More Information Needed]
|
| 174 |
+
|
| 175 |
+
#### Metrics
|
| 176 |
+
|
| 177 |
+
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 178 |
+
|
| 179 |
+
[More Information Needed]
|
| 180 |
+
|
| 181 |
+
### Results
|
| 182 |
+
|
| 183 |
+
[More Information Needed]
|
| 184 |
+
|
| 185 |
+
#### Summary
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
## Model Examination [optional]
|
| 190 |
+
|
| 191 |
+
<!-- Relevant interpretability work for the model goes here -->
|
| 192 |
+
|
| 193 |
+
[More Information Needed]
|
| 194 |
+
|
| 195 |
+
## Environmental Impact
|
| 196 |
+
|
| 197 |
+
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 198 |
+
|
| 199 |
+
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 200 |
+
|
| 201 |
+
- **Hardware Type:** [More Information Needed]
|
| 202 |
+
- **Hours used:** [More Information Needed]
|
| 203 |
+
- **Cloud Provider:** [More Information Needed]
|
| 204 |
+
- **Compute Region:** [More Information Needed]
|
| 205 |
+
- **Carbon Emitted:** [More Information Needed]
|
| 206 |
+
|
| 207 |
+
## Technical Specifications [optional]
|
| 208 |
+
|
| 209 |
+
### Model Architecture and Objective
|
| 210 |
+
|
| 211 |
+
[More Information Needed]
|
| 212 |
+
|
| 213 |
+
### Compute Infrastructure
|
| 214 |
+
|
| 215 |
+
[More Information Needed]
|
| 216 |
+
|
| 217 |
+
#### Hardware
|
| 218 |
+
|
| 219 |
+
[More Information Needed]
|
| 220 |
+
|
| 221 |
+
#### Software
|
| 222 |
+
|
| 223 |
+
[More Information Needed]
|
| 224 |
+
|
| 225 |
+
## Citation [optional]
|
| 226 |
+
|
| 227 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 228 |
+
|
| 229 |
+
**BibTeX:**
|
| 230 |
+
|
| 231 |
+
[More Information Needed]
|
| 232 |
+
|
| 233 |
+
**APA:**
|
| 234 |
+
|
| 235 |
+
[More Information Needed]
|
| 236 |
+
|
| 237 |
+
## Glossary [optional]
|
| 238 |
+
|
| 239 |
+
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 240 |
+
|
| 241 |
+
[More Information Needed]
|
| 242 |
+
|
| 243 |
+
## More Information [optional]
|
| 244 |
+
|
| 245 |
+
[More Information Needed]
|
| 246 |
+
|
| 247 |
+
## Model Card Authors [optional]
|
| 248 |
+
|
| 249 |
+
[More Information Needed]
|
| 250 |
+
|
| 251 |
+
## Model Card Contact
|
| 252 |
+
|
| 253 |
+
[More Information Needed]
|