Skip to content

ASV Benchmarks Integration#209

Open
vchamarthi wants to merge 9 commits into
IntelPython:mainfrom
vchamarthi:asv-benchmarks
Open

ASV Benchmarks Integration#209
vchamarthi wants to merge 9 commits into
IntelPython:mainfrom
vchamarthi:asv-benchmarks

Conversation

@vchamarthi
Copy link
Copy Markdown

Adds an ASV benchmark suite to track mkl_umath performance over time.

Benchmarks

micro/ - Single-ufunc timing benchmarks across
dtype - {float32, float64} × size - {10K, 100K, 1M}.
Arrays are pre-allocated in setup() and reused across timing calls.

File Ufuncs
bench_trig.py sin, cos, tan, arcsin, arccos, arctan, arctan2, sinh, cosh, tanh
bench_exp_log.py exp, exp2, expm1, log, log2, log10, log1p
bench_sqrt_misc.py sqrt, cbrt, square, fabs, absolute, reciprocal

npbench/ - 14 application-level workloads adapted from the npbench benchmark suite
(kernels inlined, no external dependency). Each runs at preset - {M, L}. All use
setup_cache() so expensive array initialization runs once per commit, not once per
timing repeat.

Patch script

_patch_setup.py - Runs once per ASV worker process at package import. Applies
mkl_fft, mkl_random, and mkl_umath patches via their public APIs and hard-fails
with a descriptive RuntimeError if any patch does not take effect. Benchmarks can
never silently fall back to stock NumPy.

Comment thread benchmarks/benchmarks/npbench/bench_cholesky2.py Outdated
Comment thread benchmarks/benchmarks/micro/bench_exp_log.py Outdated
Comment thread benchmarks/benchmarks/_patch_setup.py Outdated
Comment thread benchmarks/benchmarks/_patch_setup.py Outdated
Comment thread benchmarks/benchmarks/npbench/bench_k3mm.py Outdated
Comment thread benchmarks/benchmarks/npbench/bench_k2mm.py Outdated
Comment thread benchmarks/benchmarks/npbench/bench_gesummv.py Outdated
Comment thread benchmarks/benchmarks/npbench/bench_gemver.py Outdated
Comment thread benchmarks/benchmarks/npbench/bench_gemm.py Outdated
Comment thread benchmarks/benchmarks/npbench/bench_doitgen.py Outdated
Comment thread benchmarks/benchmarks/npbench/bench_correlation.py Outdated
Comment thread benchmarks/benchmarks/npbench/bench_covariance.py Outdated
Comment thread benchmarks/benchmarks/npbench/bench_deriche.py Outdated
Comment thread benchmarks/benchmarks/micro/bench_micro.py
Comment thread benchmarks/benchmarks/__init__.py Outdated
@ndgrigorian
Copy link
Copy Markdown
Collaborator

@vchamarthi
should we also add the utility for getting CPU cores (and possibly use psutil) here as well?

Also, you will want to install pre-commit in your environment with pip install pre-commit and then go to the repo root and run pre-commit install and pre-commit run --all-files

@ndgrigorian
Copy link
Copy Markdown
Collaborator

@vchamarthi
and, should we also add a README, like in mkl_fft?

Comment thread benchmarks/README.md Outdated
ndgrigorian
ndgrigorian previously approved these changes May 20, 2026
Copy link
Copy Markdown
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aside from that nit lgtm

@vchamarthi
Copy link
Copy Markdown
Author

@ndgrigorian Please merge it when you can, I lack merge permissions, thanks for the review.

@ndgrigorian
Copy link
Copy Markdown
Collaborator

merge pending any input from @antonwolfy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants