Skip to content

Commit

Permalink
complete softmax bench
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Jan 23, 2024
1 parent a7d5a1f commit 10de3e7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions linalg/benches/softmax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,28 @@ fn softmax_f32(c: &mut Criterion) {
group.bench_function("loop2/generic", |b| {
b.iter(|| tract_linalg::generic::softmax::SSoftMaxL2::red().run_with_params(input, 10.))
});
#[cfg(target_arch = "x86_64")]
group.bench_function("loop2/iasm", |b| {
b.iter(|| {
tract_linalg::x86_64_fma::softmax::x86_64_fma_softmax2_fastcompact_f32_32n::red()
.run_with_params(input, 10.)
.unwrap()
});
});
group.bench_function("loop3/naive", |b| b.iter(|| loop3_f32(input, 0.21)));
group.bench_function("loop3/generic", |b| {
b.iter(|| {
tract_linalg::generic::by_scalar::SMulByScalar4::ew().run_with_params(input, 0.21)
})
});
#[cfg(target_arch = "x86_64")]
group.bench_function("loop3/iasm", |b| {
b.iter(|| {
tract_linalg::x86_64_fma::by_scalar::x86_64_avx_f32_mul_by_scalar_32n::ew()
.run_with_params(input, 0.21)
.unwrap()
});
});
}

criterion_group!(benches, softmax_f32);
Expand Down

0 comments on commit 10de3e7

Please sign in to comment.