Downloads · 30 days
213
28% of all-time downloads
Arm/hy-mt2-1-8b-q4-0-llamacpp-vivo-x300
hy-mt2-1-8b-q4-0-llamacpp-vivo-x300 is a translation model from Arm. Use it when you need text moved from one language to another. It is set up for gguf. The card lists the license as apache-2.0.
Hy-MT2-1.8B machine translation model optimized as a Q40 plus Q80 GGUF for the llama.cpp runtime on Arm-based mobile CPUs with SME2.
Downloads · 30 days
213
28% of all-time downloads
All-time downloads
772
Public
Repo size
4.7 GB
Likes
0
Public
Click a slice to open those files.
.gguf4.7 GB · 100%
From the Hugging Face model README
Hy-MT2-1.8B machine translation model optimized as a Q4_0 plus Q8_0 GGUF for the llama.cpp runtime on Arm-based mobile CPUs with SME2.
This repository contains an Arm-optimized version of tencent/Hy-MT2-1.8B for machine translation. The model is provided as a GGUF file for the llama.cpp runtime, targeting Mobile CPU systems. The transformer body is quantized to Q4_0, the tied token-embedding and output-projection tensor is kept at Q8_0, and normalization weights remain at F32.
This version is intended to demonstrate efficient inference on Arm-based platforms while preserving the original model's intended behavior. Arm has evaluated this model on FLORES-200 and measured performance on a representative evaluation target using synthetic llama-bench token sequences.
Key results
| Area | Result |
|---|---|
| Model format | GGUF (llama.cpp) |
| Target device class | Mobile CPU |
| Reference device | vivo X300 (C1-Ultra, C1-Premium, C1-Pro, Android 16 / OriginOS 6) |
| Primary performance result | 34.02 tokens/sec decode throughput, 3011.16 ms time to first token |
| Accuracy result | FLORES-200 accuracy 83.14 |
| Size / memory result | 1087.12 MB model, 3.15x smaller than the F16 baseline; 2238.21 MB peak memory |
| Field | Value |
|---|---|
| Original model | tencent/Hy-MT2-1.8B |
| Original source | Hugging Face |
| Original developer | Tencent |
| Original model card | tencent/Hy-MT2-1.8B |
| Original license | Apache-2.0 |
| File | Description |
|---|---|
tencent__Hy-MT2-1.8B_llamacpp_q4_0_embq8_0.gguf | Arm-optimized quantized model for deployment |
example.py | Minimal inference example |
pyproject.toml | Pinned runtime dependencies for example.py, resolved with uv |
uv.lock | Locked dependency resolution for pyproject.toml |
config.yaml | Model I/O contract used by the example |
benchmarks/ | FP16 baseline and Arm-optimized benchmark records |
Performance was measured on the reference configuration below. Results are intended to make the optimization reproducible but do not guarantee identical performance on every Arm-based system.
Reference configuration
| Field | Value |
|---|---|
| Device / platform | vivo X300 |
| CPU / accelerator | C1-Ultra, C1-Premium, C1-Pro (8 cores, aarch64, neon + dotprod + i8mm), CPU |
| OS | android — Android 16 / OriginOS 6 |
| Runtime | llama.cpp |
| Backend / delegate | CPU with KleidiAI, built with -march=armv8.6-a+dotprod+i8mm, 4 threads |
| Batch size | 1 |
| Precision | Q4_0 transformer weights, Q8_0 tied embedding / output projection, F32 normalization weights |
| Runs | 100 measured |
Performance results
| Metric | Original / baseline | Arm-optimized | Improvement |
|---|---|---|---|
| p50 end-to-end latency | 43829.64 ms | 6791.26 ms | 6.45x |
| Time to first token | 28731.00 ms | 3011.16 ms | 9.54x |
| Decode throughput | 8.48 tokens/sec | 34.02 tokens/sec | 4.01x |
| Model size | 3421.34 MB | 1087.12 MB | 3.15x smaller |
| Peak memory | 3551.34 MB | 2238.21 MB | 1.59x less |
Accuracy was evaluated using the same preprocessing, input resolution, and evaluation protocol described below. Where possible, the optimized model is compared against the original model under the same evaluation conditions.
Evaluation setup
| Field | Value |
|---|---|
| Dataset | FLORES-200 |
| Split | 0-shot |
| Number of samples | N/A |
| Metric(s) | FLORES-200 accuracy |
| Evaluation runtime | llama.cpp |
Accuracy results
| Metric | Original / baseline | Arm-optimized | Change |
|---|---|---|---|
| FLORES-200 | 83.65 | 83.14 | -0.51 pp |
Accuracy was measured using the evaluation setup described above. Users should re-evaluate the model on their own data before production use.
Arm optimized this model for efficient inference on Arm-based platforms using a hardware-aware conversion and validation flow.
For this release, Arm used:
| Optimization area | Applied? | Notes |
|---|---|---|
| Model conversion | Yes | GGUF conversion for the llama.cpp runtime, from the HF checkpoint via a convert_hf_to_gguf.py-style pipeline, per this project's llama.cpp backend |
| Quantization | Yes | Q4_0 weight quantization for the transformer body, Q8_0 for the tied embedding / output-projection tensor, calibrated with llama-imatrix on a ~130k-token round-robin-balanced corpus across FLORES-200 dev-split language pairs (seeded, not a fixed sample count, and not stratified in the statistical sense). This is static, weight-only quantization: Q4_0/Q8_0 are int4/int8 weight formats respectively, while activations stay in float (f16/f32) at inference time — the imatrix statistics are computed offline before deployment, not recomputed per inference. |
| Runtime/backend selection | Yes | llama.cpp CPU backend with KleidiAI, built with -march=armv8.6-a+dotprod+i8mm, 4 threads |
| Graph/runtime compatibility updates | Yes | Graph/runtime compatibility comes from convert_hf_to_gguf.py, which maps the HF checkpoint's tensor names, shapes, and architecture metadata onto ggml's expected tensor layout and naming convention, and a pre-build patch to llama.cpp itself, which prevents a bug where the EOS token is written incorrectly (so generation would otherwise never terminate). |
| Accuracy validation | Yes | Compared against the original model or published baseline |
| Performance validation | Yes | Measured on the reference Arm platform |
The goal of this process is to improve deployment characteristics such as latency, memory use, model size, and runtime compatibility while preserving the model's intended behavior. Detailed conversion scripts, calibration configuration, or backend-specific implementation details may be provided separately where appropriate.
Dependencies are declared in pyproject.toml, which ships with this repository. Resolve and install them into a local virtual environment with uv:
uv python install
uv sync --frozen
uv run example.py
The Python/uv example runs on AWS Graviton (Ubuntu arm64) to confirm runtime compatibility only, and is intended as a guideline for building an equivalent run script on Mobile CPU systems.
| Property | Value |
|---|---|
| Input shape | [1, 2048] |
| Input type | int64 |
| Input range | [0, 120817] |
| Preprocessing | Apply the chat template embedded in the .gguf as a single user turn with add_generation_prompt=true; render the instruction "Translate the following text into {target_lang}. Note that you should only output the translated result without any additional explanation:" followed by the source text; tokenize with the GGUF-embedded tokenizer, vocabulary size 120818 |
| Property | Value |
|---|---|
| Output shape | [1, seq_len, 120818] |
| Output type | Per-token logits over the vocabulary, decoded autoregressively to translated text |
| Postprocessing | Sample with temperature 0.7, top_p 0.8, repeat_penalty 1.05; generate up to max(64, 4 * source_token_count) tokens or until stop token id 120020; decode and strip surrounding whitespace |
This pre/postprocessing is implemented explicitly in example.py's preprocess/postprocess functions, which build the chat-marker prompt and parse the completion before and after the call to create_completion.
This model is intended for developers evaluating machine translation workloads on Arm-based platforms. It is suitable as a reference implementation for benchmarking, prototyping, and integration exploration.
llama-quantize --imatrix <flores200-dev.imatrix> --token-embedding-type q8_0 \
tencent__Hy-MT2-1.8B_llamacpp_original.gguf \
tencent__Hy-MT2-1.8B_llamacpp_q4_0_embq8_0.gguf Q4_0
Original Model: tencent/Hy-MT2-1.8B by Tencent - Repository
Optimization/conversion: Arm-Optimized version for execution on Arm-based platforms.
Converted/optimized by: Arm
License: The Original Model and the Optimized Model are subject to Apache-2.0.
This repository contains a converted or optimized version of the Original Model (the “Optimized Model”). The Original Model has been converted or optimized as described above for execution on Arm-based platforms.
No retraining or fine-tuning of the Original Model was performed as part of the conversion or optimization. The conversion or optimization was not intended to change the Original Model’s behavior or intended use.
For information about the Original Model, including its development, training data, intended uses, limitations and other relevant information, please refer to the Original Model repository. Information in that repository was provided by the original developer or other third parties and, unless expressly stated otherwise, has not been independently verified by Arm.
Use of the Original Model and the Optimized Model is subject to the applicable licenses, usage restrictions and other terms identified above and in the relevant repositories. Publication of the Optimized Model does not grant any rights beyond those provided under the applicable license terms.
You are responsible for reviewing those terms and ensuring that your use of the Original Model and the Optimized Model is permitted.
The Optimized Model is provided as a reference implementation to demonstrate and evaluate execution and performance on Arm-based systems. It is not a production-ready or supported solution.
Arm’s publication of the Optimized Model does not constitute an endorsement or certification of the Original Model or a representation that the Optimized Model is suitable for production use or any particular purpose.
To the fullest extent permitted by applicable law (i) the Optimized Model is provided “as is.” Arm makes no representations or warranties that the Original Model, the Optimized Model or their outputs are accurate, safe, secure, non-infringing, legally compliant, suitable for production use or fit for any particular purpose; and (ii) Arm will not be liable for any loss or damage arising from or in connection with the Optimized Model, its use or its outputs.
You are responsible for independently evaluating the Optimized Model, its outputs and its suitability for your intended use, including compliance with applicable legal, regulatory, safety and security requirements.
Arm does not commit to provide ongoing support, maintenance or updates for the Optimized Model. Any use of or reliance on the Optimized Model or its outputs is at your own risk.