Skip to content

Commit 1c25a17

Browse files
Merge pull request #2419 from chrismoroney/cmoroney-nlp-last-reviewed-10-2025
NLP on Arm Update
2 parents 97a402f + 9f7068b commit 1c25a17

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

content/learning-paths/servers-and-cloud-computing/nlp-hugging-face/pytorch-nlp-hf.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ The output from this script should look like:
9696
3) positive 0.0477
9797
```
9898

99+
You should see three lines, each with a rank, sentiment label (negative / neutral / positive), and confidence score. The first line is the model’s strongest guess. The three probabilities should sum to 1. In this example, the model is confident the sentiment is negative.
100+
99101
You have successfully performed sentiment analysis on the input text, all running on your Arm AArch64 CPU. You can change the input text in your example and re-run the classification example.
100102

101103
Now that you have run the model, let's add the ability to profile the model execution. You can use the [PyTorch Profiler](https://pytorch.org/tutorials/recipes/recipes/profiler_recipe.html) to analyze the execution time on the CPU. Copy the contents shown below into a file named `sentiment-analysis-profile.py`:
@@ -177,7 +179,7 @@ Self CPU time total: 51.903ms
177179
2) neutral 0.2287
178180
3) positive 0.0477
179181
```
180-
In addition to the classification output from the model, you can now see the execution time for the different operators.
182+
In addition to the classification output from the model, you can now see the execution time for the different operators. The table shows how much time each operation takes on the CPU, both by itself and including any child operations.
181183

182184
You can experiment with the [BFloat16 floating-point number format](/install-guides/pytorch#bfloat16-floating-point-number-format) and [Transparent huge pages](/install-guides/pytorch#transparent-huge-pages) settings with PyTorch and see how that impacts the performance of your model.
183185

0 commit comments

Comments
 (0)