WIP: cache woodbury intermediate matrix and GLS noise blocks#1994
WIP: cache woodbury intermediate matrix and GLS noise blocks#1994dlakaplan wants to merge 12 commits into
Conversation
|
I don't yet have a good test for this to demonstrate the speed. If anybody can suggest a good data-set which includes some noise fitting but is still finite in time, let me know. I am also still unsure if the key is constructed in the best way. |
|
I think in the testing that Daniel did, he used @jeremy-baier's GP branch, so not clear if this can be properly tested without that. But any feedback would be welcome. |
I think that these should work fine for testing ( in /test/datafiles/ )! It just contains the achromatic red noise basis. The speed ups with the above alone should not be anywhere near as dramatic as with a larger noise basis but I would imagine still apparent. |
My PR #1966 will certainly run into some conflicts with this, but I should be able to resolve them and all of the speed ups should carry over. Making a note for myself, that I will need to look into the phi matrix caching because in #1966 , I am making the phi matrix optionally non-diagonal. |
Those are what I was using, but I don't think they have any of the noise parameters as free, so they won't change. therefore it will result in different caching behavior. I could just free them, but I don't know if there is something better. |
|
@jeremy-baier : do you know what cache key was used for those tests? I tried one, and I think it works OK, but it might be too conservative. I am not finding any caching of the GLS sub matrix, only on the Woodbury side. |
I don’t know what cache key Daniel (@DanielJOliver )was using in his Claude testing of this. When I tried some caching earlier, I used the toas and frequencies I think but did not see the speed ups that I thought. ( Though I think I was doing this wrong. ) |
OK, I don't think that is a proper cache. The matrices depend on the noise properties, right? So they should change if the noise values change, which is what I did. |
|
Agreed that the matrices do depend on the noise values, so the key has to include them. In my speedups with Claude the key I used was: So it keys on the noise parameter state (value plus On the GLS sub-matrix not caching, in my testing it wasn't the key, it was where the cache lived. The Woodbury cache is module-level, but the mtcm cache as it's written here is an instance attribute ( One small thing for down the line, Happy to share the exact diff for the module-level mtcm cache if it would be useful. |
OK, I think this is much more like what I had written (without looking at your Claude code): |
Part of #1985
Cache some of the intermediate matrix calculations that don't change if the noise stays the same. I am not sure if this choice of key is appropriate.