-
Notifications
You must be signed in to change notification settings - Fork 24
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
Support for Long Vectors? #91
Comments
I'm able to run
|
I'm trying to do it for a file-backed big.matrix. If I try to as a non-filebacked, it just crashes my OS (running Ubuntu 18.10). |
Does it really crash the operating system or does it crash R? If the latter, is there an error message? |
I actually ended up clean installing Ubuntu 18.04 because I was having bugs with 18.10. After re-installing, I am able to use non-filebacked as.big.matrix. However, this doesn't solve my original problem of trying to use the filebacked as.big.matrix (which is what I really need). I still get the long-vector error, stemming from the SetMatrixElements sub-function. |
What is the dimensions of your data? |
My data are 50490x50490 of data type double. And correct, it works with non-filebacked, but does not work with filebacked. |
Please try:
|
I tried that and it worked, but I would also like to be able to perform the biganalytics and bigalgebra (cdeterman fork) functions, which also run into the problem of not supporting long vectors. How did you get around the long vector problem in bigstatsr? I'm wondering if your method can be easily ported to bigmemory (specifically the SetMatrixElements function, where the error is ultimately occurring; see code below for the error message)
|
I think the main difference is that I'm relying heavily on Rcpp to link R and C++. This keeps things really simple for me. |
@cdeterman @kaneplusplus Any chance you could look into using Rcpp for bigmemory to support long vectors? |
If I recall, the main limitation with |
@cdeterman I think that's correct. At one point we linked bigmemory to the 64-bit api for the MKL in |
Perhaps that can be the thought then. If we can setup some sort of configuration at compile time to somehow detect what the BLAS backend is we could have the C++ conditionally (e.g. using |
Just came across a similar but different bug as well. When subsetting by a vector (i.e., I have a vector of indices that I want to use to set a value or vector of values for in a big.matrix), the |
|
I tried initially to use the 2-column approach, but unfortunately the |
Hi, I am facing the same problem. I am getting the following error. Error in SetMatrixElements(x@address, as.double(j), as.double(i), as.double(value)) : Is there a resolution to this? Thanks |
Can you tell us which version of R you are using? |
R/4.0.2 Its on my universities' server |
Thanks for the extra information. Can you check the values your are sending to the assignment where this is happening? The error looks like it's coming from R, rather than bigmemory's C code. Can you call as.double on the values? My hunch is that an easy fix would be to break the assignment into a few smaller assignment but let's see if we can do a little better job tracking down the problem. |
Hi, Continuing on from other people in this post, we are also having some issues with the long vector issue when using as.big.matrix directly on data. Specifically, getting the same error as @prateeksasan1: Error in SetMatrixElements(x@address, as.double(j), as.double(i), as.double(value)) : Some background info:
Wondering if you had any insights on this? Thanks! |
+1 to the need to store big matrices in memory with more than 2**32 entries. Is this planned at any point? |
So, bigmemory supports more than 2**32 entries. It looks like |
Would you be able to build this workaround into |
|
I'm working with data outside the realm of 2^31-1 elements, so I'm having issues converting matrices to big.matrix format using as.big.matrix (due to the inability to pass long vectors to .C or .Fortran, I'm assuming, but I'm not savvy enough to find where this occurs in the source code). I've found a work-around in creating a big.matrix and then assigning data column-wise from my original matrix, but this seems inefficient. I was wondering if there is a way to allow for conversion of matrices >2^31-1 elements, maybe using the dotCall64 package as a dependency? I've used this package in editing R base functions that call .C and .Fortran and it seems to work well.
The text was updated successfully, but these errors were encountered: