M2M100 418M ONNX INT8 Models
ONNX Runtime compatible INT8-quantized models for Meta's M2M100 418M multilingual translation model. Supports 100 languages with any-to-any translation.
Model Files
| File | Size | Description |
|---|
encoder_model.onnx | 287MB | INT8-quantized encoder |
decoder_model.onnx | 470MB | INT8-quantized decoder |
sentencepiece.bpe.model | 2.4MB | SentencePiece tokenizer |
| Total download | ~757MB | |
Supported Languages (100)
af, am, ar, ast, az, ba, be, bg, bn, br, bs, ca, ceb, cs, cy, da, de, el, en, es, et, fa, ff, fi, fr, fy, ga, gd, gl, gu, ha, he, hi, hr, ht, hu, hy, id, ig, ilo, is, it, ja, jv, ka, kk, km, kn, ko, lb, lg, ln, lo, lt, lv, mg, mk, ml, mn, mr, ms, my, ne, nl, no, ns, oc, or, pa, pl, ps, pt, ro, ru, sd, si, sk, sl, so, sq, sr, ss, su, sv, sw, ta, th, tl, tn, tr, uk, ur, uz, vi, wo, xh, yi, yo, zh, zu
Architecture
- Encoder inputs:
input_ids, attention_mask
- Encoder output:
last_hidden_state (float32, shape: [batch, seq, 1024])
- Decoder inputs:
input_ids, encoder_attention_mask, encoder_hidden_states
- Decoder output:
last_hidden_state (float32, shape: [batch, seq, 1024])
Usage
Decoder Input Format
The decoder must be initialized with [BOS, target_language_id] where:
- BOS = token ID 2 (the
</s> token)
target_language_id = the M2M100 language code token ID (see below)
Language Code Token IDs
| Language | Code | Token ID | Language | Code | Token ID |
|---|
| English | en | 128022 | French | fr | 128028 |
| German | de | 128020 | Spanish | es | 128023 |
| Italian | it | 128045 | Portuguese | pt | 128073 |
| Russian | ru | 128077 | Chinese | zh | 128102 |
| Japanese | ja | 128046 | Arabic | ar | 128006 |
| Hindi | hi | 128036 | Korean | ko | 128050 |
Full list available in tokenizer_config.json.
Export Details
- Base model:
facebook/m2m100_418M
- Exported via:
optimum-cli export onnx --optimize O1
- Quantization: INT8 dynamic per-tensor via
optimum.onnxruntime.ORTQuantizer
- Opset: 18
- License: MIT
Performance
- FP32 size: ~3.0GB
- FP16 size: ~1.5GB
- INT8 size: ~757MB (this repo)
- INT8 quality: Identical to FP32/FP16