Skip to content

Commit

Permalink
renamed bench groups for a cleaner criterion report
Browse files Browse the repository at this point in the history
  • Loading branch information
imrn99 committed Nov 30, 2023
1 parent 9f9dd7f commit 3a3f285
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 33 deletions.
2 changes: 1 addition & 1 deletion benches/blas-speedup/axpy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
let y_init: Vec<f64> = (0..length).map(|_| range.sample(&mut rng)).collect();
let alpha: f64 = range.sample(&mut rng);

let mut group = c.benchmark_group("axpy");
let mut group = c.benchmark_group("speedup-axpy");
group.bench_with_input(
BenchmarkId::new("exec-serial", ""),
&(x_init.clone(), y_init.clone(), alpha),
Expand Down
2 changes: 1 addition & 1 deletion benches/blas-speedup/gemm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
let alpha: f64 = range.sample(&mut rng);
let beta: f64 = range.sample(&mut rng);

let mut group = c.benchmark_group("gemm");
let mut group = c.benchmark_group("speedup-gemm");
group.bench_with_input(
BenchmarkId::new("exec-serial", ""),
&(
Expand Down
2 changes: 1 addition & 1 deletion benches/blas-speedup/gemv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
let alpha: f64 = range.sample(&mut rng);
let beta: f64 = range.sample(&mut rng);

let mut group = c.benchmark_group("gemv");
let mut group = c.benchmark_group("speedup-gemv");
group.bench_with_input(
BenchmarkId::new("exec-serial", ""),
&(aa_init.clone(), x_init.clone(), y_init.clone(), alpha, beta),
Expand Down
2 changes: 1 addition & 1 deletion benches/hardcoded_gemm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
let alpha: f64 = range.sample(&mut rng);
let beta: f64 = range.sample(&mut rng);

let mut group = c.benchmark_group("hardcoded-gemm");
let mut group = c.benchmark_group("gemm-hardcoded");
group.bench_with_input(
BenchmarkId::new("serial", ""),
&(
Expand Down
2 changes: 1 addition & 1 deletion benches/layout/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
let alpha: f64 = range.sample(&mut rng);
let beta: f64 = range.sample(&mut rng);

let mut group = c.benchmark_group("gemm");
let mut group = c.benchmark_group("gemm-layouts");
group.bench_with_input(
BenchmarkId::new("worst-layout", ""),
&(
Expand Down
2 changes: 1 addition & 1 deletion benches/layout/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn f2(
}

pub fn criterion_benchmark(c: &mut Criterion) {
let mut group = c.benchmark_group("sized-gemm");
let mut group = c.benchmark_group("gemm-sizes");
for data_size in 5..11 {
let length = 2_usize.pow(data_size);
let seed: u64 = 9817498146784;
Expand Down
18 changes: 9 additions & 9 deletions benches/view_access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,40 +106,40 @@ pub fn criterion_benchmark(c: &mut Criterion) {
.map(|((i1, i2), i3)| (*i1, *i2, *i3))
.collect();

let mut group1 = c.benchmark_group("1D access");
let mut group1 = c.benchmark_group("access-overhead-1D");
group1.bench_with_input(
BenchmarkId::new("Vector Access", ""),
BenchmarkId::new("flat-vector", ""),
&(length, indices1.clone()),
|b, (n, i)| b.iter(|| f1(*n, i)),
);
group1.bench_with_input(
BenchmarkId::new("View Access", ""),
BenchmarkId::new("view", ""),
&(length, indices1),
|b, (n, i)| b.iter(|| f1_b(*n, i)),
);
group1.finish();

let mut group2 = c.benchmark_group("2D access");
let mut group2 = c.benchmark_group("access-overhead-2D");
group2.bench_with_input(
BenchmarkId::new("Vector Access", ""),
BenchmarkId::new("flat-vector", ""),
&(length, (indices2.clone())),
|b, (n, i)| b.iter(|| f2(*n, i)),
);
group2.bench_with_input(
BenchmarkId::new("View Access", ""),
BenchmarkId::new("view", ""),
&(length, (indices2)),
|b, (n, i)| b.iter(|| f2_b(*n, i)),
);
group2.finish();

let mut group3 = c.benchmark_group("3D access");
let mut group3 = c.benchmark_group("access-overhead-3D");
group3.bench_with_input(
BenchmarkId::new("Vector Access", ""),
BenchmarkId::new("flat-vector", ""),
&(length, indices3.clone()),
|b, (n, i)| b.iter(|| f3(*n, i)),
);
group3.bench_with_input(
BenchmarkId::new("View Access", ""),
BenchmarkId::new("view", ""),
&(length, indices3),
|b, (n, i)| b.iter(|| f3_b(*n, i)),
);
Expand Down
32 changes: 14 additions & 18 deletions benches/view_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,49 +88,45 @@ pub fn criterion_benchmark(c: &mut Criterion) {
// Generate/Define the input
let mut data_size: u32 = 11; // 2048 length vector, 2048*2048 matrix

let mut group1 = c.benchmark_group("1D view initialization");
let mut group1 = c.benchmark_group("init-overhead-1D");
group1.bench_with_input(BenchmarkId::new("vector-alloc", ""), &data_size, |b, &n| {
b.iter(|| f1(n))
});
group1.bench_with_input(
BenchmarkId::new("Standard Vector Allocation", ""),
&data_size,
|b, &n| b.iter(|| f1(n)),
);
group1.bench_with_input(
BenchmarkId::new("Allocation & Init", ""),
BenchmarkId::new("view-alloc-then-init", ""),
&data_size,
|b, &n| b.iter(|| f1_b(n)),
);
group1.bench_with_input(
BenchmarkId::new("Inline? Allocation & Init", ""),
BenchmarkId::new("view-inline-alloc-init", ""),
&data_size,
|b, &n| b.iter(|| f1_bb(n)),
);
group1.bench_with_input(
BenchmarkId::new("Default View Init", ""),
BenchmarkId::new("view-default-init", ""),
&data_size,
|b, &n| b.iter(|| f1_bbb(n)),
);
group1.finish();

data_size = 10;

let mut group2 = c.benchmark_group("2D view initialization");
group2.bench_with_input(
BenchmarkId::new("Standard Vector Allocation", ""),
&data_size,
|b, &n| b.iter(|| f2(n)),
);
let mut group2 = c.benchmark_group("init-overhead-2D");
group2.bench_with_input(BenchmarkId::new("vector-alloc", ""), &data_size, |b, &n| {
b.iter(|| f2(n))
});
group2.bench_with_input(
BenchmarkId::new("Allocation & Init", ""),
BenchmarkId::new("view-alloc-then-init", ""),
&data_size,
|b, &n| b.iter(|| f2_b(n)),
);
group2.bench_with_input(
BenchmarkId::new("Inline? Allocation & Init", ""),
BenchmarkId::new("view-inline-alloc-init", ""),
&data_size,
|b, &n| b.iter(|| f2_bb(n)),
);
group2.bench_with_input(
BenchmarkId::new("Default View Init", ""),
BenchmarkId::new("view-default-init", ""),
&data_size,
|b, &n| b.iter(|| f2_bbb(n)),
);
Expand Down

0 comments on commit 3a3f285

Please sign in to comment.