-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
ENH: add PROPACK wrapper for improved sparse SVD #14433
Conversation
Co-authored-by: Matt Haberland <mhaberla@calpoly.edu>
BENCH: sparse.linalg: svds: add benchmarks
TST: sparse.linalg: propack: add test against example provided with PROPACK
…pack; remove dead/unused code
ENH: handle conda compiler -fopenmp flags
Co-authored-by: Matt Haberland <mhaberla@calpoly.edu>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Matt for the updates! I am approving provided the reply from @mckib2 on the pyf
files (since we have some checked in, it should be fine though). Before I merge, could you merge master so we see the doc one last time? (seemingly we don't merge on CircleCI before building the doc)
(also do you prefer a squash or do you want to clean the branch? It's a lot of work so you might want to keep some commits. I would also be fine merging as is since it's large work. Let me know 😃)
@mckib2 is squash merge OK? Since PROPACK is in a submodule, we don't need a commit here for just adding PROPACK, right? |
Correct, no commit needed to separate out an "add PROPACK" step. A squash merge is preferable as I believe there are binaries hiding in the history from early development |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Nicholas for the precisions.
Just fixing the doc (and a slight inconsistency between some parameters default value. We use optional
in the rest so using it for k
as well) and I will merge.
@rgommers I thought this was resolved, so I guess it is an intermittent issue : / Update: no problem locally; every benchmark takes PROPACK less than a second on a 2013 MacBook Pro.
|
Hmm, not sure what's going on then. It's fairly consistently failing on CircleCI. There may be a build issue or something that causes it to hang on that config. |
This is definitely not the case on my machine. I think you meant that timing results are a second or less. That's too much, timing results as reported by asv should typically be in the 100us - 10 ms range. Just run |
This is a follow-up to scipygh-14433 Note that a LOBPCG benchmark is failing, that should be addressed separately.
Follow-up in gh-14708. |
Reference issue
Closes #857 (A Wrapper for PROPACK)
What does this implement/fix?
-fopenmp
is enabled (also see discussion in GCC 9.3 compilers should not include-fopenmp
or-std=c++17
by default conda-forge/ctng-compiler-activation-feedstock#42)scipy.sparse.linalg._svdp
to expose PROPACK Fortran functionalitypropack
as a solver option forscipy.sparse.linalg.svds
float32
,float64
,complex64
, andcomplex128
typesnumpy.array
, sparse matrices, and linear operator objectsscipy.sparse.linalg.svds
test suiteAdditional information
_svdp
fromsvds
-- that is, how the keywords passed tosvds
map to PROPACK arguments. We've had to make some decisions about that and how to do the input validationRandomState
s as this is an old function and the old solvers have always been usingRandomState
. The behavior ofsvds
should be the same before and after this PRKnown/discovered issues:
svds(solver='arpack')
crashes when setting initial random vector withwhich='SM'
shifts
whenirl_mode=True
. We chose a reasonable default value forshifts
that seems to avoid this issue.shifts
is not currently exposed as an option, so while it's worth noting this PROPACK issue somewhere, it shouldn't affect this PR.