Decode the output
The output file from the run contains 1,000 logits, one for each ImageNet class. Although the main model is INT8, the output boundary dequantizes the result to float32 before the runner writes it.
You will use a decoder script to turn this into class prediction.
The decoder script checks the file size against the number of labels to infer the stored data type:
labels = json.loads(args.labels.read_text())
nbytes = args.output.stat().st_size
if nbytes == len(labels) * 4:
dtype = "float32"
elif nbytes == len(labels):
dtype = "int8"
For the standard float32 output, it unpacks the raw little-endian bytes into Python values:
data = args.output.read_bytes()
scores = list(struct.unpack(f"<{len(data) // 4}f", data))
Logits are relative scores rather than percentages. The decoder applies softmax, subtracting the largest logit first to avoid unnecessarily large exponential values:
max_value = max(scores)
exps = [math.exp(value - max_value) for value in scores]
probabilities = [value / sum(exps) for value in exps]
Finally, it sorts the probabilities, takes the highest five indices, and uses each index to look up the corresponding ImageNet label:
top_indices = sorted(
range(len(probabilities)),
key=probabilities.__getitem__,
reverse=True,
)[:5]
for index in top_indices:
print(labels[index], probabilities[index] * 100)
Run decode_mobilenetv2_output.py to turn logit outputs into class labels:
python module-4-ethos-npu-accelerated-inference/scripts/fvp/decode_mobilenetv2_output.py \
--output module-4-ethos-npu-accelerated-inference/artifacts/fvp_runs/mobilenetv2_int8/out-0.bin \
--labels module-4-ethos-npu-accelerated-inference/artifacts/mobilenetv2/imagenet_labels.json
You should see Labrador retriever and golden retriever near the top.
What the FVP run validates
The successful FVP run validates the complete software path: the ExecuTorch program, Ethos-U delegate, bare-metal runtime, semihosted input and output, and Corstone-320 platform integration.
It confirms that the application runs and produces plausible classification output in the simulated target environment. It does not replace performance or functional testing on the intended hardware.
Before moving onto the next section, consider the optional activity to learn about the Arm ML Inference Advisor, a related tool.
Optional activity
Arm ML Inference Advisor
MLIA, the ML Inference Advisor, is an Arm tool for checking model compatibility and performance for supported inference targets.
The arm/mlia repository provides the shared command-line interface, plugin system, backend management, reporting model, and Python API. Target-specific behavior is added through plugin packages.
For Ethos-U, the arm/mlia-ethos-u plugin adds Ethos-U target profiles, Vela integration, and Corstone backend integration. In a larger workflow, MLIA can help package target selection, compatibility checks, backend setup, and performance reporting into a more repeatable advisory step.
You have already run the main pieces manually, so MLIA is not required for this module. It is useful when you want one advisory tool around target selection, compatibility checks, Vela, and Corstone runs.
To learn more, check out the learning path: Analyze machine learning models for Arm Ethos-U with Arm ML Inference Advisor .
Course complete
Nice work
You completed Optimize and deploy AI inference with ExecuTorch on Arm.