Skip to content

Commit 5159220

Browse files
authored
Merge branch 'ArmDeveloperEcosystem:main' into main
2 parents 077bb7d + 4b08db9 commit 5159220

78 files changed

Lines changed: 2773 additions & 155 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

content/install-guides/dcperf.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: DCPerf
3+
author: Kieran Hejmadi
4+
minutes_to_complete: 20
5+
official_docs: https://github.com/facebookresearch/DCPerf?tab=readme-ov-file#install-and-run-benchmarks
6+
7+
additional_search_terms:
8+
- linux
9+
- Neoverse
10+
11+
test_images:
12+
- ubuntu:22.04
13+
test_maintenance: false
14+
15+
layout: installtoolsall
16+
multi_install: false
17+
multitool_install_part: false
18+
tool_install: true
19+
weight: 1
20+
---
21+
22+
## Introduction
23+
24+
DCPerf is an open source benchmarking and microbenchmarking suite, originally developed by Meta, that faithfully replicates the characteristics of various general purpose data center workloads. One of the key differentiators to alternate benchmarking software is the fidelity of micro-architectural behaviour replicated by DCPerf, for example, cache misses, branch misprediction rate etc.
25+
26+
The use cases of running DCPerf are to generate performance data to inform procurement decision and regression testing for changes in environment, such as kernel and compiler changes. This installation guide is to install DCPerf on Arm-based servers. This example has been tested on a AWS `c7g.metal` instance running Ubuntu 22.04 LTS.
27+
28+
Please Note: When running on a server provided by a cloud service provided, you will have limit access to change parameters such as BIOS settings which can impact performance.
29+
30+
## Install Prerequisites
31+
32+
Enter the default daemons to restart if asked.
33+
34+
```bash
35+
sudo apt update
36+
sudo apt install -y python3-pip git
37+
sudo pip3 install click pyyaml tabulate pandas
38+
```
39+
40+
Clone the repostory
41+
42+
```bash
43+
git clone https://github.com/facebookresearch/DCPerf.git
44+
cd DCPerf
45+
```
46+
47+
48+
## Running a the MediaWiki Benchmark
49+
50+
DCPerf offers many benchmarks, please refer the official documentation for the benchmark of your choice. In this example we will run the MediaWiki benchmark. The MediaWiki benchmark is designed to faithfully reproduce the workload of the facebook social networking site. First install the dependency.
51+
52+
```bash
53+
wget https://github.com/facebookresearch/DCPerf/releases/download/hhvm/hhvm-3.30-multplatform-binary-ubuntu.tar.xz
54+
tar -Jxf hhvm-3.30-multplatform-binary-ubuntu.tar.xz
55+
cd hhvm
56+
sudo ./pour-hhvm.sh
57+
export LD_LIBRARY_PATH="/opt/local/hhvm-3.30/lib:$LD_LIBRARY_PATH"
58+
```
59+
60+
Confirm `hhvm` is available with no link time issues. `hhvm` will be available in the `DCPerf/hhvm/aarch64-ubuntu22.04/hhvm-3.30/bin` directory.
61+
62+
```bash
63+
hhvm --version
64+
```
65+
66+
You should see an output like the following with no errors.
67+
68+
```output
69+
HipHop VM 3.30.12 (rel)
70+
Compiler: 1704922878_080332982
71+
Repo schema: 4239d11395efb06bee3ab2923797fedfee64738e
72+
```
73+
74+
Confirm security-enhanced Linux (SELinux) is disabled with the following commands.
75+
76+
```bash
77+
sudo apt install selinux-utils
78+
getenforce
79+
```
80+
81+
You should see the following response. If you do not see the `Disabled` output. Please refer to your distributions documentation on how to disable before proceeding.
82+
83+
```output
84+
Disabled
85+
```
86+
87+
88+
The `install` argument to the `benchpress_cli.py` command line script can be used to automatially install all dependencies for each benchmark.
89+
90+
```bash
91+
sudo ./benchpress_cli.py install oss_performance_mediawiki_mlp
92+
```
93+
94+
Please note this can take several minutes to do all the required steps.
95+
96+
97+
## Run the MediaWiki Benchmark
98+
99+
For sake of brevity we will pass in duration and timeout arguments through a `JSON` dictionary with the `-i` argument.
100+
101+
```bash
102+
sudo ./benchpress_cli.py run oss_performance_mediawiki_mlp -i '{
103+
"duration": "30s",
104+
"timeout": "1m"
105+
}'
106+
```
107+
108+
Whilst the benchmark is running you will be able to observe the various processes occupying the CPU with the `top` command.
109+
110+
111+
Once the benchmark is complete, within the `DCPerf` directory a `benchmark_metrics_*` directory will be created with a `JSON` file for the system specs and metrics respectively.
112+
For example, the metrics file will list the
113+
114+
```output
115+
"metrics": {
116+
"Combined": {
117+
"Nginx 200": 1817810,
118+
"Nginx 404": 79019,
119+
"Nginx 499": 3,
120+
"Nginx P50 time": 0.036,
121+
"Nginx P90 time": 0.056,
122+
"Nginx P95 time": 0.066,
123+
"Nginx P99 time": 0.081,
124+
"Nginx avg bytes": 158903.93039183,
125+
"Nginx avg time": 0.038826036781319,
126+
"Nginx hits": 1896832,
127+
"Wrk RPS": 3160.65,
128+
"Wrk failed requests": 79019,
129+
"Wrk requests": 1896703,
130+
"Wrk successful requests": 1817684,
131+
"Wrk wall sec": 600.1,
132+
"canonical": 0
133+
},
134+
"score": 2.4692578125
135+
```

