HotCarbon 2023

Carbon-Aware Memory Placement

Sven Köhler (Hasso-Plattner-Institut (HPI)); Benedict Herzog, Henriette Hofmeier, Manuel Vögele (Ruhr-Universität Bochum (RUB)); Lukas Wenzel, Andreas Polze (Hasso-Plattner-Institut (HPI)); Timo Hönig (Ruhr-Universität Bochum (RUB))

This transcript was made by AI. The open source speech recognition model Whisper (large-v3-turbo) transcribed the recording with faster-whisper. Names and technical terms were checked against the paper, but it can still contain mistakes. The recording is the reference.

0:00 Thank you for the introduction. So I'm Sven Köhler from the Hasso Plattner Institute in Potsdam, and this is a joint work with my colleagues from the University of Bochum, where I'm spending a lot of time also at the moment, as you can see. The good thing at this venue is that I don't have to explain to you that our compute systems are carbon intensive. That's a good thing. But here's something I want to maybe draw into your attention a little bit more. So when we look at the power consumption of compute devices, we see that actually the caches and the TLB are also quite power demanding compared to the actual computation and all the microarchitectural details going on there. And this becomes even more intense when we look at things like the main memory.

0:49 So we can find that the normal DRAM module is consuming like two orders of magnitude more energy than even the caches. This is one part of the motivation I have for this talk. The second one is that we look at different memory technologies now coming into existence or stuff you can buy nowadays. We can find that we have novel memory interfaces we haven't had before, and we also have new cell types, and we have new characteristics we haven't had that much in the past. And this introduces highly heterogeneous properties to different parts of the address space, and also some of those components even have a limited lifetime. So for example, if you have like flash storage, which you access via normal load and store operations, you will like have wear and tear behavior and maybe have to decommission your memory module a little bit earlier, therefore driving up the embodied carbon emission costs.

1:47 And the entire image becomes even more complex when you think about coherent interconnects, which allow you to have disaggregated memory scenarios, where you borrow another machine's memory into your own address space. And then along the interconnect, you have newly introduced energy sinks, which drive up your energy consumption even more. So putting this all together, we can see that the existing abstraction of a homogeneous address space so far is falling short from an operating system view, and we want to improve the carbon efficiency for memory placement decisions. And this is why we are proposing cMemento, an approach where we combine characteristics and knowledge about actively running workloads on a system, and the available memory resources, main memory resources in such a system. And we combine those characteristics with a carbon model in order to make carbon-aware memory placement decisions.

2:48 And now talking about which level of abstraction I mean by memory placement, think about the entire software stack, ranging from the hardware up to the application code through the programming languages, we can find that programmers often tend to think in data structures or objects, which in turn turn out to be buffers. So something you create with an allocation, and such allocation can span across multiple pages, or maybe fit into a single page. The abstraction operating systems had so far of placing pages on different memory resources also falls short. So we see an operating system needs to be aware of single allocations.

3:37 This is a high-level overview of our cMemento approach. But I will walk you through the details in a second. The most important thing is the second column, where you can see the characteristics we gather from the workloads and the memory resources and combine those in the later steps. But let's dive into this figure. So first of all, the carbon model. The carbon model depends, of course, on operational carbon and on embodied carbon. Embodied carbon is information we mainly depend on from the vendors. And the carbon model itself has three main factors we're taking into account. The first one is the memory access behavior, which we observe from the workloads or which we deduce from... Can I maybe move... If I click here, what happens? Okay.

4:27 No, I cannot get rid of this. Anyhow. The first one is being the memory access behavior. The second one is the allocation granularity. So how does the energy demand change when we increase or decrease buffer sizes? Maybe we are starting to use a different memory bank, and therefore we have more energy demand. And the last one is a top-down hardware model where we start off with very generic models. And then we can say, okay, for a specific vendor or even a specific type, we can refine how this particular memory source is changing its behavior depending on what we need. And we combine those information into an ML approach where we have actual measurements taken with RAPL or additional monitors attached to power rails as a ground truth and try to infer what will future workloads with comparable memory access behavior, allocation granularity, and so forth will be using.

