Skip to content

Commit f1fcfd8

Browse files
authored
Merge pull request #1281 from ArmDeveloperEcosystem/main
Merge to production
2 parents 5ea4d87 + b876a03 commit f1fcfd8

File tree

34 files changed

+1357
-30
lines changed

34 files changed

+1357
-30
lines changed

.wordlist.txt

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3187,4 +3187,32 @@ prem
31873187
softmax
31883188
subclassing
31893189
tanh
3190-
torchsummary
3190+
torchsummary
3191+
BatchNorm
3192+
CrossEntropyLoss
3193+
DataLoader
3194+
Dobrescu
3195+
ImageNet
3196+
MCA
3197+
MSE
3198+
RThroughput
3199+
Rin
3200+
SGD
3201+
TorchScript
3202+
argmax
3203+
certifi
3204+
dataloader
3205+
figsize
3206+
hyperparameter
3207+
jit
3208+
matplotlib
3209+
mca
3210+
optim
3211+
preprocess
3212+
preprocessed
3213+
pth
3214+
pyplot
3215+
scheduler's
3216+
torchvision
3217+
uOps
3218+
unsqueeze

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The Arm Learning Paths website is available at https://learn.arm.com/
22

3-
# Arm Learning Paths
3+
# Arm Learning Paths
44

55
This repository contains the source files for the Arm Learning Paths static website, serving learning based technical content for Arm software developers.
66

assets/css/demo.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,13 @@
245245
white-space: pre-wrap;
246246
}
247247

248+
.char-limit-mesg {
249+
font-size: 14px!important;
250+
margin-top: 4px;
251+
font-style: italic;
252+
}
253+
254+
248255

249256

250257
#notification-popup {

content/install-guides/cmsis-toolbox.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,27 @@ Set environment variables as below. Note the exact name of the `TOOLCHAIN` varia
123123
| ------------------------------------------ | ------------------------------------- | --------------------------------------------- |
124124
| `<name>_TOOLCHAIN_<major>_<minor>_<patch>` | Path to toolchain binaries | `<name>` = `AC6`, `GCC`, `IAR`, or `CLANG` |
125125
| `CMSIS_PACK_ROOT` | Path to CMSIS-Pack root directory | Use `cpackget init` to initialize |
126-
| `CMSIS_COMPILER_ROOT` | Path to CMSIS-Toolbox `etc` directory | |
127126
| `PATH` | Add CMSIS-Toolbox `bin` to path | Also path to `CMake` and `Ninja` if necessary |
127+
| `CMSIS_COMPILER_ROOT` | Path to CMSIS-Toolbox `etc` directory | Optional |
128+
128129

129130
For example:
130131
{{< tabpane code=true >}}
131132
{{< tab header="Windows" language="shell">}}
132133
set AC6_TOOLCHAIN_6_22_0=%ProgramFiles%/ArmCompilerforEmbedded6.22/bin
133134
set CMSIS_PACK_ROOT=%LocalAppData%/Arm/Packs
134-
set CMSIS_COMPILER_ROOT=%UserProfile%/cmsis-toolbox-windows-amd64/etc
135135
set PATH=%PATH%;%UserProfile%/cmsis-toolbox-windows-amd64/bin
136+
set CMSIS_COMPILER_ROOT=%UserProfile%/cmsis-toolbox-windows-amd64/etc
136137
{{< /tab >}}
137138
{{< tab header="Linux/macOS" language="shell">}}
138139
export AC6_TOOLCHAIN_6_22_0=$HOME/ArmCompilerforEmbedded6.22/bin
139140
export CMSIS_PACK_ROOT=$HOME/packs
140-
export CMSIS_COMPILER_ROOT=$HOME/cmsis-toolbox-linux-arm64/etc
141141
export PATH=$HOME/cmsis-toolbox-linux-arm64/bin:$PATH
142+
export CMSIS_COMPILER_ROOT=$HOME/cmsis-toolbox-linux-arm64/etc
142143
{{< /tab >}}
143144
{{< /tabpane >}}
144145

145-
Exact paths will depend on version installed and the install directory.
146+
Exact paths will depend on tools versions installed and their install locations.
146147

147148
## Initialize CMSIS-Pack directory
148149

content/install-guides/topdown-tool.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ cd telemetry-solution/tools/topdown_tool
8484
Install `topdown-tool` in `/usr/local/bin` using:
8585

8686
```console
87-
pip3 install -e .
87+
sudo pip3 install -e .
8888
```
8989