content/learning-paths/servers-and-cloud-computing/bolt/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ minutes_to_complete: 30
55

66
who_is_this_for: This is an introductory topic for software developers who want to learn how to use BOLT on an Arm executable.
77

8-
learning_objectives:
9-
- Build an application which is ready to be optimized by BOLT
8+
learning_objectives:
9+
- Build an application which is ready to be optimized by BOLT
1010
- Profile an application and collect performance information
11-
- Run BOLT to create an optimized executable
11+
- Run BOLT to create an optimized executable
1212

1313
prerequisites:
14-
- An Arm based system running Linux with [BOLT](/install-guides/bolt/) and [Linux Perf](/install-guides/perf/) installed. The Linux kernel should be version 5.15 or later. Earlier kernel versions can be used, but some Linux Perf features may be limited or not available.
14+
- An Arm based system running Linux with [BOLT](/install-guides/bolt/) and [Linux Perf](/install-guides/perf/) installed. The Linux kernel should be version 5.15 or later. Earlier kernel versions can be used, but some Linux Perf features may be limited or not available. For [SPE](./bolt-spe) the version should be 6.14 or later.
1515
- (Optional) A second, more powerful Linux system to build the software executable and run BOLT.
1616

1717
author: Jonathan Davies

content/learning-paths/servers-and-cloud-computing/bolt/bolt-spe.md

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,59 +7,60 @@ layout: learningpathall
77
---
88

99
## BOLT with SPE
10+
The steps to use BOLT with Perf SPE are listed below.
1011

