Repository navigation
Conversation
|
Previously,
|
|
WIP: undoing heavy-mesh caches. |
|
@sghelichkhani this might have a performance on G-ADOPT. It would be good to know if that's the case. |
connorjward
left a comment
There was a problem hiding this comment.
Largely looks fine but there are some merge artefacts that need removing.
|
Removed conflicts, should be good now. |
connorjward
left a comment
There was a problem hiding this comment.
Thanks! I want to make sure that this doesn't affect performance before merging though. We can look at:
- CI runtime
- Any experiments you have done
- Feedback from @sghelichkhani ?
|
@connorjward I tried this on G-ADOPT but the current head (dae70f0) does not import, and the Firedrake CI fails the same way. There are two issues in
Once these are fixed I am happy to test it on G-ADOPT. |
sghelichkhani
left a comment
There was a problem hiding this comment.
See issues in the comment, once fixed let me time gadopt's CI against this.
|
@sghelichkhani I have now fixed these issues. Please feel free to run your tests and let us know about performance. |
|
@achanbour thanks. I ran the G-ADOPT regression suite on this branch. The total time is the same as main, but the iterative fieldsplit Stokes solves change: the velocity block needs about a third more CG iterations and some Schur solves several times more. The cause is that the null space and near null space given by the user no longer reach the fieldsplit blocks. Two of the new LRU caches also drop entries that G-ADOPT uses again: I also have a question on |
|
Thanks Sia.
Oh yuck. That's definitely not the expected behaviour! We should reuse the topology for different geometries.
This is a good point. I think there are two possible solutions to this:
This stuff is hard. The reason for this PR is we realised that the existing 'heavy cache' code didn't really work because Firedrake and pyop3 didn't know enough about each other to cache intelligently. |
|
@connorjward looking through CI failures we had:
firedrake/tests/firedrake/regression/test_fs_caching.py Lines 163 to 176 in 7cc2249 In other words, we are no longer sharing axes between mixed spaces defined on "identical" components. This is due to the refactor of the caching, which now stores the entries on def _mesh_cached(hashkey=lambda *a: a):
def wrapper(func):
return cached_on(
lambda self: self.mesh().topology,
get_key=hashkey,
get_version=lambda topology: topology._topology_version
)(func)
return wrapperLooking at the changes in #5760, every Question: do we want to have |
|
I think yes. Keeping one |
Thanks @sghelichkhani. I've now implemented this fix in #5760. |
|
@connorjward all the issues highlighted above should now be resolved with the fixes in #5760. Only thing left is to figure out how we want to set/optimise the cache sizes... |
I want to try and write my own solution for heavy caches. Just replacing with LRU caches may not be optimal. |
Following the introduction of VoM mutation mechanism, we need to think more carefully about how we manage caches.
This PR fixes two things:
cached_on)This way, we don't need to worry about 1) having persistent/stale cache copies lying around in memory and 2) the lifetime of caches on heavy objects like mesh topologies, pyop3
AxisTrees etc. and the need to invalidate those.