Giter Club home page Giter Club logo

Comments (9)

hameerabbasi avatar hameerabbasi commented on May 27, 2024 1

We have our own matmul routines now, so this should be fairly easy, just moving imports to where they're needed, dropping the dependency and adding it to the test requirements.

from sparse.

mrocklin avatar mrocklin commented on May 27, 2024

In most applications that I care about tensordot is critical. I'm happy to depend on scipy separately though.

Of course, we could always make our own CSR :)

from sparse.

hameerabbasi avatar hameerabbasi commented on May 27, 2024

I'm not aware of how to do these things, so two questions come to mind:

  • CSR @ CSR, CSR@Dense, [svd|eig|solve](CSR) is usually BLAS accelerated. We can and should use those. I know those can be wrapped with Cython.
  • How do we support multiple separate BLAS libraries? Is it even possible/easy?

I have zero experience here.

from sparse.

mrocklin avatar mrocklin commented on May 27, 2024
  • BLAS generally doesn't have L3 operations for sparse matrices. I notice that scipy.sparse makes reference to Eigen, so perhaps they're linking to a sparse implementation there. In practice though I'm not sure how much advantage you'll get over linking to an optimized library rather than writing it yourself, at least for matvec/matmul. Solve/svd/eig could easily be more complex though and might warrant relying on some other code. I recommend looking at the scipy.sparse solution, and then hunting around on a search engine for appropriate libraries.
  • If you do want to touch BLAS libraries then I recommend just using the Python linked functions in scipy.linalg.blas to start. These tend to link to a particular BLAS implementation. There is decent documentation online helping people to identify and change their linked implementation if desired.

from sparse.

hameerabbasi avatar hameerabbasi commented on May 27, 2024

scipy.linalg.blas is great! It does exactly what I needed, without needing to link/compile BLAS myself!

from sparse.

shoyer avatar shoyer commented on May 27, 2024

SuiteSparse is generally considered to have state of the art implementations for sparse linear algebra, but it's GPL licensed so SciPy can't use it directly.

It looks like SciPy mostly uses SuperLU or ARPACK. For matmul, I agree with @mrocklin that you would probably do fine implementing it yourself with a fairly naive loop.

from sparse.

hameerabbasi avatar hameerabbasi commented on May 27, 2024

The eventual plan here was to get CSF into this library, and turn it into just a container, then start adding algorithms like this to SciPy instead. :-)

from sparse.

rgommers avatar rgommers commented on May 27, 2024

I notice that scipy.sparse makes reference to Eigen, so perhaps they're linking to a sparse implementation there.

Nope, that's not the case. No external library is used there. And Eigen isn't used anywhere in the numpy/scipy ecosystem as far as I'm aware.

scipy.linalg.blas is great! It does exactly what I needed, without needing to link/compile BLAS myself!

yep that's the way to go (or linalg.cython_blas / linalg.cython_lapack if needed). you definitely don't want to link directly to any BLAS

SuiteSparse is generally considered to have state of the art implementations for sparse linear algebra, but it's GPL licensed so SciPy can't use it directly.

scikit-umfpack does link to SuiteSparse, in case anyone needs that.

The eventual plan here was to get CSF into this library, and turn it into just a container, then start adding algorithms like this to SciPy instead. :-)

still +1 on that

from sparse.

jamestwebber avatar jamestwebber commented on May 27, 2024

This is a very old issue but I'll +1 it just for the signal boost. My use-case is that I'm trying to build a Docker image with minimal dependencies, and I was almost able to drop scipy (which is pretty big) but sparse pulled it back in.

from sparse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.