mpimd-csc / flexiblas

FlexiBLAS - A BLAS and LAPACK wrapper library with runtime exchangeable backends. This is only a mirror of https://gitlab.mpi-magdeburg.mpg.de/software/flexiblas-release
https://www.mpi-magdeburg.mpg.de/projects/flexiblas
GNU Lesser General Public License v3.0
36 stars 7 forks source link

Fedora38: `python3 -c 'import numpy'` aborts #38

Closed dschwoerer closed 7 months ago

dschwoerer commented 1 year ago

I am trying to use numpy in a fedora 38 container:

python3 -c 'import numpy'
flexiblas Failed to get the BLAS backend (OPENBLAS-SERIAL) from the configuration.
Aborted (core dumped)

I have installed openblas-serial - but the error persists: Package openblas-serial-0.3.21-4.fc38.x86_64 is already installed.

How can I debug and fix this?

grisuthedragon commented 1 year ago

Is flexiblas-openblas-serial installed?

Otherwise this could be packaging error on the fedora side.

@Enchufa2 can you have a short look on this?

dschwoerer commented 1 year ago

Ah, indeed, that is missing.

Maybe a Supplements: openblas-serial if flexiblas would help?

Also, would it be possible to add a more explicit error, like: flexiblas Failed to get the BLAS backend (OPENBLAS-SERIAL) from the configuration - please install flexiblas-openblas-serial would be great

grisuthedragon commented 1 year ago

Indeed, this type of error message would be nice, but the packaging, and thus the package names, are up to the package maintainers in the distributions and not provided from FlexiBLAS itself. I could think of something more general, like Please check your installation.

Enchufa2 commented 1 year ago

I have installed openblas-serial - but the error persists: Package openblas-serial-0.3.21-4.fc38.x86_64 is already installed.

FWIW, there's documentation about this:

To allow system-level selection of other BLAS/LAPACK implementations, more backends must be installed in the first place (e.g., flexiblas-atlas, flexiblas-blis-serial…​).

Maybe a Supplements: openblas-serial if flexiblas would help?

I can certainly try that.

Also, would it be possible to add a more explicit error, like: flexiblas Failed to get the BLAS backend (OPENBLAS-SERIAL) from the configuration - please install flexiblas-openblas-serial would be great

Indeed "failed to get the backend from the configuration" is a bit confusing to me. Maybe it would be better something like "backend not found, please install the proper flexiblas wrapper", or "flexiblas plugin"? Something to make it clear that the flexiblas wrapper (flexiblas-<some_library>) is required, not only the library (<some_library>) itself.

Enchufa2 commented 1 year ago

I've added the proper Supplements, so that:

Updates coming as soon as builds are ready.

dschwoerer commented 1 year ago

I have installed openblas-serial - but the error persists: Package openblas-serial-0.3.21-4.fc38.x86_64 is already installed.

FWIW, there's documentation about this:

To allow system-level selection of other BLAS/LAPACK implementations, more backends must be installed in the first place (e.g., flexiblas-atlas, flexiblas-blis-serial…​).

I do not want more backends - I just want something. If it would fall back gracely to netlib, I would be happy with that as well. I am just not sure it is in general a good idea to fall back silently?

Thanks @Enchufa2 and @grisuthedragon as always for being very helpful :+1:

Should I keep this open as a reminder for improving the error message to be clear that the flexiblas wrapper part is needed?

grisuthedragon commented 1 year ago

I leave it open such that I remind myself to adjust the error message a bit.

I am just not sure it is in general a good idea to fall back silently?

I tried this once with colleagues during the early development and I found out that such messages are often not recognized, for example if applications print too much information. For this reason, there is the "hard" abort.

Enchufa2 commented 1 year ago

I do not want more backends - I just want something. If it would fall back gracely to netlib, I would be happy with that as well. I am just not sure it is in general a good idea to fall back silently?

If you "just want something", that's fine, but note that by default everything just works with the system-wide default backend, so this scenario is covered.

The error above happened because you actually switched something in the configuration to use a different backend, but the backend wasn't installed. So as soon as there's intent from the user (i.e. changing the configuration), I also think that a hard abort (with a helpful error message) is the way to go.

Then the new Supplements will make it easier to install a new backend, because installing e.g. openblas-serial will pull flexiblas-openblas-serial automatically without the user having to know about that.

dschwoerer commented 1 year ago

I do not want more backends - I just want something. If it would fall back gracely to netlib, I would be happy with that as well. I am just not sure it is in general a good idea to fall back silently?

If you "just want something", that's fine, but note that by default everything just works with the system-wide default backend, so this scenario is covered.

The error above happened because you actually switched something in the configuration to use a different backend, but the backend wasn't installed. So as soon as there's intent from the user (i.e. changing the configuration), I also think that a hard abort (with a helpful error message) is the way to go.

Ah, my bad. I had a new container, but I had $HOME mounted. There I have selected the serial backend. So it was my fault, indeed. I thought a new container would be sufficient to get a clean environment.

Then the new Supplements will make it easier to install a new backend, because installing e.g. openblas-serial will pull flexiblas-openblas-serial automatically without the user having to know about that.

Indeed. Thanks for that :+1: