-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
Sparse: bugfix + improvements in [hv]cat + more tests #592
Conversation
What is the purpose of using full() in abstractarray.jl as you have done? |
Suppose you have a sparse matrix
The actual drawback in performance could come when the matrix (or vector) is sparse and |
Sorry, that should have been |
Maybe it is safer to add a |
I think it is reasonable to convert all sparse matrices to dense in the case of sparse-dense concatenation. Perhaps we can get this to work without touching the abstractarray hvcat definitions. How about having the following in sparse.jl, which just converts all its inputs to dense and then calls the dense hvcat?
-viral On 15-Mar-2012, at 6:39 PM, Carlo Baldassi wrote:
|
That's the first thing I tried indeed... |
Fair enough. For now, I think it is ok to just go with full(). We can do this kind of a thing whenever we have more array types. Can you just check that your full() fix does not in any way slow down the dense hvcat? I don't think it should since full() for dense arrays is essentially a no-op, but good to just be on the safe side. -viral On 15-Mar-2012, at 6:59 PM, Carlo Baldassi wrote:
|
I just did some tests and found no measurable difference. This is the code I used:
|
Sparse: bugfix + improvements in [hv]cat + more tests
I did some more tests with more samples and smaller matrices (to emphasize the function call overhead) and this time fixing the random seed, and again I don't see any measurable difference in performance (i.e. less than statistical fluctuations across many runs). |
I did the tests implementing |
I suggest let's just leave it the way it is for now. The current code is more readable, and we are not going to require all this flexibility any time soon. Let's focus our effort on adding more sparse matrix functionality. :-) -viral On 15-Mar-2012, at 10:33 PM, Carlo Baldassi wrote:
|
* Test on current release version * Add StableRNGs as a test dependency to ensure same test results across Julia versions. Increase n when testing weighted sampleing with replacement to avoid test failure on Julia >= 1.5 * Use Travis for Windows testing for simplicity * Try testing on 32 bit as well * Remove AppVeyor badge
…to 248d9f9 (#57005) Stdlib: SparseArrays URL: https://github.com/JuliaSparse/SparseArrays.jl.git Stdlib branch: release-1.10 Julia branch: backports-release-1.10 Old commit: 78035e1 New commit: 248d9f9 Julia version: 1.10.7 SparseArrays version: 1.10.0(Does not match) Bump invoked by: @dkarrasch Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaSparse/SparseArrays.jl@78035e1...248d9f9 ``` $ git log --oneline 78035e1..248d9f9 248d9f9 More adhereance to 1.10 error types (hopefully) (#592) ``` Co-authored-by: dkarrasch <[email protected]>
…to 248d9f9 (#57005) Stdlib: SparseArrays URL: https://github.com/JuliaSparse/SparseArrays.jl.git Stdlib branch: release-1.10 Julia branch: backports-release-1.10 Old commit: 78035e1 New commit: 248d9f9 Julia version: 1.10.7 SparseArrays version: 1.10.0(Does not match) Bump invoked by: @dkarrasch Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaSparse/SparseArrays.jl@78035e1...248d9f9 ``` $ git log --oneline 78035e1..248d9f9 248d9f9 More adhereance to 1.10 error types (hopefully) (#592) ``` Co-authored-by: dkarrasch <[email protected]>
I fixed the bug which was affecting the sparse ref (mentioned in #585). It turned out it was actually in sparse matrix multiplication (which is used by ref).
I also fixed the promotion in sparse [hv]cat functions and added more tests.