9090
{{% notice Note %}}
9191
If you are getting errors on the environment being externally managed, try creating a virtual environment.
9292
```
93-
sudo apt install python3-venv
93+
sudo apt install python3-venv -y
9494
python3 -m venv topdown-venv
9595
source topdown-venv/bin/activate
9696
pip3 install -e .
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: Learn about LLVM Machine Code Analyzer
3+
4+
minutes_to_complete: 60
5+
6+
who_is_this_for: This is an introductory topic for developers who want to diagnose performance issues of Arm programs using LLVM Machine Code Analyzer (MCA) and Compiler Explorer.
7+
8+
learning_objectives:
9+
- Estimate the hardware resource pressure and the number of cycles taken to execute your code snippet using llvm-mca.
10+
- Describe how this estimate can help diagnose possible performance issues.
11+
- Use Compiler Explorer to run llvm-mca.
12+
13+
prerequisites:
14+
- Familiarity with Arm assembly.
15+
- LLVM version 16 or newer, which includes support for Neoverse V2.
16+
17+
author_primary: Rin Dobrescu
18+
19+
### Tags
20+
skilllevels: Introductory
21+
subjects: Performance and Architecture
22+
armips:
23+
- Neoverse
24+
- Cortex-A
25+
tools_software_languages:
26+
- assembly
27+
- llvm-mca
28+
operatingsystems:
29+
- Linux
30+
- Windows
31+
- macOS
32+
33+
### Cross-platform metadata only
34+
shared_path: true
35+
shared_between:
36+
- servers-and-cloud-computing
37+
- laptops-and-desktops
38+
- smartphones-and-mobile
39+
40+
### FIXED, DO NOT MODIFY
41+
# ================================================================================
42+
weight: 1 # _index.md always has weight of 1 to order correctly
43+
layout: "learningpathall" # All files under learning paths have this same wrapper
44+
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
45+
---
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
next_step_guidance: >
3+
To learn more about performance analysis, proceed to:
4+
5+
recommended_path: /learning-paths/servers-and-cloud-computing/top-down-n1
6+
7+
further_reading:
8+
- resource:
9+
title: Arm Neoverse V2 Software Optimization Guide
10+
link: https://developer.arm.com/documentation/109898/0300/?lang=en
11+
type: documentation
12+
13+
14+
# ================================================================================
15+
# FIXED, DO NOT MODIFY
16+
# ================================================================================
17+
weight: 21 # set to always be larger than the content in this path, and one more than 'review'
18+
title: "Next Steps" # Always the same
19+
layout: "learningpathall" # All files under learning paths have this same wrapper
20+
---
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
review:
3+
- questions:
4+
question: >
5+
How can using MCA be useful?
6+
answers:
7+
- It can provide a performance estimation that can be used to understand and improve performance.
8+
- It can provide an improved version of a given code snippet.
9+
correct_answer: 1
10+
explanation: >
11+
MCA simulates the execution of a given snippet of assembly in a loop and provides performance measurements that can then be used to understand and improve performance.
12+
13+
- questions:
14+
question: >
15+
MCA can offer performance metrics for the following as input:
16+
answers:
17+
- A snippet of code, the language does not matter.
18+
- A snippet of assembly code.
19+
correct_answer: 2
20+
explanation: >
21+
MCA takes assembly code as input.
22+
23+
- questions:
24+
question: >
25+
When using Compiler Explorer, what does llvm-mca take as input?
26+
answers:
27+
- The source code provided.
28+
- The disassembly of the source code.
29+
correct_answer: 2
30+
explanation: >
31+
Compiler explorer takes as input the source code, compiles it and shows the disassembly output. It then can run llvm-mca on the disassembly of the source code.
32+
33+
34+
35+
# ================================================================================
36+
# FIXED, DO NOT MODIFY
37+
# ================================================================================
38+
title: "Review" # Always the same title
39+
weight: 20 # Set to always be larger than the content in this path
40+
layout: "learningpathall" # All files under learning paths have this same wrapper
41+
---
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Background
3+
weight: 2
4+
### FIXED, DO NOT MODIFY
5+
layout: learningpathall
6+
---
7+
8+
### Terminology
9+
10+
Before you get started, familiarize yourself with the terms below:
11+
12+
- **Instruction scheduling**: If two instructions appear in a sequence in a program, but are independent from each other, the compiler can swap them without affecting the program's behavior. The goal of instruction scheduling is to find a valid permutation of the program instructions that also optimizes the program's performance, by making use of processor resources.
13+
14+
- **Pipeline**: A pipeline is the mechanism used by the processor to execute instructions. Pipelining makes efficient use of processor resources by dividing instructions into stages that can overlap and be processed in parallel, reducing the time it takes for instructions to execute. Instructions can only be executed if the required data is available, otherwise this leads to a delay in execution called a pipeline stall.
15+
16+
- **Resource pressure**: Resources refer to the hardware units used to execute instructions. If instructions in a program all rely on the same resources, then it leads to pressure. Execution is slowed down as instructions must wait until the unit they need becomes available.
17+
18+
- **Data dependency**: Data dependency refers to the relationship between instructions. When an instruction requires data from a previous instruction this creates a data dependency.
19+
20+
21+
### What is Machine Code Analyzer (MCA)?
22+
23+
Machine Code Analyzer (MCA) is a performance analysis tool that uses information available in [LLVM](https://github.com/llvm/llvm-project) to measure performance on a specific CPU.
24+
25+
26+
### How can MCA be useful?
27+
28+
MCA takes as input a snippet of assembly code and then simulates the execution of that code in a loop of iterations, and the default is 100.
29+
30+
MCA then outputs a performance report, which contains information such as the latency and throughput of the assembly block and the resource usage for each instruction.
31+
32+
Using this information, you can identify bottlenecks in performance such as resource pressure and data dependencies. There are many options you can give MCA to get performance metrics. The options are explained in the [llvm-mca documentation](https://llvm.org/docs/CommandGuide/llvm-mca.html).
33+
176 KB
Loading

0 commit comments

Comments
 (0)