# apple/ml-ane-transformers

Reference implementation of the Transformer architecture optimized for Apple Neural Engine (ANE)

Repository: https://github.com/apple/ml-ane-transformers
Canonical: https://ross.abutalabs.com/products/ml-ane-transformers
Language: Python
License: NOASSERTION
License Family: other
Last push: 2023-04-25T09:24:38+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 1552, "days_push": 1226, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2736, forks 93 (observed 2026-08-28T04:07:16.287941+00:00)

## What it is
A reference PyTorch implementation of the Transformer architecture optimized for Apple's Neural Engine (ANE), including optimized Hugging Face model classes like DistilBERT. It enables deployment of Transformer models on Apple devices (A14+/M1+) with significantly improved latency and memory efficiency via Core ML conversion.

## Use cases
- deploy transformers on apple neural engine
- speed up distilbert inference on iphone
- reduce memory usage of transformer models on apple devices
- convert huggingface models to core ml
- optimize on-device nlp inference for ios

## When to choose
- deploying transformer models on Apple A14+/M1+ devices
- needing faster and lower-memory on-device inference via Core ML
- optimizing Hugging Face models like DistilBERT for ANE

## When to avoid
- targeting non-Apple hardware or GPUs
- training models rather than deploying them
- needing actively updated support for the latest model architectures

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, deep-learning, llm-inference
- domain: machine-learning, deep-learning, apple-ecosystem
- platform: python
- tags: apple-neural-engine, coreml, transformer-optimization, pytorch, on-device-inference, macos, ios

## Member repositories
- apple/ml-ane-transformers (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:16.287941+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:14:26.475802+00:00, confidence not recorded.
  - readme: https://github.com/apple/ml-ane-transformers (fetched 2026-08-28T04:07:16.287941+00:00, sha 82b52520ed29)
- Data as of 2026-08-30T08:39:29.467469+00:00.
