Skip to content

Commit ea800d1

Browse files
Content dev
1 parent 6e87e07 commit ea800d1

2 files changed

Lines changed: 22 additions & 21 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Accelerate Search Operations with SVE2 MATCH Instruction on Arm servers
2+
title: Accelerate search performance with SVE2 MATCH on Arm servers
33

44

55
minutes_to_complete: 20
@@ -8,10 +8,10 @@ who_is_this_for: This is an introductory topic for database developers, performa
88

99

1010
learning_objectives:
11-
- Understand how SVE2 MATCH instructions work
12-
- Implement search algorithms using scalar and SVE2 implementations using the MATCH instruction
13-
- Compare performance between scalar and vectorized implementations
14-
- Measure performance improvements on Graviton4 instances
11+
- Understand the purpose and function of SVE2 MATCH instructions
12+
- Implement a search algorithm using both scalar and SVE2-based MATCH approaches
13+
- Benchmark and compare performance between scalar and vectorized implementations
14+
- Analyze speedups and efficiency gains on Arm Neoverse-based Graviton4 instances
1515
prerequisites:
1616
- Access to an [Arm-based instance](/learning-paths/servers-and-cloud-computing/csp/) from a supported cloud service provider
1717

content/learning-paths/servers-and-cloud-computing/sve2-match/sve2-match-search.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# User change
3-
title: "Compare Search Performance Using Scalar and SVE2 MATCH on Arm Servers"
3+
title: "Compare search performance using scalar and SVE2 MATCH on Arm Servers"
44

55
weight: 2
66

@@ -10,30 +10,29 @@ layout: "learningpathall"
1010
---
1111
## Introduction
1212

13-
Searching for specific values in large arrays is a fundamental operation in many applications, from databases to text processing. The performance of these search operations can significantly affect overall application performance, especially when dealing with large datasets.
14-
15-
In this Learning Path, you will learn how to use the SVE2 MATCH instructions available on Arm Neoverse V2 based AWS Graviton4 processors to optimize search operations in byte and half word arrays. You will compare the performance of scalar and SVE2 MATCH implementations to demonstrate the significant performance benefits of using specialized vector instructions.
13+
Searching large arrays for specific values is a core task in performance-sensitive applications—from filtering records in a database to detecting patterns in text or images. On Arm Neoverse-based servers, SVE2 MATCH instructions unlock massive performance gains by vectorizing these operations. In this Learning Path, you’ll implement and benchmark both scalar and vectorized versions of search functions to see just how much faster your workloads can run.
1614

1715
## What is SVE2 MATCH?
1816

1917
SVE2 (Scalable Vector Extension 2) is an extension to the Arm architecture that provides vector processing capabilities with a length-agnostic programming model. The MATCH instruction is a specialized SVE2 instruction that efficiently searches for elements in a vector that match any element in another vector.
2018

2119
## Set up your environment
2220

23-
To follow this learning path, you will need:
21+
To work through these examples, you require:
2422

25-
1. An AWS Graviton4 instance running `Ubuntu 24.04`
26-
2. GCC compiler with SVE support
23+
* An AWS Graviton4 instance running `Ubuntu 24.04`
24+
* GCC compiler with SVE support
2725

2826
Start by setting up your environment:
2927

3028
```bash
3129
sudo apt-get update
3230
sudo apt-get install -y build-essential gcc g++
3331
```
34-
An effective way to achieve optimal performance on Arm is not only through optimal flag usage, but also by using the most recent compiler version. This Learning path was tested with GCC 13 which is the default version on `Ubuntu 24.04` but you can run it with newer versions of GCC as well.
32+
An effective way to achieve optimal performance on Arm is not only through optimal flag usage, but also by using the most recent compiler version. This Learning path was tested with GCC 13 which is the default version on `Ubuntu 24.04`, but you can run it with newer versions of GCC as well.
3533

3634
Create a directory for your implementations:
35+
3736
```bash
3837
mkdir -p sve2_match_demo
3938
cd sve2_match_demo
@@ -44,18 +43,18 @@ Your goal is to implement a function that searches for any occurrence of a set o
4443

4544
This type of search operation is common in many applications:
4645

47-
1. **Database Systems**: Checking if a value exists in a column
48-
2. **Text Processing**: Finding specific characters in a text
49-
3. **Network Packet Inspection**: Looking for specific byte patterns
50-
4. **Image Processing**: Finding specific pixel values
46+
* **Database systems**: checking if a value exists in a column
47+
* **Text processing**: finding specific characters in a text
48+
* **Network packet inspection**: looking for specific byte patterns
49+
* **Image processing**: finding specific pixel values
5150

5251
## Implementing search algorithms
5352

5453
Let's implement three versions of our search function:
5554

5655
### 1. Generic scalar implementation
5756

58-
Create a generic implementation in C that checks each element individually against each key. Open a editor of your choice and copy the code shown into a file named `sve2_match_demo.c`:
57+
Create a generic implementation in C that checks each element individually against each key. Open an editor of your choice and copy the code shown into a file named `sve2_match_demo.c`:
5958

6059
```c
6160
#include <arm_sve.h>
@@ -145,7 +144,9 @@ The SVE MATCH implementation with the `search_sve2_match_u8()` and `search_sve2_
145144

146145
### 3. Optimized SVE2 MATCH implementation
147146

148-
In this next SVE2 implementation you will add loop unrolling and prefetching to further improve performance. Copy the code shown into the same source file:
147+
In this next SVE2 implementation you will add loop unrolling and prefetching to further improve performance.
148+
149+
Copy the code shown into the same source file:
149150

150151
```c
151152
int search_sve2_match_u8_unrolled(const uint8_t *hay, size_t n, const uint8_t *keys,
@@ -522,8 +523,8 @@ This pattern makes SVE2 MATCH particularly well-suited for applications where ma
522523

523524
The unrolled implementation consistently outperforms the basic SVE2 MATCH implementation:
524525

525-
1. **Low Hit Rates**: Up to 30% additional speedup
526-
2. **Higher Hit Rates**: 5-20% additional speedup
526+
* **Low Hit Rates**: Up to 30% additional speedup
527+
* **Higher Hit Rates**: 5-20% additional speedup
527528

528529
This demonstrates the value of combining algorithmic optimizations (loop unrolling, prefetching) with hardware-specific instructions for maximum performance.
529530

0 commit comments

Comments
 (0)