MixedModels.jl
MixedModels.jl copied to clipboard
Evaluation of devresid from an updated eta in GLMMs
In the "something to think about for the future" category, it seems to me that the basic loop in glm and glmm evaluations, eta -> mu -> varfunc -> mueta -> devresid could more effectively be written using a RowTable instead of the current GLMresp struct that has several parallel vectors. The evaluation is essentially row-wise and it would help to have the row elements adjacent in memory instead of in separate vectors. While doing so it might help to look at whether the LoopVectorization::@avx macro could aid here. I don't think that going all the way to using Tullio.jl is warranted here but it may be worth exploring.
I'm open to this, but:
- I'm wondering if we should keep
GLMresparound for some surface compatibility withGLM.jl. Of course, I don't think we really have any other compatibility in terms of internals, so that probably doesn't matter. - If the rows are a constant distance apart in memory, then there may not be too much penalty for them not being adjacent. You still have the penalty for multiple accesses when going from RAM to CPU cache, but modern CPU prefetch is really smart about doing this movement ahead of time for constant offsets, and then once you're in the cache, it doesn't matter.
- Given my recent tour of numerical linear algebra and the effects of the AVX512 instructions on that (this is where the rank deficiency arose), I'm "curious" what using
@avxwill do. :wink: