Basic Linear Algebra with GPU
Overview
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.
- Fixed bug in
diag()method forgpu.matrix.torchobjects. - Added documentation for
dimnames<-method forgpu.matrix.torch. - Fixed Rd cross-references for
Matrix-classand%&%. - Updated URLs.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK8 OK2026-03-27
Documentation
- Help pages
- 33
- Examples that run
- 14%4 run in a plain check · 25 never run
- Exported functions with examples
- 80%
- Documented parameters
- 83%
- Return-value docs
- 80%
- Help pages citing references
- 6%
Downloads
Dependencies
Installing GPUmatrix adds no packages beyond those that come with R.
Code & Tests
People & History
Previously maintained by Cesar Lobato-Fernandez (0.1.0 to 1.0.2).
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- unarchivedReturned to CRAN2026-03-26
- 1.0.3Latest2026-03-26 · current release · diff ↗ ·
removed 2 exports
NMFgpumatrix, LR_GradientConjugate_gpumatrixadded 6 exports
dtype<-, colMaxs, rowMaxs, rowRanks, to_dense, to_sparse - archivedRemoved from CRAN2025-12-19issues were not corrected despite reminders
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 1.0.22024-03-01 · diff ↗
- 1.0.12023-12-01 · diff ↗
- 1.0.02023-11-27 · diff ↗ ·
added 4 exports
glm.fit.GPU, GPUglm, NMFgpumatrix, LR_GradientConjugate_gpumatrix - unarchivedReturned to CRAN2023-10-16
- 0.1.12023-10-16 · diff ↗
- archivedRemoved from CRAN2023-10-12check problems were not corrected in time
- RR 4.3.0 released · 2023-04-21
- 0.1.02023-04-20
- RR 4.2.0 released · 2022-04-22
Package metadata
- First published
- 2023-04-20
- Total releases
- 6 / 3 yrs
- License
- Artistic-2.0 OSI
- Minimum R
- ≥ 4.1
- Download size
- 3.7 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("GPUmatrix")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.