I want to speed up my model by using the opencl function in the dev version of brms. Followed the suggestions in the forum, I can now successfully run this new function. Thanks!
However, I found that the effect of GPU acceleration is not very obvious. When I use “within chain parallelization”, I can obviously feel that the CPU is working and the speed of computing is also accelerated.
My questions are:
-
How do I know the GPU is working for speedup? At present, I mainly detect the GPU through “Task Manager” Windows 10. I found that when I run the model, the GPU only works by 5%~10%. Is this normal?
-
Is it true that the “negbinomial model” cannot be accelerated through GPU at present? so the effect is not obvious?
-
My original dataset is in dataframe format (Rstudio). Do I need some conversion of my data format first to get the acceleration effect?
My code is as below:
fit_serial <- brm(value ~ s(hour,by=period)+weekend+offset(n)+(1|id)+(0+hour|id),
family=negbinomial,
data = data,
warmup = 1000, iter = 1200,
cores=2,chains = 2, opencl = opencl(c(0, 0)),
backend="cmdstanr")
- Operating System: Win 10 pro
- brms Version: 2.15.9
Hope to get some advice on this issue! Thanks again!
Best,
Jacob