HotCarbon 2023

carbond: An Operating-System Daemon for Carbon Awareness

Andreas Schmidt, Gregory Stock, Robin Ohs (Saarland Informatics Campus); Luis Gerhorst (Friedrich-Alexander-Universität Erlangen-Nürnberg); Benedict Herzog, 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 Cool. Okay, thank you very much. My name is Benedict Herzog, and I'm happy to present our work on carbond, an operating system daemon for carbon awareness. Let me start with a rather old system. What you can see here is a G. So let me start with a rather old system. What you can see here is a GE645 system built around the 1960s running the Multics operating system. Multics is one of the first multi-user operating systems in the world, and even back then, with multiple users at the same time, questions arose like, how can we manage and distribute the resources of an operating system? And that's kind of easy for normal hardware resources. So if somebody uses up one kilobyte of memory or two megabyte of storage, it's easy to say, well, this person uses that.

1:09 It's getting a bit trickier if you have more than one person running at the same time. So you need a clock, you need to start and stop measurement when does somebody use a resource? You need things like scheduling strategies. And so on. This is a moment where the fun begins for operating system guys, but it's a bit trickier than just one person. But both of it was already done back then in the 1960s with Multics. A few years later, with the rise of mobile devices, mobile laptops, mobile phones, the next more important or next important resource came into play, and that's energy consumption. Energy consumption is a bit more tricky because it's the hardware who consumes the energy, but it's the software who is actually the reason for it.

1:58 So you have to need a complete picture of the application software on the top down to the hardware running it. And the operating system was always the right place to track the energy consumption because it has a complete view. It knows its application. It knows the hardware. So it can properly attribute the energy consumption to users. And for example, our mobile phones do a decent job of doing that. And now, after some years later and more awareness for the climate change and our computing and networking equipment, one of the major contributors to global emissions, we also need to track carbon emissions. And, again, we think the operating system is the right place to do so. So we propose an operating system daemon carbond to track and attribute the carbon emissions in the system to the single users.

2:52 And how do we think that can look like? It's a typical operating system view of the system. So we have applications in the user space, one or more running simultaneously, and they interact with the kernel. So we have a scheduler scheduling the applications. We have some power control making all kind of power decisions. And now we also have carbond tracking the applications for the carbon emissions. And we have also all the information from the hardware. So we know our current power supply. We know the CPU we're running on, how much memory we have and we use and so on, what battery we are running on. We have all this information. And we want to provide this information on the one side for the operating system itself.

3:38 So we can make more efficient decisions, like the scheduler can make carbon efficient decisions, or we can make carbon efficient memory placement decisions and so on. But we also want to provide this information to the user to the user space application, because if the user can't make an informed decision, we usually can't run as efficiently as we want to run. So how do we think the carbond interface for making this information available to the user could look like it's we envision something like a typical Unix-like interface. So file system tree, for example, under /var/carbond. And there's a file, for example, emissions, where you can read just the current emissions of the system. And if the situation changes, like we have a different load on the system or the power supply changes, the value is just updated and you can be notified, for example, by something like inotify.

4:37 But for a complete picture, we not only need emissions, we need to separate between operational emissions on the one side. So the emissions to run and operate our system, and the embodied emissions on the other side. So the emissions during manufacturing our hardware. And what information do we need for both cases? So for operational emissions, we need on the one side, the energy consumption of our system. That can be partly done even today. So, for example, AMD and Intel CPUs offer the RAPL interface where you can read the current energy consumption of your CPU.

5:18 Maybe for other components, there are similar interfaces, but I guess for some of the components, we just need to rely on energy models where we estimate the energy consumption. And the second information we need is the carbon intensity of our power supply. That's an external information we can't determine within our system. That's just something which comes from external.

5:42 For the embodied emissions, we need also one external information, and that is the total embodied emissions produced during the manufacturing of our hardware. That's sometimes done in lifecycle analysis, for example, but we could find it somewhere else. And what we also need is, on the one side, how long do we use a resource in ratio of the total lifespan of our hardware? And what we need, how much of a resource do we need? So, we can probably attribute it to the user using it.

6:19 And especially for the embodied part of this, we also need to do it for each hardware component. So, we not only have two values, but we have it for every kind of subsystem in our system. So, for computing, like our CPU or accelerators or GPUs, for storage, for memory, for networking, and so on. So, we have a lot of fine-grained information which we can provide to the user, and that's certainly helpful for the user. So, they get a complete picture where their carbon emissions are produced, but sometimes that may be too much. So, sometimes they just want to know what's the current efficiency status of my system. And therefore, we can provide some derived metrics, for example, the SCI or any other metric, which is carbon-related, based on these raw values we already have.

