Skip to content

Commit f56db99

Browse files
authored
Chore: make pipeline benchmarks less susceptible to noise (#5502)
Signed-off-by: Connor Tsui <[email protected]>
1 parent 929c372 commit f56db99

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

vortex/benches/pipeline.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,13 @@ const T: usize = 32;
137137
const S: usize = N * W / T;
138138

139139
/// Benchmark sizes to test for performance benchmarks.
140-
const BENCHMARK_SIZES: [usize; 8] = [
140+
const BENCHMARK_SIZES: [usize; 6] = [
141141
1024, // 1K
142142
8192, // 8K
143143
16384, // 16K
144144
65536, // 64K
145-
73728, // 72K
146145
86016, // 84K
147146
100352, // 98K
148-
262144, // 256K
149147
];
150148

151149
/// Sizes to test for correctness verification.
@@ -793,7 +791,7 @@ fn compare_outputs(function_name: &str, expected: &[f32], actual: &[f32], expect
793791
// Benchmarks
794792
////////////////////////////////////////////////////////////////////////////////////////////////////
795793

796-
#[divan::bench(consts = BENCHMARK_SIZES)]
794+
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = 512)]
797795
fn batch<const SIZE: usize>(bencher: Bencher) {
798796
let (input_data, mut buffers) = setup(SIZE);
799797

@@ -812,7 +810,7 @@ fn batch<const SIZE: usize>(bencher: Bencher) {
812810
});
813811
}
814812

815-
#[divan::bench(consts = BENCHMARK_SIZES)]
813+
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = 512)]
816814
fn pipeline<const SIZE: usize>(bencher: Bencher) {
817815
let (input_data, mut buffers) = setup(SIZE);
818816
bencher.bench_local(|| {
@@ -830,7 +828,7 @@ fn pipeline<const SIZE: usize>(bencher: Bencher) {
830828
});
831829
}
832830

833-
#[divan::bench(consts = BENCHMARK_SIZES)]
831+
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = 512)]
834832
fn pipeline_extra_copy<const SIZE: usize>(bencher: Bencher) {
835833
let (input_data, mut buffers) = setup(SIZE);
836834
bencher.bench_local(|| {
@@ -849,7 +847,7 @@ fn pipeline_extra_copy<const SIZE: usize>(bencher: Bencher) {
849847
});
850848
}
851849

852-
#[divan::bench(consts = BENCHMARK_SIZES)]
850+
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = 512)]
853851
fn in_place_batch<const SIZE: usize>(bencher: Bencher) {
854852
let (input_data, mut buffers) = setup(SIZE);
855853
bencher.bench_local(|| {
@@ -865,7 +863,7 @@ fn in_place_batch<const SIZE: usize>(bencher: Bencher) {
865863
});
866864
}
867865

868-
#[divan::bench(consts = BENCHMARK_SIZES)]
866+
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = 512)]
869867
fn in_place_pipeline<const SIZE: usize>(bencher: Bencher) {
870868
let (input_data, mut buffers) = setup(SIZE);
871869
bencher.bench_local(|| {

0 commit comments

Comments
 (0)