Skip to content

Commit 5bd7881

Browse files
authored
Merge pull request #25 from itzmeanjan/16-add-avx512-support-for-fast-vector-multiplication-by-single-scalar-over-gf28
Resolves "Add AVX512 support for Fast Vector Multiplication by Single Scalar over GF(2^8)"
2 parents 1443d6f + 1e9216d commit 5bd7881

26 files changed

+3636
-111
lines changed

.github/workflows/test_ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
windows-11-arm, # arm64
2929
]
3030
rust: [
31-
1.85.0, # MSRV of this project
31+
1.89.0, # MSRV of this project
3232
stable
3333
]
3434
max-parallel: 4
@@ -46,7 +46,7 @@ jobs:
4646
run: make example
4747

4848
- name: Add WebAssembly compilation target
49-
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable' # Because MSRV of wasmtime-cli is 1.86.0
49+
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
5050
run: |
5151
rustup target add wasm32-wasip1
5252
rustup target add wasm32-wasip2

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22
name = "rlnc"
3-
version = "0.8.3"
3+
version = "0.8.4"
44
edition = "2024"
55
resolver = "3"
6-
rust-version = "1.85.0"
6+
rust-version = "1.89.0"
77
authors = ["Anjan Roy <hello@itzmeanjan.in>"]
88
description = "Random Linear Network Coding"
99
readme = "README.md"

README.md

Lines changed: 2162 additions & 24 deletions
Large diffs are not rendered by default.

plots/README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# How to generate plots from `divan` benchmark results ?
2+
3+
>[!NOTE]
4+
> `divan` is benchmark harness we use in `rlnc` library crate. More about `divan` @ <https://docs.rs/divan/latest/divan>. These scripts for visualizing benchmark results are both `rlnc` and `divan` specific. They are not generic. Originally I used Google Gemini 2.5 Pro to generate these scripts.
5+
6+
1. First create a virtual environment using `venv`.
7+
8+
```bash
9+
python -m venv .venv
10+
source .venv/bin/activate # When done with plot generation, run `deactivate`
11+
```
12+
13+
2. Install all the dependencies inside the virtual environment.
14+
15+
```bash
16+
pip install -r plots/scripts/requirements.txt
17+
```
18+
19+
3. Apply git patch [visualize-plot-bench-result.patch](./visualize-plot-bench-result.patch) to extend benchmark input parameter set of RLNC encoder, recoder and decoder. This patch also disables custom memory allocator which can track memory allocation when benchmarking encoding, recoding or decoding. But for plotting purposes, we are only interested in throughput for various input configurations, so we can safely disable everything else.
20+
21+
```bash
22+
# This patch was generated on git tag v0.8.4 of this crate
23+
# If the benchmark files are not touched after that, this patch should work.
24+
git apply plots/scripts/visualize-plot-bench-result.patch
25+
```
26+
27+
4. Run benchmark program and collect console output.
28+
29+
```bash
30+
RUSTFLAGS="-C target-cpu=native" cargo bench --profile optimized --bench full_rlnc_encoder
31+
RUSTFLAGS="-C target-cpu=native" cargo bench --profile optimized --bench full_rlnc_recoder
32+
RUSTFLAGS="-C target-cpu=native" cargo bench --profile optimized --bench full_rlnc_decoder
33+
```
34+
35+
5. Copy console output of benchmark run; open corresponding Python script, say [encoder](./scripts/plot_encoder_bench_result.py), which plots RLNC Encoder benchmark results; update `benchmark_data` string with the result you copied and you want to visualize.
36+
37+
6. Save the updated script and run the script to get resulting plot.
38+
39+
```bash
40+
python plots/scripts/plot_encoder_bench_result.py
41+
# or, provide desired output filename
42+
python plots/scripts/plot_encoder_bench_result.py rlnc_encoder.png
43+
```
44+
45+
7. Do same for RLNC Recoder or Decoder.
46+
47+
All scripts are inside [scripts](./scripts) directory.
48+
49+
---
50+
51+
## Performance Benchmarking on x86_64 with AVX2
52+
53+
![rlnc-encoder-on-x86_64-with-avx2](./rlnc-encoder-on-x86_64_with-avx2.png)
54+
55+
![rlnc-recoder-on-x86_64-with-avx2](./rlnc-recoder-on-x86_64_with-avx2.png)
56+
57+
![rlnc-decoder-on-x86_64-with-avx2](./rlnc-decoder-on-x86_64_with-avx2.png)
58+
59+
## Performance Benchmarking on Intel x86_64 with AV512
60+
61+
![rlnc-encoder-on-x86_64-with-intel-avx512](./rlnc-encoder-on-x86_64_with-intel-avx512.png)
62+
63+
![rlnc-recoder-on-x86_64-with-intel-avx512](./rlnc-recoder-on-x86_64_with-intel-avx512.png)
64+
65+
![rlnc-decoder-on-x86_64-with-intel-avx512](./rlnc-decoder-on-x86_64_with-intel-avx512.png)
66+
67+
## Performance Benchmarking on AMD x86_64 with AV512
68+
69+
![rlnc-encoder-on-x86_64-with-amd-avx512](./rlnc-encoder-on-x86_64_with-amd-avx512.png)
70+
71+
![rlnc-recoder-on-x86_64-with-amd-avx512](./rlnc-recoder-on-x86_64_with-amd-avx512.png)
72+
73+
![rlnc-decoder-on-x86_64-with-amd-avx512](./rlnc-decoder-on-x86_64_with-amd-avx512.png)
398 KB
Loading
397 KB
Loading
383 KB
Loading
394 KB
Loading
375 KB
Loading

0 commit comments

Comments
 (0)