Skip to content

lab-medvedeva/GADES-main

Repository files navigation

GADES - GPU-Assisted Distance Estimation Software

This repo provides code that calculates pairwise matrix distances for dense and sparse matrices.

Prerequisities

  • R 4.3.0+
  • CMake 3.10+
  • (Optional) CUDA 11+

Installation instructions

Docker image start CUDA

Please, install NVIDIA Container Toolkit first.

docker run --name gades --gpus all -it akhtyamovpavel/gades-gpu

Local installation

git clone https://github.com/lab-medvedeva/GADES-main.git
cd GADES-main
Rscript install.R

This command builds code of the library using CMake, checks GPU and install package using CPU+GPU or only CPU code.

(Optional) How to build source code as a library for imports

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make

mtrx.so file will be appeared in the root folder.

Usage

Dense mode

library(GADES)

mtx <- matrix(runif(100000), nrow=100)

dist.matrix <- mtrx_distance(mtx, batch_size = 5000, metric = 'kendall', type='gpu', sparse=F, write=T)

Sparse mode

library(GADES)
library(Matrix)

mtx <- rsparsematrix(nrow=100, ncol=1000, density=0.1)

dist.matrix <- mtrx_distance(mtx, batch_size = 5000, metric = 'kendall', type='cpu', sparse=T, write=T)

Sparse mode - GPU

library(GADES)
library(Matrix)
mtx <- rsparsematrix(nrow=100, ncol=1000, density=0.1)
dist.matrix <- mtrx_distance(mtx, batch_size = 5000, metric = 'kendall', type='gpu', sparse=T, write=T)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors