Auto-Scaling Memory #849
Replies: 5 comments 5 replies
-
|
IIUC you're trying to find the minimum But is the I think of One could imagine more advanced optimization strategies which could tune this parameter automatically, but that strategy would surely have to know a lot more about your hardware options. |
Beta Was this translation helpful? Give feedback.
-
|
The reason I want to do this is cost management of Lambda instances. You're billed by allocation of Lambda instances, so if I partition 2 GB for the instances and I only needed 650 MB I'm still billed for the full 2 GB. This script adjusts the allocated memory in a dynamic way based on the requirements of the graph, and leaves a little head room just in case, so as to be a little more efficient w.r.t costs. |
Beta Was this translation helpful? Give feedback.
-
|
Another way to find the maximum allowed memory would be to set a very high allowed memory then find what the projected memory is (by calling
|
Beta Was this translation helpful? Give feedback.
-
|
I think there is scope for making (more of) the spec only needed at planning time, not at graph construction time. Some things like choice of executor already are, and it seems that allowed memory could be except for tricky cases like qr. To do that we might store a logical (memory-independent) representation of the computation (at graph construction time) then convert it to a physical representation (at planning time) where the amount of allowed memory is known. (Having a logical representation would open up #333 too.) This would be quite a lot of work. Regarding cost management of Lambda instances (which is the more immediate concern), some workloads have very uneven memory requirements. For example, one operation might only need 500GB, whereas a later one in the same computation might need 2GB. It would be useful to think about how to improve the efficiency in these cases. In the local machine case, we could do this by dynamically changing the number of workers in the thread or process pool for each operation. So if the machine has 16GB of memory then there would be 32 workers for the first operation, and 8 for the second. We could implement this simply by creating a new pool for each operation, or by writing a specialised pool (or using a library like more-executors). For distributed executors like Lambda, we could pack multiple tasks into a single container, or we could have variable-sized containers. |
Beta Was this translation helpful? Give feedback.
-
|
Thinking a bit more about variable-sized containers, for Lithops it would be possible to deploy multiple images with different memory limits (by running this line with, say, Other distributed executors have different considerations:
So this might be worth exploring on Lithops and Ray at least. Other executors probably need a way to pack multiple tasks into a single container. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
So there's a use case I have for processing a whole bunch of different sizes of chunked data using the same formula. Right now the best option I seem to have for updating my
Specprogrammatically with the correct memory constraints needed for the job is to deliberately set it low, check the projected memory, update the spec, check the projected memory is still valid, compute. A loop that looks a bit like this:Is there a better way to do this? Can the
specbe dynamically updated before I call compute again?Beta Was this translation helpful? Give feedback.
All reactions