Package: GPUmatrix 1.0.2

GPUmatrix: Basic Linear Algebra with GPU

GPUs are great resources for data analysis, especially in statistics and linear algebra. Unfortunately, very few packages connect R to the GPU, and none of them are transparent enough to run the computations on the GPU without substantial changes to the code. The maintenance of these packages is cumbersome: several of the earlier attempts have been removed from their respective repositories. It would be desirable to have a properly maintained R package that takes advantage of the GPU with minimal changes to the existing code. We have developed the GPUmatrix package (available on CRAN). GPUmatrix mimics the behavior of the Matrix package and extends R to use the GPU for computations. It includes single(FP32) and double(FP64) precision data types, and provides support for sparse matrices. It is easy to learn, and requires very few code changes to perform the operations on the GPU. GPUmatrix relies on either the Torch or Tensorflow R packages to perform the GPU operations. We have demonstrated its usefulness for several statistical applications and machine learning applications: non-negative matrix factorization, logistic regression and general linear models. We have also included a comparison of GPU and CPU performance on different matrix operations.

Authors:Cesar Lobato-Fernandez [aut, cre], Juan A.Ferrer-Bonsoms [aut], Angel Rubio [aut, ctb]

GPUmatrix_1.0.2.tar.gz
GPUmatrix_1.0.2.zip(r-4.5)GPUmatrix_1.0.2.zip(r-4.4)GPUmatrix_1.0.2.zip(r-4.3)
GPUmatrix_1.0.2.tgz(r-4.4-any)GPUmatrix_1.0.2.tgz(r-4.3-any)
GPUmatrix_1.0.2.tar.gz(r-4.5-noble)GPUmatrix_1.0.2.tar.gz(r-4.4-noble)
GPUmatrix_1.0.2.tgz(r-4.4-emscripten)GPUmatrix_1.0.2.tgz(r-4.3-emscripten)
GPUmatrix.pdf |GPUmatrix.html
GPUmatrix/json (API)

# Install 'GPUmatrix' in R:
install.packages('GPUmatrix', repos = c('https://clobatofern95.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

On CRAN:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

71 exports 0.36 score 0 dependencies 52 scripts 284 downloads

Last updated 7 months agofrom:99aa24df83. Checks:OK: 1 NOTE: 6. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 15 2024
R-4.5-winNOTESep 15 2024
R-4.5-linuxNOTESep 15 2024
R-4.4-winNOTESep 15 2024
R-4.4-macNOTESep 15 2024
R-4.3-winNOTESep 15 2024
R-4.3-macNOTESep 15 2024

Exports:%^%%x%applyas.arrayas.gpu.matrixas.listas.matrixcbind2cholchol_solvecolMaxscolMeanscolMinscolnamescolRankscolSumscolVarscorcovcov2cordensitydetdeterminantdiagdiag<-distdtypedtype<-eigenexpmGPUfftginvglm.fit.GPUgpu.matrixGPUglmheadhistinstallTorchLR_GradientConjugate_gpumatrixmeanmvfftncolNMFgpumatrixnrowprintqrqr.coefqr.Qqr.qtyqr.qyqr.Rqr.residqr.solveqr.Xrbind2rowMaxsrowMeansrowMinsrownamesrowRanksrowSumsrowVarssolvesortsvdttailto_denseto_sparsewhich.maxwhich.min

Dependencies:

Get started with GPUmatrix package

Rendered fromVignette.Rmdusingknitr::rmarkdownon Sep 15 2024.

Last update: 2024-03-02
Started: 2024-03-02

Readme and manuals

Help Manual

Help pageTopics
Array Transpositiont t,gpu.matrix.tensorflow-method t,gpu.matrix.torch-method t-methods
Apply Functions over 'gpu.matrix-class' marginsapply apply,gpu.matrix.tensorflow-method apply,gpu.matrix.torch-method apply-methods
as_methodsas.array as.array,gpu.matrix.tensorflow-method as.array,gpu.matrix.torch-method as.array-methods as.list as.list,gpu.matrix.tensorflow-method as.list,gpu.matrix.torch-method as.list-methods as.matrix as.matrix,gpu.matrix.tensorflow-method as.matrix,gpu.matrix.torch-method as.matrix-methods as.numeric as.numeric,gpu.matrix.tensorflow-method as.numeric,gpu.matrix.torch-method as.numeric-methods as.vector as.vector,gpu.matrix.tensorflow-method as.vector,gpu.matrix.torch-method as.vector-methods is.numeric is.numeric,gpu.matrix.tensorflow-method is.numeric,gpu.matrix.torch-method is.numeric-methods
cbind_rbind_methodscbind2 cbind2,ANY,gpu.matrix.tensorflow-method cbind2,ANY,gpu.matrix.torch-method cbind2,gpu.matrix.tensorflow,ANY-method cbind2,gpu.matrix.torch,ANY-method cbind2-methods rbind2 rbind2,ANY,gpu.matrix.tensorflow-method rbind2,ANY,gpu.matrix.torch-method rbind2,gpu.matrix.tensorflow,ANY-method rbind2,gpu.matrix.torch,ANY-method rbind2-methods
concatenate_gpu.matrixc,gpu.matrix.tensorflow-method c,gpu.matrix.torch-method c,numMatrixLike-method c-methods
Correlation, Variance and Covariance for 'GPUmatrix' objectscor cor,ANY,gpu.matrix.tensorflow,ANY,ANY-method cor,ANY,gpu.matrix.torch,ANY,ANY-method cor,gpu.matrix.tensorflow,ANY,ANY,ANY-method cor,gpu.matrix.tensorflow,ANY,missing,character-method cor,gpu.matrix.tensorflow,missing,ANY,ANY-method cor,gpu.matrix.tensorflow,missing,missing,character-method cor,gpu.matrix.torch,ANY,ANY,ANY-method cor,gpu.matrix.torch,ANY,missing,character-method cor,gpu.matrix.torch,missing,ANY,ANY-method cor,gpu.matrix.torch,missing,missing,character-method cor,gpu.matrix.torch,missing,missing,missing-method cor-methods cov cov,ANY,gpu.matrix.tensorflow-method cov,ANY,gpu.matrix.torch-method cov,gpu.matrix.tensorflow,ANY-method cov,gpu.matrix.tensorflow,missing-method cov,gpu.matrix.tensorflow-method cov,gpu.matrix.torch,ANY-method cov,gpu.matrix.torch,missing-method cov,gpu.matrix.torch-method cov-methods cov2cor cov2cor,gpu.matrix.tensorflow-method cov2cor,gpu.matrix.torch-method cov2cor-methods
Kernel Density Estimation and Histogramsdensity density,gpu.matrix.tensorflow-method density,gpu.matrix.torch-method density-methods hist hist,gpu.matrix.tensorflow-method hist,gpu.matrix.torch-method hist-methods
Calculate the Determinant of a 'GPUMatrix'det det,gpu.matrix.tensorflow-method det,gpu.matrix.torch-method det-methods determinant determinant,gpu.matrix.tensorflow,logical-method determinant,gpu.matrix.tensorflow,missing-method determinant,gpu.matrix.torch,logical-method determinant,gpu.matrix.torch,missing-method determinant-methods
diagdiag diag,gpu.matrix.tensorflow-method diag,gpu.matrix.torch-method diag-methods diag<- diag<-,gpu.matrix.tensorflow,numeric-method diag<-,gpu.matrix.torch,numeric-method diag<--methods
Number of rows and columns and its corresponding namescolnames colnames,gpu.matrix.tensorflow-method colnames,gpu.matrix.torch-method colnames-methods dim dim,gpu.matrix.tensorflow-method dim,gpu.matrix.torch-method dim-methods dim<- dim<-,gpu.matrix.tensorflow,vector-method dim<-,gpu.matrix.torch,vector-method dim<--methods dimnames dimnames,gpu.matrix.tensorflow-method dimnames,gpu.matrix.torch-method dimnames-methods dimnames<- dimnames<-,gpu.matrix.tensorflow,vector-method dimnames<-,gpu.matrix.torch,vector-method dimnames<--methods length length,gpu.matrix.tensorflow-method length,gpu.matrix.torch-method length-methods ncol ncol,gpu.matrix.tensorflow-method ncol,gpu.matrix.torch-method ncol-methods nrow nrow,gpu.matrix.tensorflow-method nrow,gpu.matrix.torch-method nrow-methods rownames rownames,gpu.matrix.tensorflow-method rownames,gpu.matrix.torch-method rownames-methods
Distance Matrix Computation with GPUdist dist,gpu.matrix.torch-method dist-methods
'GPUmatrix' ExponentialexpmGPU expmGPU,gpu.matrix.tensorflow-method expmGPU,gpu.matrix.torch-method expmGPU-methods
extract_gpu.matrix- -,gpu.matrix.tensorflow,missing-method -,gpu.matrix.torch,missing-method --methods [ [,gpu.matrix.tensorflow,index,index-method [,gpu.matrix.tensorflow,index,missing-method [,gpu.matrix.tensorflow,matrix,missing-method [,gpu.matrix.tensorflow,missing,index-method [,gpu.matrix.torch,index,index-method [,gpu.matrix.torch,index,missing-method [,gpu.matrix.torch,matrix,missing-method [,gpu.matrix.torch,missing,index-method [-methods [<- [<-,gpu.matrix.tensorflow,index,index-method [<-,gpu.matrix.tensorflow,index,missing-method [<-,gpu.matrix.tensorflow,matrix,missing-method [<-,gpu.matrix.tensorflow,missing,index-method [<-,gpu.matrix.torch,index,index-method [<-,gpu.matrix.torch,index,missing-method [<-,gpu.matrix.torch,matrix,missing-method [<-,gpu.matrix.torch,missing,index-method [<--methods [[ [[,gpu.matrix.tensorflow,index-method [[,gpu.matrix.torch,index-method [[-methods [[<- [[<-,gpu.matrix.tensorflow,index-method [[<-,gpu.matrix.torch,index-method [[<--methods
Fast Discrete Fourier Transform (FFT)fft fft,gpu.matrix.tensorflow,missing-method fft,gpu.matrix.tensorflow-method fft,gpu.matrix.torch,logical-method fft,gpu.matrix.torch,missing-method fft,gpu.matrix.torch-method fft-methods mvfft mvfft,gpu.matrix.tensorflow,missing-method mvfft,gpu.matrix.tensorflow-method mvfft,gpu.matrix.torch,logical-method mvfft,gpu.matrix.torch,missing-method mvfft,gpu.matrix.torch-method mvfft-methods
create and store a matrix in the GPUas.gpu.matrix as.gpu.matrix,ANY-method as.gpu.matrix-methods gpu.matrix
Class 'gpu.matrix' for matrix stored in GPUgpu.matrix-class
Fitting Generalized Linear Models using GPUmatrix objectsglm.fit.GPU GPUglm
installTorchinstallTorch
kroneker Products%x% %x%,ANY,gpu.matrix.tensorflow-method %x%,ANY,gpu.matrix.torch-method %x%,gpu.matrix.tensorflow,ANY-method %x%,gpu.matrix.torch,ANY-method %x%-methods
Logistic Regression with Conjugate Gradient methodLR_GradientConjugate_gpumatrix
Decomposition of a matrix with GPUchol chol,gpu.matrix.tensorflow-method chol,gpu.matrix.torch-method chol-methods eigen eigen,gpu.matrix.tensorflow-method eigen,gpu.matrix.torch-method eigen-methods svd svd,gpu.matrix.tensorflow-method svd,gpu.matrix.torch-method svd-methods
Return the first or last part of a GPUmatrix objecthead head,gpu.matrix.tensorflow-method head,gpu.matrix.torch-method head-methods print print,gpu.matrix.torch-method print-methods show show,gpu.matrix.tensorflow-method show,gpu.matrix.torch-method show-methods tail tail,gpu.matrix.tensorflow-method tail,gpu.matrix.torch-method tail-methods
Get different statistics for a gpu.matrix-class.colMaxs colMaxs,gpu.matrix.tensorflow-method colMaxs,gpu.matrix.torch-method colMaxs-methods colMeans colMeans,gpu.matrix.tensorflow-method colMeans,gpu.matrix.torch-method colMeans-methods colMins colMins,gpu.matrix.tensorflow-method colMins,gpu.matrix.torch-method colMins-methods colRanks colRanks,gpu.matrix.tensorflow-method colRanks,gpu.matrix.torch-method colRanks-methods colSums colSums,gpu.matrix.tensorflow-method colSums,gpu.matrix.torch-method colSums-methods colVars colVars,gpu.matrix.tensorflow-method colVars,gpu.matrix.torch-method colVars-methods max,gpu.matrix.tensorflow-method max,gpu.matrix.torch-method max-methods mean mean,gpu.matrix.tensorflow-method mean,gpu.matrix.torch-method mean-methods min min,gpu.matrix.tensorflow-method min,gpu.matrix.torch-method min-methods rowMaxs rowMaxs,gpu.matrix.tensorflow-method rowMaxs,gpu.matrix.torch-method rowMaxs-methods rowMeans rowMeans,gpu.matrix.tensorflow-method rowMeans,gpu.matrix.torch-method rowMeans-methods rowMins rowMins,gpu.matrix.tensorflow-method rowMins,gpu.matrix.torch-method rowMins-methods rowRanks rowRanks,gpu.matrix.tensorflow-method rowRanks,gpu.matrix.torch-method rowRanks-methods rowSums rowSums,gpu.matrix.tensorflow-method rowSums,gpu.matrix.torch-method rowSums-methods rowVars rowVars,gpu.matrix.tensorflow-method rowVars,gpu.matrix.torch-method rowVars-methods sum sum,gpu.matrix.tensorflow-method sum,gpu.matrix.torch-method sum-methods which.max,gpu.matrix.tensorflow-method which.max,gpu.matrix.torch-method which.max-methods which.min which.min,gpu.matrix.tensorflow-method which.min,gpu.matrix.torch-method which.min-methods
Matrix Products%*% %*%,ANY,gpu.matrix.tensorflow-method %*%,ANY,gpu.matrix.torch-method %*%,gpu.matrix.tensorflow,ANY-method %*%,gpu.matrix.torch,ANY-method %*%-methods crossprod crossprod,ANY,gpu.matrix.tensorflow-method crossprod,ANY,gpu.matrix.torch-method crossprod,gpu.matrix.tensorflow,ANY-method crossprod,gpu.matrix.tensorflow,missing-method crossprod,gpu.matrix.torch,ANY-method crossprod,gpu.matrix.torch,missing-method crossprod-methods tcrossprod tcrossprod,ANY,gpu.matrix.tensorflow-method tcrossprod,ANY,gpu.matrix.torch-method tcrossprod,gpu.matrix.tensorflow,ANY-method tcrossprod,gpu.matrix.tensorflow,missing-method tcrossprod,gpu.matrix.torch,ANY-method tcrossprod,gpu.matrix.torch,missing-method tcrossprod-methods
Non negative factorization of a matrixNMFgpumatrix
Compute the kth power of a matrix.%^% %^%,gpu.matrix.tensorflow,numeric-method %^%,gpu.matrix.torch,numeric-method
The QR Decomposition of a GPUmatrix objectqr qr,gpu.matrix.tensorflow-method qr,gpu.matrix.torch-method qr-methods qr.coef qr.coef,list-method qr.coef-methods qr.Q qr.Q,list-method qr.Q-methods qr.qty qr.qty,list-method qr.qty-methods qr.qy qr.qy,list-method qr.qy-methods qr.R qr.R,list-method qr.R-methods qr.resid qr.resid,list-method qr.resid-methods qr.solve qr.solve,ANY,gpu.matrix.tensorflow-method qr.solve,ANY,gpu.matrix.torch-method qr.solve,gpu.matrix.tensorflow,ANY-method qr.solve,gpu.matrix.tensorflow,gpu.matrix.tensorflow-method qr.solve,gpu.matrix.torch,ANY-method qr.solve,gpu.matrix.torch,gpu.matrix.torch-method qr.solve,list,ANY-method qr.solve-methods qr.X qr.X,list-method qr.X-methods
rounding of numersround round,gpu.matrix.tensorflow,ANY-method round,gpu.matrix.tensorflow,missing-method round,gpu.matrix.tensorflow,numeric-method round,gpu.matrix.torch,missing-method round,gpu.matrix.torch,numeric-method round-methods
Solve a System of Equationschol_solve chol_solve,ANY,gpu.matrix.tensorflow-method chol_solve,ANY,gpu.matrix.torch-method chol_solve,gpu.matrix.tensorflow,ANY-method chol_solve,gpu.matrix.torch,ANY-method chol_solve-methods ginv ginv,gpu.matrix.tensorflow-method ginv,gpu.matrix.torch-method ginv-methods solve solve,ANY,gpu.matrix.tensorflow-method solve,ANY,gpu.matrix.torch-method solve,gpu.matrix.tensorflow,ANY-method solve,gpu.matrix.tensorflow,missing-method solve,gpu.matrix.torch,ANY-method solve,gpu.matrix.torch,missing-method solve-methods
sortsort sort,gpu.matrix.tensorflow,logical-method sort,gpu.matrix.tensorflow-method sort,gpu.matrix.torch,logical-method sort,gpu.matrix.torch-method sort-methods
Spicify type of 'GPUmatrix'dtype dtype,gpu.matrix.tensorflow-method dtype,gpu.matrix.torch-method dtype-methods dtype<- dtype<-,gpu.matrix.tensorflow-method dtype<-,gpu.matrix.torch-method dtype<--methods to_dense to_dense,gpu.matrix.tensorflow-method to_dense,gpu.matrix.torch-method to_dense-methods to_sparse to_sparse,gpu.matrix.tensorflow-method to_sparse,gpu.matrix.torch-method to_sparse-methods