NLLB-200 distilled 600M — Apple Neural Engine (W8)
Core ML conversion of facebook/nllb-200-distilled-600M
laid out for the Apple Neural Engine (ml-ane-transformers / WhisperKit TextDecoder style):
channels-first (1, C, 1, S) activations, 1×1 conv linears, per-head einsum attention,
fixed shapes, fixed-size KV cache as I/O, fp16 compute, int8 per-channel weights (W8A16).
Deployment target iOS 18 / macOS 15.
License: CC-BY-NC-4.0 (inherited from the base model).
Files
| File | Size | |
|---|---|---|
NLLB_ANE_Encoder_128.mlpackage |
177.3 MB | inputs_embeds (1,1024,1,128), attention_mask (1,128) → cross_k, cross_v (1,12288,1,128) |
NLLB_ANE_Decoder_128x128.mlpackage |
440.6 MB | one decode step → logits (1,256206), key/value_cache_updates (1,12288,1,1) |
embeddings_fp16.bin |
524.7 MB | (256206, 1024) fp16, already × 32 (embed_scale); mmap it |
positions_fp16.bin |
0.3 MB | (130, 1024) fp16 sinusoidal rows; token i uses row i+2 |
ane_manifest.json |
shapes, token ids, decode contract, verification | |
tokenizer/ |
tokenizer.json (NLLB fast tokenizer) |
All I/O is fp16. Additive masks use -1e4.
Decode contract
- source ids = tokenizer(src_lang) (lang token, pieces, ), right-pad with pad to S
- inputs_embeds[:, :, 0, i] = embeddings[id_i] + positions[i + 2]
- attention_mask / encoder_attention_mask: 0 for real tokens, mask_negative for pads
- decoder tokens: [=2, tgt_lang, ...]; step at position p feeds token p with positions[p + 2]
- kv_cache_update_mask: one-hot at p; decoder_key_padding_mask: 0 for 0...p, mask_negative after
- after each step write key/value_cache_updates[:, :, 0, 0] into cache[:, :, 0, p]
- the step at p=0 () only fills the cache; greedy argmax starts at the step for p=1
Verification (Mac, CPU_AND_NE)
- Greedy output vs HF
generate(num_beams=1): 12/12 token-exact MLComputePlanNeural Engine placement: encoder 100.00%, decoder 99.87% (CPU: {'ios18.reshape': 1, 'ios18.concat': 2})- Decoder step latency: p50 24.65 ms (Apple silicon Mac)
| Pair | Output | Exact |
|---|---|---|
| eng_Latn->jpn_Jpan | 今日は天気が良いので公園を歩こう. | ✅ |
| eng_Latn->urd_Arab | براہ کرم مجھے بتائیں کہ قریب ترین ٹرین اسٹیشن کہاں ہے. | ✅ |
| jpn_Jpan->eng_Latn | Tomorrow's meeting starts at 3:00 p.m. | ✅ |
| urd_Arab->eng_Latn | I'm going to the market tonight. | ✅ |
| eng_Latn->swh_Latn | Daktari alisema niendelee kunywa maji na kupumzika. | ✅ |
| fra_Latn->deu_Latn | Wir haben einen Tisch für vier Personen in den 20 Stunden reserviert. | ✅ |
| eng_Latn->heb_Hebr | אתה יכול לעזור לי לשאת את התיקים האלה למכונית? | ✅ |
| pes_Arab->eng_Latn | This book was a gift from a friend of mine. | ✅ |
| eng_Latn->tha_Thai | ฉันอยากเปลี่ยนเที่ยวบินไปวันจันทร์หน้า | ✅ |
| hin_Deva->eng_Latn | Please close the door, it is very cold outside. | ✅ |
| eng_Latn->nob_Latn | Museet er stengt på helligdager. | ✅ |
| zho_Hans->eng_Latn | We'll go to the movies next week. | ✅ |
Converter: Scripts/converters/convert_nllb200_ane.py (TranslateBlue).
- Downloads last month
- 4
Model tree for aoiandroid/nllb200-ane-w8
Base model
facebook/nllb-200-distilled-600M