Skip to content

Commit cc195d5

Browse files
authored
Chore: Even more stable benchmarks (#5506)
We care more about stability at this point than how long it takes. Signed-off-by: Connor Tsui <[email protected]>
1 parent e8bc68b commit cc195d5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

vortex/benches/pipeline.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ const VERIFICATION_SIZES: [usize; 2] = [
152152
16384, // 16K - medium size
153153
];
154154

155+
/// The number of samples (each will run 100 times).
156+
const SAMPLE_SIZE: u32 = 4096;
157+
155158
////////////////////////////////////////////////////////////////////////////////////////////////////
156159
// Main
157160
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -791,7 +794,7 @@ fn compare_outputs(function_name: &str, expected: &[f32], actual: &[f32], expect
791794
// Benchmarks
792795
////////////////////////////////////////////////////////////////////////////////////////////////////
793796

794-
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = 512)]
797+
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = SAMPLE_SIZE)]
795798
fn batch<const SIZE: usize>(bencher: Bencher) {
796799
let (input_data, mut buffers) = setup(SIZE);
797800

@@ -810,7 +813,7 @@ fn batch<const SIZE: usize>(bencher: Bencher) {
810813
});
811814
}
812815

813-
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = 512)]
816+
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = SAMPLE_SIZE)]
814817
fn pipeline<const SIZE: usize>(bencher: Bencher) {
815818
let (input_data, mut buffers) = setup(SIZE);
816819
bencher.bench_local(|| {
@@ -828,7 +831,7 @@ fn pipeline<const SIZE: usize>(bencher: Bencher) {
828831
});
829832
}
830833

831-
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = 512)]
834+
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = SAMPLE_SIZE)]
832835
fn pipeline_extra_copy<const SIZE: usize>(bencher: Bencher) {
833836
let (input_data, mut buffers) = setup(SIZE);
834837
bencher.bench_local(|| {
@@ -847,7 +850,7 @@ fn pipeline_extra_copy<const SIZE: usize>(bencher: Bencher) {
847850
});
848851
}
849852

850-
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = 512)]
853+
#[divan::bench(consts = BENCHMARK_SIZES, sample_size = SAMPLE_SIZE)]
851854
fn in_place_batch<const SIZE: usize>(bencher: Bencher) {
852855
let (input_data, mut buffers) = setup(SIZE);
853856
bencher.bench_local(|| {
@@ -863,7 +866,7 @@ fn in_place_batch<const SIZE: usize>(bencher: Bencher) {
863866
});
864867
}
865868

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

0 commit comments

Comments
 (0)