Results from neuronxcc-2.28.7631.0+8f7b0cf5
Browse files
README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
pretty_name: torch-neuronx model support
|
| 4 |
+
tags:
|
| 5 |
+
- neuron
|
| 6 |
+
- trainium
|
| 7 |
+
- transformers
|
| 8 |
+
configs:
|
| 9 |
+
- config_name: default
|
| 10 |
+
data_files:
|
| 11 |
+
- split: train
|
| 12 |
+
path: data/*/*.parquet
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# torch-neuronx model support
|
| 16 |
+
|
| 17 |
+
Which Hugging Face Hub models run unmodified on AWS Trainium, through the
|
| 18 |
+
native PyTorch backend
|
| 19 |
+
[`torch-neuronx`](https://github.com/aws-neuron/torch-neuronx), for each
|
| 20 |
+
`neuronx-cc` and library version tested. The only library tested so far is
|
| 21 |
+
[`transformers`](https://github.com/huggingface/transformers).
|
| 22 |
+
|
| 23 |
+
To look up a model, use the
|
| 24 |
+
[Space](https://huggingface.co/spaces/aws-neuron/torch-neuronx-model-support).
|
| 25 |
+
|
| 26 |
+
## What is tested
|
| 27 |
+
|
| 28 |
+
### transformers
|
| 29 |
+
|
| 30 |
+
Each run loads a model on a `trn2` instance and generates 32 tokens greedily
|
| 31 |
+
from the prompt `"The future of AI is"`, sent as a user message for chat
|
| 32 |
+
models. The model is loaded with `tp_plan="auto"`, or expert-parallel for
|
| 33 |
+
mixture-of-experts models without a tensor-parallel plan, at the smallest
|
| 34 |
+
power-of-two degree that fits its bf16 weights. Generation uses
|
| 35 |
+
`torch.compile(backend="neuron")` with a static cache and chunked prefill.
|
| 36 |
+
|
| 37 |
+
| `result` | Meaning |
|
| 38 |
+
|---|---|
|
| 39 |
+
| `PASS` | The model loaded, `generate()` returned, and the output check passed or could not run. |
|
| 40 |
+
| `FAIL(load)` | `from_pretrained` raised. |
|
| 41 |
+
| `FAIL(gen)` | `generate()` raised. |
|
| 42 |
+
| `FAIL(output)` | `generate()` returned, but the output check failed. |
|
| 43 |
+
| `FAIL(other)` | The run crashed, or the model's extra Python packages could not be installed. |
|
| 44 |
+
|
| 45 |
+
The output check compares a TP=1 run with a CPU run of the same checkpoint
|
| 46 |
+
and prompt: the tokens must match, or differ first at a near-tie. At higher
|
| 47 |
+
TP, or when the CPU run cannot complete, a small instruct model judges whether
|
| 48 |
+
the text is fluent English. `PASS` says nothing about throughput or about
|
| 49 |
+
longer generations.
|
| 50 |
+
|
| 51 |
+
The models are the top `text-generation` and `image-text-to-text` models on
|
| 52 |
+
the Hub by downloads and trending, reselected before each sweep. Quantized
|
| 53 |
+
checkpoints and models that need `trust_remote_code` are left out. A model
|
| 54 |
+
that leaves the list keeps the results it already has.
|
| 55 |
+
|
| 56 |
+
## Layout
|
| 57 |
+
|
| 58 |
+
There is one file per tested `(neuronx-cc, library version)` pair:
|
| 59 |
+
|
| 60 |
+
```
|
| 61 |
+
data/neuronxcc-<version>/<library>-<version>.parquet
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
Each sweep tests the current Neuron SDK with the library version of the day,
|
| 65 |
+
so most pairs are never tested. A model missing from a pair was not tested
|
| 66 |
+
there, which does not mean it fails.
|
| 67 |
+
|
| 68 |
+
| Column | Content |
|
| 69 |
+
|---|---|
|
| 70 |
+
| `model_id`, `library`, `tp`, `runner` | The model, the library that loads it, its tensor- or expert-parallel degree, and the load class (`run_dense`: `AutoModelForCausalLM`, `run_multimodal`: `AutoModelForImageTextToText`, `run_dense_ep`: expert-parallel). |
|
| 71 |
+
| `result`, `notes` | The outcome, and the start of the generated text or of the error. |
|
| 72 |
+
| `error` | The full exception message of a `FAIL(load)` or `FAIL(gen)` run. |
|
| 73 |
+
| `cpu_match` | TP=1 only: `Y` if the tokens match a CPU run, `~ near-tie …` if they differ only at a near-tie, `N …` if not. |
|
| 74 |
+
| `english` | The judge's verdict, `Y` or `N`, when the CPU comparison did not run. |
|
| 75 |
+
| `wall_s`, `hbm_peak_gb`, `hbm_capacity_gb` | Wall time of the run, including compilation, and peak device memory against what the TP degree provides. |
|
| 76 |
+
| `neuronx_cc`, `library_version`, `transformers`, `accelerate`, `torch_neuronx`, `torch`, `nki`, `python`, `neuron_driver` | The stack the run used. `transformers` is also set for the libraries built on it. |
|
| 77 |
+
| `tested_at` | When the run started (UTC). |
|
| 78 |
+
| `run_py` | The standalone script that ran. |
|
| 79 |
+
|
| 80 |
+
## Querying
|
| 81 |
+
|
| 82 |
+
```python
|
| 83 |
+
import pandas as pd
|
| 84 |
+
|
| 85 |
+
df = pd.read_parquet("hf://datasets/aws-neuron/torch-neuronx-model-support/data")
|
| 86 |
+
df[df.model_id == "Qwen/Qwen3-0.6B"][["neuronx_cc", "library", "library_version", "tp", "result"]]
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
## Reproducing a run
|
| 90 |
+
|
| 91 |
+
Each `run_py` is a standalone script. Its header lists the Neuron stack it ran
|
| 92 |
+
on and a `pip install` line for the packages it adds on top. On a Trainium2
|
| 93 |
+
instance with that stack, for example the AWS Neuron Deep Learning Container,
|
| 94 |
+
install those packages, then:
|
| 95 |
+
|
| 96 |
+
```bash
|
| 97 |
+
python3 run.py
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
On a `trn2` instance, the run can skip compilation by first copying the
|
| 101 |
+
compiled graphs of its compiler, from the public
|
| 102 |
+
[NEFF cache](https://huggingface.co/buckets/aws-neuron/torch-neuronx-neff-cache):
|
| 103 |
+
|
| 104 |
+
```bash
|
| 105 |
+
hf buckets sync hf://buckets/aws-neuron/torch-neuronx-neff-cache/neuronxcc-<neuronx_cc> /tmp/neff_cache
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
The script launches its own `torch.distributed` ranks for TP > 1.
|
data/neuronxcc-2.28.7631.0+8f7b0cf5/transformers-5.20.1.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d96da55efdece57ce13e0deaf3a8fe4ada0d21a6bb3b943a2c4069d789aa56d
|
| 3 |
+
size 14186
|
data/neuronxcc-2.28.7631.0+8f7b0cf5/transformers-5.20.2.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eabc5e0c157025a8a975e5a18043aff6fc3f5f1d9aa1c50880532a48a8466313
|
| 3 |
+
size 177518
|