Experiments with GPUs for RTMB?

27 views
Skip to first unread message

James Thorson

unread,
Apr 9, 2026, 11:39:36 AMApr 9
to TMB Users
Hi all,

Has anyone experimented with using GPUs for RTMB?

I understand that GPUs don't "play well" with sparse-matrix computation, but have an RTMB estimation workflow that involves 2nd-order derivatives of many-small-and-dense matrix-inverse and vector-matrix products in RTMB for a large mixed model (no sparse matrix inversion involving Eigen/SuiteSparse during Laplace, quasi-Newton inner optimizer, delta/epsilon method, etc), and it seems like the type of problem for which GPUs would do well?

Jim

Tomas T.

unread,
Apr 22, 2026, 8:14:22 AM (7 days ago) Apr 22
to TMB Users
Hello Jim, hello all,

I am heavily using matrix operations, and I was considering to use GPU. But after reading https://cran.r-project.org/web/packages/GPUmatrix/vignettes/Vignette.html  and seeing Figure 1 there, I saw that the MKL library works the same if not better, without the need to change my R code at all. So I went for the Intel-OneMKL library and installed it for R on Windows and also Linux clusters (works on AMD too), and getting a huge speedup without having to change a single line of code.

I haven't tested the speedup for RTMB hessian derivatives etc. (I am skeptical it will improve the speed of the AD feature - those are probably not matrix operations?), but it massively sped up the matrix operations like chol(), %*% etc.

Tomas
Reply all
Reply to author
Forward
0 new messages