5:34 And we're going to compare different approaches here, linear models, ensemble models, and also more complex neural networks in terms of accuracy, the expressiveness, and how much energy we are actually using for training and inference. Because there needs to be an inference, because there needs to be a break-even point to not have operational emissions just rising up because we are now inferring what we put potentially safe. Now the next question is, how does an application communicate its sensitivity, which is how it would behave on the memory with a lower bandwidth or maybe with a different latency or maybe if it is requiring non-volatility or not. And here we first will demand some expert knowledge from the developers to be provided. For example, here we can see an envisioned API by us where we are using scoped allocators.

6:35 And in the scope down here, we can see that now all allocations are denoted with such sensitivity so that the operating system component, which is deciding where to place this buffer, can now take into account knowledge about this workload. This is, of course, only good for new applications, which we are writing now, and it requires you to have domain knowledge, which is for legacy applications and all the others. In the end, we are an operating system and we have to somehow cope with everything there is. We are also trying to infer your knowledge implicitly, either from static code analysis upfront or at runtime at looking at profiling information and tracing information from micro-architectural hardware counters. And to persist those information we then gathered across runs.

7:28 So if an application is restarted in the future, we are embedding a tracing format, which we call the Memento notation, into the ELF sections. So the next time the application is run, our operating system can look at the information how this particular application will behave. And the operating system component, which is doing that is what we call the memory governor. As an operating system component, it has a system wide view of the available resources, which are free, which are used, and also what are administrative constraints given by the systems operator. And from the possible decision space of all placements, it will pick those who are satisfying all set constraints, and then in there pick the most carbon efficient in the current scenario for that workload.

8:20 And being a part of the operating system also allows us for a very efficient implementation and to have a full system control over the hardware. So we can, for example, decide, okay, now the working set size is quite small and we can move all allocations to another memory bank and just switch off those which are not used anymore. So enabling us to save lots of energy and run here or maybe just to offset writes to a very wear and tear behavior induced memory resource. And just to illustrate the potential decision space of cMemento, see here a small case study where we are comparing a system with three different types of memory, memory, namely traditional DRAM, Viking NVDIMMs and an Intel Optane system. And you can see that here we are discussing four different power supply with different carbon intensities, wind, coal, gas, and a mix of them.

9:24 And we are looking at different scenarios, namely the number of allocations, the lifetime of them, and whether or not we are requiring persistent or volatile memory. And we can find that depending on all those allocations, the different placements will be, well, fitting more on one resource or another. And an interesting one is here, the one on the top right side, where you can see that the Optane memory is, for example, quite important when you have a low carbon intense power supply like wind. Here we can see that the embodied carbon emission with this Optane memory is actually quite well offset by the operational carbon emissions. So our memory governor would choose this configuration, in fact. If you're interested more, there are more scenarios in the paper, and I'm happy to discuss them maybe over coffee a little bit later.

10:20 But this already concludes my talk. I've presented to you cMemento, our approach to combine knowledge about actively running workloads and available memory resources with a carbon model to make memory-aware placement decisions. And you can also meet us at the OSDI poster session tomorrow if some of you are staying around for this, where we are also presenting parts of this and also some earlier work on different components and how we are approaching now this architecture. So thank you very much for your attention, and I'm happy to answer your questions. Okay. So the question is whether or not we are able to have all the information necessary to make set placement decisions. And one example that was mentioned was the cloud. And here I would say we are not looking at the cloud.

11:37 So we are looking at one server running in the cloud. And unless now taking CXL, CXL is a different example. But if we are like within one case or one enclosure of the computer, we can have such information. And actually the last talk already discussed an approach with carbond where we have information on the carbon intensity, which is maybe dependent on the data center or is good. For example, in Europe, we have the European Transmission Network, which can provide us with carbon intensity information. And as an operating system, we know which specific hardware is built in into a machine. So we can work there. Unless, of course, we are talking about cloud scenarios where we have just abstract job managers, but we are an operating system within one server.

12:26 Okay. Thank you. Thank you.