Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT, BENCH: would be good to be able to run benchmarks with raw asv + virtualenv reliably #20574

Open
tylerjereddy opened this issue Apr 24, 2024 · 1 comment
Labels
Benchmarks Running, verifying or documenting benchmarks for SciPy maintenance Items related to regular maintenance tasks

Comments

@tylerjereddy
Copy link
Contributor

Checkout latest main branch and use latest stable release of asv (0.6.3.). Switch to virtualenv config (because that's what I want to use, and it should work):

--- a/benchmarks/asv.conf.json
+++ b/benchmarks/asv.conf.json
@@ -57,8 +57,8 @@
     // If missing or the empty string, the tool will be automatically
     // determined by looking for tools on the PATH environment
     // variable.
-    // "environment_type": "virtualenv",
-    "environment_type": "mamba",
+    "environment_type": "virtualenv",
+    // "environment_type": "mamba",
     "build_cache_size": 10,
 

Run the benchmarks to assess performance delta in a PR:

asv continuous -e -b "SingleDist.*" main enh_20561

Fail with No module named build

Couldn't load asv.plugins._mamba_helpers because
No module named 'libmambapy'
· Creating environments
· Discovering benchmarks
·· Uninstalling from virtualenv-py3.11-Cython-meson-python-numpy-pybind11-pytest-pythran
·· Building 91770f5c <enh_20561> for virtualenv-py3.11-Cython-meson-python-numpy-pybind11-pytest-pythran
·· Error running /home/treddy/github_projects/scipy/benchmarks/env/707a4b5825152af35803cd1f32741469/bin/python -m build (exit status 1)
   STDOUT -------->
   
   STDERR -------->
   /home/treddy/github_projects/scipy/benchmarks/env/707a4b5825152af35803cd1f32741469/bin/python: No module named build

·· Failed: trying different commit/environment
·· Uninstalling from virtualenv-py3.11-Cython-meson-python-numpy-pybind11-pytest-pythran
·· Building 8acedb1b <main> for virtualenv-py3.11-Cython-meson-python-numpy-pybind11-pytest-pythran
·· Error running /home/treddy/github_projects/scipy/benchmarks/env/707a4b5825152af35803cd1f32741469/bin/python -m build (exit status 1)
   STDOUT -------->
   
   STDERR -------->
   /home/treddy/github_projects/scipy/benchmarks/env/707a4b5825152af35803cd1f32741469/bin/python: No module named build

·· Failed to build the project and import the benchmark suite.

I'm not keen on using conda/mamba for this if I can stick with what I'm used to. I can circumvent that problem by fixing what looks like out of date entry in the dep matrix:

--- a/benchmarks/asv.conf.json
+++ b/benchmarks/asv.conf.json
@@ -41,7 +41,7 @@
         "pytest": [],
         "pythran": [],
         "pybind11": [],
-        "meson-python": [],
+        "meson": [],
     },

but it still fails, presumably for another reason that needs investigation:

Couldn't load asv.plugins._mamba_helpers because
No module named 'libmambapy'
· Creating environments.....
· Discovering benchmarks.......
·· Uninstalling from virtualenv-py3.11-Cython-meson-numpy-pybind11-pytest-pythran
·· Building 91770f5c <enh_20561> for virtualenv-py3.11-Cython-meson-numpy-pybind11-pytest-pythran.............................................
·· Installing 91770f5c <enh_20561> into virtualenv-py3.11-Cython-meson-numpy-pybind11-pytest-pythran
·· Failed: trying different commit/environment
@tylerjereddy tylerjereddy added maintenance Items related to regular maintenance tasks Benchmarks Running, verifying or documenting benchmarks for SciPy labels Apr 24, 2024
@tylerjereddy
Copy link
Contributor Author

@HaoZeke this is the diff I currently need to run with virtualenv instead of mamba for environment_type. This is similar to reports from airspeed-velocity/asv#1389. Should I try to make a change like this in SciPy config, or is there something cleaner I could do?

diff --git a/benchmarks/asv.conf.json b/benchmarks/asv.conf.json
index 0247b4581..0dc8515c7 100644
--- a/benchmarks/asv.conf.json
+++ b/benchmarks/asv.conf.json
@@ -20,9 +20,9 @@
     //
     // "install_command": ["in-dir={env_dir} python -mpip install {wheel_file}"],
     // "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
-    // "build_command": [
-    //     "PIP_NO_BUILD_ISOLATION=false python -m pip install . --no-deps --no-index -w {build_cache_dir} {build_dir}"
-    // ],
+    "build_command": [
+        "PIP_NO_BUILD_ISOLATION=false python -m pip wheel . --no-deps --no-index -w {build_cache_dir} {build_dir}"
+    ],
 
     // The base URL to "how a commit for the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Benchmarks Running, verifying or documenting benchmarks for SciPy maintenance Items related to regular maintenance tasks
Projects
None yet
Development

No branches or pull requests

2 participants
@tylerjereddy and others