7:14 So, what do we envision? What can be carbond used for? And we have some examples here. On the one side, a programming library called resource gauge minus RS. That's a programming library for the Rust programming language, where you can give your functions energy budgets, for example, energy budgets, but also time budgets. So, in this example, the compute function is only executed if it can be done within 10 joules of energy consumption.

7:44 And with carbond, we can extend it to carbon budget. So, we can execute the function only if we can do it within 10 grams of CO2 emissions. Another example is a user-space tool called CPERF. It's just based on perf. perf is a very powerful tool to get metrics from your system to read all kinds of performance metrics. And in this example, that's my laptop sleeping for two seconds, and I can read the RAPL counters for the energy consumption of the CPU. And sleeping two seconds took my laptop 5.62 joules of energy. And with carbond, we can also do it for carbon. It's a fictional example, but in this example, it would be emitting 1.32 grams of CO2 emissions just for sleeping for two seconds. And last but not least, what we envision are carbon flame graphs.

8:42 So, short reminder, what are flame graphs? It's a very powerful tool to visualize hotspots in your application. So, for time, what are the functions where you spend most of the CPU time in your application? And this is a database server serving our calendar server in our group. And what we can see here is that we spend a lot of CPU time in executing joins, optimizing joins, and the creation of temporary tables. So, not very surprising for a database server, but that's what we do in our example. And with carbond, we can also do it for carbon emissions. So, just a reminder, the wider rectangle is, the more emissions we have, either more execution time or with carbon emissions, more carbon emissions. And it's, again, a fictional example, so it's no real data, but in this example, the picture completely differs from the time perspective.

9:48 So, we have, again, the creation of temporary tables, much more prominent now. And we also have the execution, the optimization of joins, a bit prominent, more prominent. And we also have the execution of joins, but it's only a very small amount of carbon emission. So, it's not even, the text not even fits on the rectangle. And why is that? In this example, the creation of temporary tables and the execution or the optimization of joins also create access to the storage, to the HDD. So, we have another component where we have embodied emissions, where we have operational emissions. And we need to account for them. And that's why the carbon perspective on our database server is very different than the time perspective. And that's maybe interesting if you want to make a carbon-efficient and not a time-efficient application.

10:46 We also thought and talked about a battery model. The details are in the paper. It's a very interesting topic because you can think about when do I charge? Do I charge if the power supply is dirty? When do I discharge? What's the best strategy here? I won't go into detail here now because of the time constraints. But have a look at the paper or I'm around and talk to us. So, it's a very interesting topic. And I guess there's a lot of interesting work to do. So, let me shortly conclude. What we propose is carbond, an operating system within the operating system to provide information for the operating system for the user with carbon data. And perhaps coming back to the GE 645, if you're here in Boston for some time, you may look just over there in the MIT's data center where you maybe find the original poster of this concept art as it was firstly delivered to the MIT there.

11:51 And now I'm happy to answer one or more questions. The question was regarding where do we get the information for the power supply, the carbon intensity for the power supply, and how does it affect, for example, the flame graphs? Yes, it has, of course, a major influence. Well, it depends a bit on the application scenario. So, the embodied emissions can make up for a lot of the carbon emissions, especially for mobile phones. So, it's much more embodied emission than the operational emissions. It's not so much for servers because they're running 24 hours and usually 24 hours and have a high load all the time. So, it's more important for servers. And it's a not yet completely answered question where we get these carbon intensities. There are some websites and some countries already provide very detailed information on the current carbon intensity of your power supply.

13:37 So, that could be one source of information, but I guess there's a lot of more work to do. And I can't answer it right now. So, I guess it's a question for the whole society. How can we get this information? And it's getting easier if we have 100% renewables. So, perhaps that's its goal.

14:54 Actually, two questions. First one was about the scope of our system. At the moment, we think carbond targets one server. So, one system, the operating system running on one system. Because there we have the complete picture. We know the hardware. We know the software. We can report about that. And it depends on... So, you can have something like disaggregated memory. So, that's getting a bit more tricky. But, yes, it ends at the network interface. And what I would say is required for bigger systems like cloud services and so on is another layer built on top of carbond to collect all of this information to a complete picture of a data center, for example. So, that's what I would say is our goal for one system.

15:47 And somebody else's use our information to build a more global view of things. And I forgot your second question. I'm sorry. Right. Second question was about the idle and the embodied attribution of during idle time. Very good question. That's very... Originally, we were very focused on the SCI metric. But that's a problem where we stumbled across that accounting embodied emission for idle is not very easy in the SCI metric. So, we decided to go back to the raw emission values and provide any kind of derived metrics, but we could change it, for example. So, we are not focused on SCI. So, we have no answer for that. The SCI is perhaps not yet ready developed for this problem. But in but in days behind, it seems like it's that right now.

16:38 That's right. All right. So, we have no other consideration for our application for Wyndham. So, we you should get to the