-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Precalculate more things in Grid
and/or GridRSP
constructors
#28
Comments
I'm not objecting to anything and I'm not really in a position to do so but my general thinking has been that the more things you store, the higher is the risk that the state becomes invalid, so there should always be somewhat heavy computational reasons to store something that can be easily computed from existing quantities. If something ends up as a bottleneck then this is of course a different matter but I usually think it's useful to demosntrate that something is a bottleneck before optimizing. In my experience, the calculations in this packages are heavily dominated by a few big matrix operations. |
That makes sense. But I think these objects are calculated from the The main bottleneck currently being hit is too much memory allocation on the cluster where each thread doesn't have much memory. So many jobs are failing but with some stochasticity. There are multiple angles to reduce this, these allocs are a minor detail of a plan to control and quantify allocations so we can a bit more accurately book memory requirements per thread. If we can allocate most of what we needed before computations then everything else is easier, and even if we still miscalculate, memory-related failures will happen immediately rather than during a long job. A bigger problem than this issue is the But overall I'm looking to go over things to control memory use a bit more, and not every step will achieve a lot on its own. |
Yes, these are totally minor details. Mostly just as part of a policy of allocating what we can easily allocate up front. For the solve, I tried an optimisation that breaks the RHS array into columns and calls the UMFPACK.solve! on each column directly (as / does internally). A pretty good reduction in memory and has some performance gains on the basic example workflow: Maybe it won't work in all contexts if e.g. rectangular matrices don't hit the same function calls,I'm not that far in (That PR also allows reuse of Z, so we can use the same memory on multiple windows over larger data, so the allocs will be very low after initially allocating the largest required Z. We could do the same with F from lu but resizing is harder) |
This is basically ubiquitous:
So these may as well be precomputed fields on
Grid
?This is also a very common allocation, we could just do once in GridRSP?
These will be a constant source of medium sized allocations and gc churn when running multiple operations over many tiles.
I'm not totally sure which object Grid/GridRSP these should go on.
The text was updated successfully, but these errors were encountered: