Skip to content

Add ASV benchmarks - #184

Open
vchamarthi wants to merge 2 commits into
IntelPython:masterfrom
vchamarthi:asv-benchmarks
Open

vchamarthi wants to merge 2 commits into
IntelPython:masterfrom
vchamarthi:asv-benchmarks

Conversation

@vchamarthi

Copy link
Copy Markdown
Contributor

Adds an ASV benchmark suite under benchmarks/, following the layout of the mkl_fft and mkl_umath suites so mkl_random can run in the same benchmark pipeline.

What it covers:

  • every continuous and discrete distribution, with parameters chosen to hit each oneMKL method branch (e.g. gamma shape > 1, 0.6-1, < 0.6; binomial and hypergeometric table vs. acceptance/rejection)
  • method= variants for gaussian, lognormal, multinormal_cholesky and poisson
  • all deterministic basic generators
  • randint for every dtype and each C fill path, plus array-valued bounds
  • shuffle, permutation, choice
  • multivariate distributions and array-valued distribution parameters
  • mkl_random.interfaces.numpy_random and numpy.random under patch_numpy_random()
  • peak memory of large fills and of repeated small calls

Other changes:

  • benchmark optional dependency group in pyproject.toml
  • .asv/ added to .gitignore
  • D102 ignored for benchmarks/, as for tests
  • CHANGELOG entry

Tested on a 2x Xeon 6980P with master built from source: asv check is clean, and a full run (81 benchmarks, 272 points) takes about 22 min with no failures. Two runs on identical code showed no difference above 1.2x (median ratio 0.999, worst 1.155x).

Full-range randint and bytes() are only benchmarked on generators that implement UniformBits32/64; on MCG31, MRG32K3A, R250 and WH they currently return uninitialized data.

vchamarthi and others added 2 commits September 28, 2026 09:53
Adds an asv suite under benchmarks/ following the mkl_fft and mkl_umath
layout, so mkl_random can run in the shared ASV benchmark pipeline.

Covers every distribution (with parameters chosen per oneMKL method
branch), method= variants, all deterministic engines, randint per dtype
and C path, shuffle/permutation/choice, multivariate and array-valued
parameters, the numpy_random interface and patched numpy.random, and
peak memory.

Also adds a benchmark extra, ignores .asv/, and exempts benchmarks from
D102 as for tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

1 participant