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

FIX snapML error #11

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7101b3d
CI run every wednesday instead of everyday
wassimmazouz Jul 2, 2024
07d07e4
try older numpy
wassimmazouz Jul 3, 2024
a3890e4
typo
wassimmazouz Jul 3, 2024
ad52e93
try specific numpy version
wassimmazouz Jul 3, 2024
c258167
unspecifying numpy version
wassimmazouz Jul 4, 2024
da13bcd
testing with added libomp install
wassimmazouz Jul 4, 2024
443d5d2
testing with extra exports
wassimmazouz Jul 4, 2024
f49311f
Merge branch 'main' into FIX-snapML-numpy-compat
wassimmazouz Jul 4, 2024
0b6d4f6
test
wassimmazouz Jul 4, 2024
471ed52
test with link
wassimmazouz Jul 4, 2024
22d92fb
fixing comment
wassimmazouz Jul 4, 2024
da4dd69
try llvm
wassimmazouz Jul 4, 2024
30542b9
create directory
wassimmazouz Jul 4, 2024
81060c4
sudo
wassimmazouz Jul 4, 2024
47df2ae
sudo 2
wassimmazouz Jul 4, 2024
82e70cf
ci trigger
wassimmazouz Jul 10, 2024
e9544ce
ci trigger
wassimmazouz Jul 10, 2024
0ea9a0f
ci trigger
wassimmazouz Jul 10, 2024
8ef307d
ci trigger
wassimmazouz Jul 10, 2024
aef59c6
ci trigger
wassimmazouz Jul 10, 2024
c7f3842
ci trigger
wassimmazouz Jul 10, 2024
606d470
back to created link
wassimmazouz Jul 11, 2024
97ef31c
separate tasks
wassimmazouz Jul 11, 2024
85d5c12
unlink
wassimmazouz Jul 11, 2024
c2ff09d
ci trigger
wassimmazouz Jul 11, 2024
fa299bf
proper version
wassimmazouz Jul 11, 2024
79b6758
remove if else
wassimmazouz Jul 11, 2024
75dc090
ci trigger
wassimmazouz Jul 11, 2024
cb24345
ci trigger
wassimmazouz Jul 11, 2024
b116218
from opt to usr
wassimmazouz Jul 11, 2024
7d57bff
already exists
wassimmazouz Jul 11, 2024
0168495
unlink
wassimmazouz Jul 11, 2024
f8535a7
only path
wassimmazouz Jul 11, 2024
5a56a2a
libomp and path
wassimmazouz Jul 11, 2024
3f95a84
libomp and homebrew
wassimmazouz Jul 11, 2024
c241413
install libomp directly
wassimmazouz Jul 17, 2024
0f2e8a4
all in one file
wassimmazouz Jul 17, 2024
7b65b26
unify str
wassimmazouz Jul 17, 2024
cb83036
lint
wassimmazouz Jul 17, 2024
a21301b
abort
wassimmazouz Jul 17, 2024
a8c4b7c
FIX snapML skip and tutorial
wassimmazouz Jul 18, 2024
84ae029
suggested changes
wassimmazouz Jul 18, 2024
9280d62
: to ::
wassimmazouz Jul 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion solvers/snapml.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ class Solver(BaseSolver):
name = "snapml"

install_cmd = "conda"
requirements = ["pip:snapml"]

# Snap ML wheels are built with numpy 1.*, they are not compatible with
# numpy>=2. TODO : upgrade numpy when compatible wheels are released.
wassimmazouz marked this conversation as resolved.
Show resolved Hide resolved

# libomp x86_64 and Homebrew are needed for snapML to work correctly on
# MacOS. Please check this tutorial to install SnapML correctly:
# https://github.com/benchopt/benchmark_ridge/blob/tutorials/snapml_macos.rst
requirements = ["numpy'<2'", "pip:snapml"]

parameters = {"gpu": [False, True]}
references = [
Expand Down
6 changes: 6 additions & 0 deletions test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ def check_test_solver_install(solver_class):

if "glmnet" in solver_class.name.lower():
pytest.xfail("glmnet produces discrepancies (see issue #2).")

wassimmazouz marked this conversation as resolved.
Show resolved Hide resolved
# libomp x86_64 and Homebrew are needed for snapML to work correctly on
# MacOS. Please check this tutorial to install SnapML correctly:
# https://github.com/benchopt/benchmark_ridge/blob/tutorials/snapml_macos.rst
if 'snapml' in solver_class.name.lower() and sys.platform == 'darwin':
pytest.xfail('snapML is not easy to install on MacOS.')
58 changes: 58 additions & 0 deletions tutorials/snapml_macos.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
============================
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't test it, so I assume it worked on a machine you used @wassimmazouz ?

@tomMoral wdyt, is this overkill ? if the same resource is accessible online maybe we can just link to it in the snapml solver ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mathurinm These were the minimal changes that helped pass the tests. However, I haven't tried this on any machine.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I would just add a link to the tutorial in the README.

Installing SnapML on macOS
============================

This tutorial provides step-by-step instructions to install SnapML on a macOS machine. The process includes setting up Homebrew and installing the necessary dependencies.

Steps to Install SnapML
========================

1. **Install and Setup Homebrew**

Homebrew is a package manager for macOS that simplifies the installation of software.

Open your terminal and run the following command to install Homebrew:

.. code-block:: bash

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After installing Homebrew, you need to add it to your shell environment:

.. code-block:: bash

echo 'eval "$(/usr/local/bin/brew shellenv)"' >> $HOME/.profile
eval "$(/usr/local/bin/brew shellenv)"

2. **Install libomp**

`libomp` is an OpenMP library required by SnapML. Install it using Homebrew:

.. code-block:: bash

arch -x86_64 /usr/local/bin/brew install libomp

Once installed, set up the environment variables needed for `libomp`:

.. code-block:: bash

echo 'export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"' >> $HOME/.profile
echo 'export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"' >> $HOME/.profile
echo 'export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/homebrew/opt/libomp/lib' >> $HOME/.profile

Apply the changes by running:

.. code-block:: bash

source $HOME/.profile

3. **Install SnapML**

With the dependencies installed, you can now proceed to install SnapML using pip:

.. code-block:: bash

pip install snapml


By following these steps, you should have SnapML installed and running correctly on your macOS machine.
Loading