11-
{{% notice Important Note %}}
12-
Currently, BOLT may not generate a faster binary when using Perf SPE due to limitations within `perf` and BOLT itself.
13-
For more information and the latest updates see: [[AArch64] BOLT does not support SPE branch data](https://github.com/llvm/llvm-project/issues/115333).
14-
{{% /notice %}}
12+
### Collect Perf data with SPE
1513

16-
The steps to use BOLT with Perf SPE are listed below.
14+
First, make sure you are using Linux Perf version v6.14 or later, which supports the 'brstack' field and captures all branch information.
1715

18-
### Collect Perf data with SPE
16+
```bash { output_lines = "2" }
17+
perf --version
18+
perf version 6.14
19+
```
1920

20-
Run your executable in the normal use case and collect a SPE performance profile. This will output a `perf.data` file containing the profile and will be used to optimize the executable.
21+
Next, run your executable in the normal use case to collect an SPE performance profile. This generates a `perf.data` file containing the profile, which will be used to optimize the executable.
2122

22-
Record samples while running your application. Substitute the actual name of your application for `executable`:
23+
Record samples while running your application, replacing `executable` below:
2324

2425
```bash { target="ubuntu:latest" }
25-
perf record -e arm_spe/branch_filter=1/u -o perf.data-- ./executable
26+
perf record -e 'arm_spe/branch_filter=1/u' -o perf.data -- ./executable
2627
```
28+
Once the execution is complete, perf will print a summary that includes the size of the `perf.data` file:
2729

28-
Perf prints the size of the `perf.data` file:
29-
30-
```output
30+
```bash { target="ubuntu:latest" }
3131
[ perf record: Woken up 79 times to write data ]
3232
[ perf record: Captured and wrote 4.910 MB perf.data ]
3333
```
3434

35-
### Convert the Profile into BOLT format
35+
The `-jitter=1` flag can help avoid resonance, while `-c`/`--count` controls the sampling period.
36+
37+
### Convert the Profile to BOLT format
3638

37-
`perf2bolt` converts the profile into a BOLT data format. For the given sample data, `perf2bolt` finds all instruction pointers in the profile, maps them back to the assembly instructions, and outputs a count of how many times each assembly instruction was sampled.
39+
`perf2bolt` converts the profile into BOLT's data format. It maps branch events from the profile to assembly instructions and outputs branch execution traces with sample counts.
3840

39-
If you application is named `executable`, run the commend below to convert the profile data:
41+
If you application is named `executable`, run the command below to convert the profile data:
4042

4143
```bash { target="ubuntu:latest" }
42-
perf2bolt -p perf.data -o perf.fdata -nl ./executable
44+
perf2bolt -p perf.data -o perf.fdata --spe ./executable
4345
```
4446

45-
Below is example output from `perf2bolt`, it has read all samples and created the file `perf.fdata`.
47+
Below is example output from `perf2bolt`, it has read all samples from `perf.data` and created the converted profile `perf.fdata`.
4648

4749
```output
4850
BOLT-INFO: shared object or position-independent executable detected
4951
PERF2BOLT: Starting data aggregation job for perf.data
50-
PERF2BOLT: spawning perf job to read events without LBR
52+
PERF2BOLT: spawning perf job to read SPE brstack events
5153
PERF2BOLT: spawning perf job to read mem events
5254
PERF2BOLT: spawning perf job to read process events
5355
PERF2BOLT: spawning perf job to read task events
5456
BOLT-INFO: Target architecture: aarch64
55-
BOLT-INFO: BOLT version: c66c15a76dc7b021c29479a54aa1785928e9d1bf
57+
BOLT-INFO: BOLT version: b1516a9d688fed835dce5efc614302649c3baf0e
5658
BOLT-INFO: first alloc address is 0x0
57-
BOLT-INFO: creating new program header table at address 0x200000, offset 0x200000
59+
BOLT-INFO: creating new program header table at address 0x4600000, offset 0x4600000
5860
BOLT-INFO: enabling relocation mode
59-
BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
6061
BOLT-INFO: enabling strict relocation mode for aggregation purposes
6162
BOLT-INFO: pre-processing profile using perf data aggregator
62-
BOLT-INFO: binary build-id is: 21dbca691155f1e57825e6381d727842f3d43039
63+
BOLT-INFO: binary build-id is: 8bb7beda9bae10bc546eace62775dd2958a9c940
6364
PERF2BOLT: spawning perf job to read buildid list
6465
PERF2BOLT: matched build-id and file name
6566
PERF2BOLT: waiting for perf mmap events collection to finish...
@@ -68,13 +69,18 @@ PERF2BOLT: waiting for perf task events collection to finish...
6869
PERF2BOLT: parsing perf-script task events output
6970
PERF2BOLT: input binary is associated with 1 PID(s)
7071
PERF2BOLT: waiting for perf events collection to finish...
71-
PERF2BOLT: parsing basic events (without LBR)...
72+
PERF2BOLT: SPE branch events in LBR-format...
73+
PERF2BOLT: read 3592267 samples and 3046129 LBR entries
74+
PERF2BOLT: ignored samples: 0 (0.0%)
7275
PERF2BOLT: waiting for perf mem events collection to finish...
7376
PERF2BOLT: parsing memory events...
74-
PERF2BOLT: processing basic events (without LBR)...
75-
PERF2BOLT: read 79 samples
76-
PERF2BOLT: out of range samples recorded in unknown regions: 5 (6.3%)
77-
PERF2BOLT: wrote 14 objects and 0 memory objects to perf.fdata
77+
PERF2BOLT: processing branch events...
78+
PERF2BOLT: traces mismatching disassembled function contents: 0
79+
PERF2BOLT: out of range traces involving unknown regions: 0
80+
PERF2BOLT: wrote 21027 objects and 0 memory objects to perf.fdata
81+
BOLT-INFO: 2178 out of 72028 functions in the binary (3.0%) have non-empty execution profile
82+
BOLT-INFO: 12 functions with profile could not be optimized
83+
BOLT-INFO: Functions with density >= 0.0 account for 99.00% total sample counts
7884
```
7985

8086
### Run BOLT to generate the optimized executable
@@ -155,4 +161,4 @@ BOLT-INFO: setting __hot_end to 0x4002b0
155161
BOLT-INFO: patched build-id (flipped last bit)
156162
```
157163

158-
The optimized executable is now available as `new_executable`.
164+
The optimized executable is now available as `new_executable`.

content/learning-paths/servers-and-cloud-computing/cobalt/1-create-cobalt-vm.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,29 @@ layout: learningpathall
88

99
## Use the Azure Portal to deploy a Cobalt 100 VM
1010

11-
Cobalt 100 is Microsoft’s first Arm-based server processor, built using the Armv9 Neoverse-N2 CPU. The Cobalt 100 processor is optimized for the performance of scale-out cloud-based applications.
11+
Cobalt 100 is Microsoft’s first Arm-based server processor, built on the Armv9 Neoverse-N2 CPU architecture. It is optimized for the performance and efficiency of scale-out, cloud-based applications.
1212

13-
The Azure Cobalt 100 VM instances include two series:
13+
Azure offers Cobalt 100–powered virtual machines in two series:
14+
15+
- **Dpsv6** and **Dplsv6** (general-purpose)
16+
- **Epsv6** (memory-optimized)
1417

15-
The general-purpose Dpsv6 and Dplsv6 virtual machine series.
16-
The memory-optimized Epsv6 virtual machine series.
1718

1819
To create a Cobalt 100 VM, follow these steps:
1920

2021
1. Sign in to the [Azure Portal](https://portal.azure.com/).
2122
2. Select **Create a resource → Compute → Virtual machine**.
22-
3. Complete the *Basics* tab:
23-
![Azure Portal – Basics tab for the VM wizard#center](images/create-cobalt-vm.png)
24-
The Dpsv6-series are powered by Cobalt 100. Selecting Standard_D4ps_v6 will give you a Cobalt VM with 4 physical cores. you can change the 4 to another value if you want a different number of cores.
23+
3. Complete the fields in the **Basics** tab using the values shown in the figure below:
24+
25+
![Azure Portal – Basics tab for the VM wizard#center](images/create-cobalt-vm.png "Configuring the Basics tab")
26+
27+
Cobalt 100 powers the Dpsv6 and Dplsv6 series. Selecting **Standard_D4ps_v6** creates a Cobalt VM with four physical cores.
28+
You can choose a different size if you need more or fewer cores.
2529
4. Upload your public SSH key or generate a new one in the wizard.
26-
5. Disallow public inbound ports for now.
27-
5. Accept the defaults on the *Disks* tab.
28-
6. On the *Networking* tab ensure that a **Public IP** is selected. You will need it to connect later. Leave the NSG settings as *Basic* for now.
30+
5. For the **Public inbound ports** field, select **None**.
31+
6. On the **Disks** tab, accept the default options.
32+
7. On the **Networking** tab, ensure that a **Public IP** is selected. You will need it to connect to the VM later. Leave the NSG settings as **Basic**.
2933

30-
Click **Review + create** followed by **Create**. Azure now deploys the VM and the automatically-generated Network Security Group (NSG). Provisioning takes ~2 minutes.
34+
8. Select **Review + create**, then **Create**. Azure deploys the VM and the automatically-generated Network Security Group (NSG). Provisioning takes ~2 minutes.
3135

32-
Navigate to the **Deployment in progress** pane or open the **Notifications** panel to track progress. When the deployment succeeds proceed to the next step to expose an inbound port.
36+
9. Navigate to the **Deployment in progress** pane or open the **Notifications** panel to track progress. When the deployment completes, proceed to the next step to expose an inbound port.
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Open an inbound port in the Network Security Group
2+
title: Open inbound ports in the Network Security Group
33
weight: 3
44

55
### FIXED, DO NOT MODIFY
@@ -8,16 +8,20 @@ layout: learningpathall
88

99
## Allow external traffic to TCP ports 22 (SSH) and 8080
1010

11-
Every new virtual machine created through the Azure wizard is associated with a **Network Security Group (NSG)**. An NSG acts like a stateful firewall – if no rule explicitly allows traffic, Azure blocks it.
11+
Every new virtual machine created through the Azure wizard is associated with a **Network Security Group (NSG)**. An NSG acts as a stateful firewall – if no rule explicitly allows traffic, Azure blocks it by default.
1212

13-
In this step you will open port 22 for SSH, as well as port 8080 so that a web application running on the VM is reachable from your IP for testing. Substitute a different port if required by your workload, or a different IP range if you'd like broader accessibility.
13+
In this step, you'll open port 22 for SSH and port 8080 so that a web application running on the VM is reachable from your IP for testing. Substitute a different port if required by your workload, or a different IP range if you'd like broader accessibility.
1414

15-
1. In the Azure Portal open the newly created VM resource and click **Networking → Network settings** in the left nav.
15+
1. In the Azure Portal, open the newly-created VM resource and select **Networking → Network settings** from the left-hand menu.
1616
2. Select the **Network security group**.
17-
3. Click on **Create Port Rule** and from the drop-down men select **Inbound port rule**
18-
4. Fill in the form, specifying **My IP address** as the source and 22 as the destination port:
19-
![Add inbound security rule with source of my IP and destination port 22#center](images/create-nsg-rule.png)
20-
5. Click **Add**.
21-
To open port 8080, follow steps 3 through 5 again, but instead choose port 8080 for the destination port.
17+
3. Select **Create Port Rule**, then choose **Inbound port rule** from the drop-down menu.
2218

23-
You have now opened ports 22 and 8080 to your IP. In the next step you will verify connectivity.
19+
4. Fill in the form with **My IP address** as the source and 22 as the destination port:
20+
21+
![Add inbound security rule with source of my IP and destination port 22#center](images/create-nsg-rule.png "Create Port Rule form")
22+
23+
5. Select **Add**.
24+
25+
6. To open port 8080, repeat steps 3-5 and enter 8080 as the destination port.
26+
27+
You have now opened ports 22 and 8080 to your IP. In the next step, you'll verify connectivity from your local machine.

content/learning-paths/servers-and-cloud-computing/cobalt/3-verify-connectivity.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@ layout: learningpathall
88

99
## Connect over SSH and test the open port
1010

11-
1. On the **Overview** page for the VM copy the **Public IP address**.
12-
2. Open a terminal on your local machine and SSH to the VM (replace *azureuser* if you chose a different admin username):
11+
On the **Overview** page of the VM, copy the **Public IP address**. Open a terminal on your local machine, and SSH to the VM (replace *azureuser* if you chose a different admin username):
1312

1413
```bash
1514
ssh -i [path to your pem file] azureuser@[public IP]
1615
```
1716

18-
Where `[public IP]` is your public IP and `[path to your pem file]` is the path to your SSH key file.
17+
Replace `[public IP]` with your VM's public IP address, and `[path to your pem file]` with the path to your SSH private key file.
1918

20-
Accept the prompt to add the host to *known_hosts* the first time you connect.
19+
When prompted, confirm the connection to add the VM to your *known_hosts* file.
2120

22-
### Start a simple HTTP server
21+
### Start a temporary HTTP server
2322

24-
If you do not already have an application listening on TCP 8080 you can start one temporarily:
23+
If you don't already have an application listening on TCP 8080, you can start one temporarily:
2524

2625
```bash
2726
sudo apt update -y && sudo apt install -y python3
@@ -32,16 +31,18 @@ Leave this terminal open – the server runs in the foreground.
3231

3332
### Test from your local machine
3433

35-
In a second local terminal run `curl` to confirm you can reach the server through the NSG rule you created:
34+
In a second local terminal run `curl` to confirm that you can reach the server through the NSG rule you created:
3635

3736
```bash
3837
curl http://[public IP]:8080
3938
```
4039

41-
Where `[public IP]` is your public IP.
40+
Replace `[public IP]` with your VM's public IP address.
4241

43-
You should see an HTML directory listing (or your application response). Receiving a response verifies that TCP 8080 is open and the VM is reachable from the public internet.
42+
You should see an HTML directory listing (or your application response). A successful response confirms that TCP port 8080 is open and the VM is reachable from the public internet.
4443

45-
Terminate the Python server when you are finished testing (press `Ctrl + C`).
44+
To stop the server, press `Ctrl + C`.
4645

47-
You now have an Arm-based Cobalt 100 VM with an exposed port 8080 that you can use to run any test server. To learn about optimizing .NET workloads on Cobalt, check out [Migrating a .NET application to Azure Cobalt](../../dotnet-migration/).
46+
You now have an Arm-based Cobalt 100 VM with port 8080 open and ready to receive external traffic. You can use it to run any test server or deploy your own application.
47+
48+
To learn about optimizing .NET workloads on Cobalt, check out [Migrating a .NET application to Azure Cobalt](../../dotnet-migration/).

0 commit comments

Comments
 (0)