-
Notifications
You must be signed in to change notification settings - Fork 26
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
Problems with new distance method #15
Comments
@vsmaier thanks for reporting this, not sure how that slipped through. The fixes have been pushed. Note that I have added a warning when using Also, FYI, the |
Hi Charles, I am now getting the warning when using identical sets of vectors (I have > print( distance(gpu4tuple,gpu4tuple, method="sqEuclidean"))Source: gpuR So I think I am on the newest version. Maybe there is a way to include The issue with the [3,3] elements in the results is also gone it seems. So The sizing of the result however is still a little off. The size of the result seems to be determined by the first parameter of When using matrices representing 3 and 4 points the results is a 3x3 > print( distance(gpu3tuple,gpu4tuple, method="sqEuclidean"))Source: gpuR When using matrices representing 4 and 3 points the results is a 4x4 *> print( distance(gpu4tuple,gpu3tuple, method="sqEuclidean"))Source: gpuR I have not yet locked at the vclMatrix - that may have to way a little bit. I am also now running into frequent R crashes. While it may be my platform
I'm unfortunately have been mostly a Windows guy in the past. So I'm still On Wed, Feb 24, 2016 at 4:10 PM, Charles Determan notifications@github.com
|
@vsmaier Bah, that's what I get for recycling some existing code. I believe I now have it fully functional. I have added several more unit tests to be certain of different scenarios. I will leave this issue open until I get confirmation from you that the functions are behaving appropriately. Regarding versions, sorry if it wasn't clear. I keep my devtools::install_github('cdeterman/gpuR', ref = 'develop') Regarding the R crashes, is this happening within a single R session or after it restarts? Note that an R session restarts after a package is re-installed if it is loaded. If the former is true, then there is a bigger problem. If the latter, then it isn't a major problem. When an R session is restarted, either by package installation or by opening and closing Rstudio for example, the pointers of the |
I did some tests and the results do match what I was expecting. I have not encountered the same type of R crashes/terminating unexpectedly that I got with prior versions. I did encounter another issue. I am currently able to compute 600,000 x 10 distances. Using the vclMatrix I am getting absolutely stunning performance. Longer term I am looking to compute 10,000,000 to 20,000 distances. When breaking the problem into small subsets I found that after repeated calls to allocate sample sets like this gpublocks <- gpuR::vclMatrix( as.matrix( mblocks[sample(1:nrow(blocks), 600000,replace=FALSE),] )) and using them in computations, the machine seems to be slowing down to near unresponsiveness. I would describe this to be similar to swapping out memory. Yet from what I can tell there is still ample memory and little cpu load. From this I realized that I do not know how to free the memory space associated with a vclMatrix. I think my repeated calls are effectively causing a memory leak on the GPU. |
@vsmaier interesting, can you provide your |
blocks is available at https://dl.dropboxusercontent.com/u/1419660/BLOCKS.csv.zip |
When using 4 locations for both parameters I would again expect a symmetrical matrix as a result.
[1,] -305.0518 -3396.980 2010.261
[2,] -239.3692 -3421.902 1976.606
[3,] 742.4894 -2864.292 2630.251
[4,] 248.7933 -3382.905 2041.504
and calling
[1,] 0.00000 77.89696 1328.7159 0
[2,] 77.89696 0.00000 1304.6937 0
[3,] 1328.71592 1304.69372 NaN 0
[4,] 554.90411 493.99902 926.9942 0
There is some oddity with the last column.
NaN at [3,3] is also a little bit off. The results in the diagonal should have been 0.
Cross checking with
[1,] 0.000 6067.936 1.765486e+06 0
[2,] 6067.936 0.000 1.702226e+06 0
[3,] 1765486.005 1702225.705 -3.725290e-09 0
[4,] 307918.566 244035.032 8.593182e+05 0
I can some additional distance computations with sets of 3 and 4 locations. It showed a similar pattern of issues. Therd also seems to be a difference in the allocated size of the result distance between 3 and 4 locations shows different result size from 4 and 3. There seems some implicit ordering assumption.
[1,] 430.9922 820.3234 1384.9828 0
[2,] 479.5628 749.3972 1365.7792 0
[3,] 1133.9736 978.7315 104.8199 0
[4,] 694.6057 307.7565 1010.0145 0
[1,] 430.9922 479.5628 1133.9736
[2,] 820.3234 749.3972 978.7315
[3,] 1384.9828 1365.7792 104.8199
[1,] 0.000 1.000599e+03 1161.673
[2,] 1000.599 6.103516e-05 1076.708
[3,] 1161.673 1.076708e+03 NaN
[1,] 0 1.001199e+06 1.349484e+06
[2,] 1001199 3.725290e-09 1.159300e+06
[3,] 1349484 1.159300e+06 -3.725290e-09
Hope this helps.
The text was updated successfully, but these errors were encountered: