HotCarbon 2022

The Odd One Out: Energy is not like Other Metrics

Vaastav Anand, Zhiqiang Xie, Matheus Stolet, Roberta De Viti, Thomas Davidson, Reyhaneh Karimipour, Safya Alzayat, Jonathan Mace (Max Planck Institute for Software Systems (_MPI-SWS)_)

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 Okay, we're back. Our last speaker is Vaastav from MPI-SWS, who is going to talk about energy as a metric. All right. Hello, everyone. I hope the mic is on. And I'm going to do this without the speaker notes because I can't seem to figure out how to get them. But, well, then. Hi, I'm Vaastav Anand. I am a PhD student at MPI-SWS, and today I'm going to talk to you about how energy is not like other metrics and how we can use that information to come up with a design for tracking energy measurements or energy consumption in cloud software. So before we do that, let me ask you this. Why should we actually track energy in the cloud? Well, data centers are actually very energy-hungry monsters. So what they do is that right now they consume around 1% of the world's total energy consumption, and it's estimated that like by the end of this decade, they'll be consuming around about like 8% of the total world's energy consumption.

1:00 So to be energy-efficient data centers, we obviously need to find out why we are inefficient, and to do so, we need to track and attribute energy to every single component at different software granularity as well as temporal granularities that are running in the data center. So let us imagine if we had access to all of this data, all of this energy consumption data, as to how we would actually use that data. Well, the first things could be like just a design space analysis. And by design space analysis, I mean like looking at different design choices and implementation choices for building your applications and finding out which design specification or which design and implementation is actually the most energy-efficient one. So a simple example of this could simply be like from the first talk of today's first session, which was all about how to actually store data, and it was along the lines of like SSDs versus HDDs.

2:01 So that's like one example or one dimension in which you can imagine like doing some kind of design space analysis, and you can imagine there are umpteen of these dimensions that are available, especially in like something as complex as data center software. The second is energy-adaptive applications. And by that, I mean like applications that can just track the energy consumption of their, their selves. And based on the current estimates of the energy consumption, they can choose to deal with incoming requests in different manners so that they can never go out of bound with the energy consumption. So let me tell you like a brief story, I guess, not story, but like something that happened in the morning when I was trying to come to HotCarbon.

2:45 I obviously did not remember what the address was. So when I was trying to write the address into Uber, I looked, I tried to Google search HotCarbon to see what the address was. Turns out Google actually, Google search returned around about 1 million results. And I thought to myself, why would I ever need 1 million results for an address? And turns out I actually don't. I just needed the first one. Um, so this is like one example where clearly the computation is going on, which is really not going to be something that humans are going to be using at any given point of time. Like I'm, I'm pretty certain that like, no one is going to look to 1 million links, but if someone does, please feel free to contact me. I would love to have a conversation with you.

3:26 Um, so based on that, like, this is just one example where like something is inefficient or something that at least has a scope of like, you know, optimizing something from an energy consumption point of view. Um, and obviously when these consumptions does not work, you can always do some kind of preemptive cutting. So like, for example, think of if you for an incoming request, if you can actually predict and estimate, uh, how much energy that request is going to use in the future throughout like the lifecycle of the request in the cloud system. Um, and you find out that that that is going to just basically blow up the energy budget of like the application itself. You can choose to not just admit the request. This will make sure that like the, the energy that there's no wasted energy and like something that was eventually going to get dropped is just dropped at the very start.

4:16 So you don't, not really wasting any energy in terms of like admitting dead requests. So how does energy tracking and measuring, uh, measurements work today? Uh, there, there are a couple of ways that you can actually go about it. First is obviously like using hardware to do measurements. Intel provides per core measurements via RAPL, which is the running average power limit registers. Uh, but they update every one millisecond and turns out using them in a live setting, uh, leaves the application prone to side channel attacks. Um, however, these registers can actually provide fine-grained software measurements, but like very coarser temporal level stuff. Like for example, you can get like how much energy your application is using at like one second intervals. Uh, but to get like fine-grained temporal level, like in order of milliseconds or microseconds at like function level energy measurements, it actually requires modifying the behavior of like how the, how the system actually execute requests.

5:15 So think about in terms of like, if a request is actually going to hit hundreds of nodes in a data center, you actually cannot inject random delays or anything like that or modify the behavior just to make a measurement. Cause that would just blow up the, or give you like garbage readings for energy measurement because of the observer effect. So the other option, instead of like not using, uh, not actually measuring using hardware, you just model the energy consumption of various granularities. This could include like modeling at a request granularity, uh, which is something that Power Containers did, but like they had made this assumption that the request remains constrained to like one server node, which is an assumption that I don't think holds anymore, especially with the rise of like microservice architectures in the last decade or so.

6:04 You can do it at like a server node granularity or like even at a data center granularity. But I think, uh, we are interested here today to actually think about it in terms of like an end to end measurement. That's providing us like measurements that like the granularity of the, uh, the final grain, um, temporal level and the finest grain like software level. So that we can use that information to make application specific decisions, uh, to make the applications more energy efficient. So before we actually like talk about how we would achieve that, let's look into like how energy is actually different from some of the other measurements. We really take in the cloud today. And that would at least help us guide to maybe not like a full proof plan, but at least identify some key components that we would need, um, to build like a functional, correct, uh, energy tracking system.

7:01 So first of all, how is energy different? Energy consumption is all encompassing. What that obviously means that every single component in a system consumes some energy. This means that like machines running the servers consume energy. The routers that are routing the packets consume energy. The network that is actually responsible, the network cables that are responsible for taking your request from one place to another also consume energy. And with the rise of like heterogeneous hardware and like programmable hardware in the last few years, the problem has just become worse because now we have programmable NICs, switches, routers, GPUs, CPUs, ASICs, NVRAM discs like we already heard in the first session today, which basically just complicates this energy tracking even further because each of these devices have this has its own energy measurement or energy consumption profile.

7:54 So to keep track of all of this, it's super hard for everyone right now to figure out like how to actually keep track of all the energy. The second point is that energy consumption is dynamic. What that means is it actually depends on multiple factors, both compile time factors and runtime slash deployment time factors. Compile time factors could simply mean like the design choices that you made. While making your application, this could include something like what's the threading model that your application is using? What is the level of concurrency that your application is using? Which choice, which library did you end up going for? Because even the library choices for let's say the containers in Java's standard library make a difference in the energy measurements today.

8:40 Or it could be runtime or deployment choices such as like the co-locations of services and how they're actually deployed. The hardware choices on which they're deployed as like, for example, SSDs versus HDD. And what is the CPU utilization when like all of these requests are being executed? Because each request will consume different amount of energy at different CPU utilizations. So it basically leads to the fact that like when you're measuring the energy for let's say one specific function at two different completely unrelated points of time. It could give you drastically different energy measurements because of like what's actually going on on the machine and on the application itself. Because energy measurement right this way is not as important. So the third point, which is quite frankly my favorite, is that we actually have insufficient hardware support for measuring energy.

9:37 There is no common abstraction for measuring energy across devices. There are a bunch of devices. We don't really know how they measure energy, if they measure energy, and how they are going to export this information in a fashion that is actually usable and actionable. The second is that not every device actually supports fine-grained measurement. Even like the Intel RAPL registers, even though they say and they claim that they update every millisecond, they actually don't attach timestamps. And you could be looking at stale data from like seconds ago. Apparently, Intel's Linux manual, I remember reading this, it suggests that you may be looking at data that could be 60 seconds stale. So it could be not the best source of information. And sometimes fine-grained measurement obviously alters the behavior of the application because of the observer effect.

10:30 So it just leads to like a bunch of challenges. And now one should think that like, oh, energy is different in all of these situations because we can't really measure it. It has all of this like characteristics that make it completely different from anything else that like we actually know of, sort of. So like, how do we actually build a solution that can help us track this energy measurement through this heterogeneous variable world that we live in? So tracking energy in the cloud. So the first problem that we need to consider is that we have heterogeneous hardware. So we obviously need something that can actually figure out when a request comes in, what are the pieces of hardware it's actually going to touch. So that we can figure out like, when we are attributing energy or like calculating the energy consumption for that specific request, which person or which node contributed how much percentage of that energy.

11:26 Thankfully, distributed tracing already tracks request execution across different components and it's already across the tool. So in addition to just providing this information as to where it was executed, it also provides us what code or source code was being executed through trace points or logging statements, which helps us like make a mapping between the source code as well as the energy consumption. The next thing is that we have to consider is that we actually can't take live energy measurements. So to figure out live energy, so we can't actually take live energy measurements. The only option that we are left with is going for a modeling approach. So now the question becomes, what does a model look like? The model has to have, the model has to have basically some notion of some kind of a training data.

12:21 And we basically have come up with this abstraction or not maybe the traction is not the right word, but like this division where we have divided our input space into the hardware configurations on which the application would be running, a set of application APIs that the request would be executing, and a bunch of different like parameters characterizing the workload that it's going to be executing at. So we basically, in pre-production, run a combination of these factors to generate the tracing data and use the RAPL measurements because in pre-production we actually can inject delays. So we can leverage the measurement profiling or the measurements that are actually available and use that to generate our tracing data. And that tracing data is essentially the input data to our model.

13:14 So, now the question comes, we have our training data. What exactly is the model that we are looking at? So the model here is because the tracing data itself is graphical in nature, we chose the graph neural network because it allows us to operate on this graphical tracing data and attribute different, like how much energy was used at different nodes in the graph, in the tracing graph itself. So it obviously is giving us this attribution at like different, in this distributed heterogeneous setting that we have been really looking forward to. So this offline model is actually good enough for any kind of offline analysis tasks or after the fact post-mortem analysis. However, we also had talked about use cases where we actually need to have some kind of online training data.

14:08 Not online training data, sorry, online measurements to actually be able to make live decisions. To do so, we have come up with this scheme where every single node runs its own prediction model, which is fed information from the offline GNN model periodically, and it uses that information to come up with estimates of incoming requests, which can be, which are then exposed to the application developers through an API, which they can just use to like make application level decisions. So this way we at least can like make this crazy intractable problem, to a certain sense tractable. The conclusion here is the fact that energy is really different from whatever existing metrics we have. We can't really use existing approaches for metrics that we have for metrics for energy because we have very specific challenges and characteristics of energy, but we can leverage distributed tracing for tracking this energy consumption in this heterogeneous world and have some tricks for modeling and measurement that will allow us to better track and estimate energy in the cloud setting.

15:15 Thank you. Hi. Yeah. Thanks for the talk. That's great. So in the GNN model, you feed in the distributed trace of the request and how it flows. And then you, the output is the system energy consumption and you try to figure out what contributes to the... So the, yeah, basically the whole idea is that in a distributed trace, you'll basically be looking at the service call graph for a single request. That's like the graphical nature of it, right? Because we train the model on all a bunch of distributed traces for a bunch of different API requests, like that would be, that would hopefully capture all the pathways that a request can take. We can use that information as well as like in that information to train the model, which will eventually when it's running with distributed tracing in production, it will get new traces.

16:23 And based on that, it will be able to attribute energy measurements or energy consumption percentages, let's say to different parts of the service call graph for that specific request. So more generally, how much training data is required? And more specifically, won't the power consumption depend on the state of the hardware in terms of the hardware load? And is that an important parameter that you can control? That is definitely an important parameter. I have no idea how much tracing data, training data would be needed because we're still building this. So I would love to know the answer to that question as well. That's why I'm doing research to find that answer. But in terms of hardware parameters, that is one of the key inputs, which is like hardware configurations.

17:07 By hardware configurations, like what hardware is running and like what's like specific processor models, specific memory models and everything, along with like other dimensions, which is like which API they're going to execute and what workload or like what utilization they're going to be running at. So we basically have to do a mix and match of all of these parameters, like let's say a set production of all three sets to come up with like the full input space. Then we would need to do measurements for all of that, you know, with the RAPL, so that we can have like training, label training data. Hi, Andrew Chien, UChicago. So great talk. Got me thinking about energy here in a complicated way. So I'm kind of wondering, you talked about the inadequacies of RAPL and some of these measurement frameworks.

17:55 And if you look at this from a power grid world where we have grams of carbon emitted per kilowatt hour, what granularity of energy is worth tracking? Or, you know, maybe a self-calibrating way of thinking about that is at what point do you end up paying more for the tracking infrastructure than what you can discriminate between the different users of the energy? Yeah, I mean, I think like in terms of the I'm not trying to pick on you. I mean, it's a tough question for the community, I think. Yeah, no, I completely agree. I'm just trying to think of it myself in the sense that like we definitely want some tracking so that we can have like some control over the application. Because the way I think about it is that it's not just a role of like the people running the cloud, but also people who are making the application that run on the cloud in a black box manner because they're there.

18:41 The only parameter that those people can control is like the application that is going to run. So from their point of view, having this tracking is going to tell them like what, how much energy their application is using on this specific set of like black box cloud that they're going to run on. So let's say if we move to a world where the cloud providers are actually going to charge based on the energy consumption. Right. This would be something useful for the users to know. I think that's kind of like where I kind of see it going. I mean, that's why I think that the tracking thing is important, I guess. So maybe I completely misunderstood. No, no, no, that's great. I mean, I think as points of reference, one thing we're looking at is if you look at what happens to financial systems, right, that they'll have limited resolution for prices, limited sizes of transactions.

19:28 At some point, you know, you can't be the computer scientist and go 19 orders of magnitude, right? Yeah. The financial people say that's not material, right? So if it gets merged into the financial side, you know, it clearly will become, you know, approximate at some point. But maybe for some technical reason is the reason I'm asking, you know, it's important for us to do better. Yeah. For sure. Thank you. Hi, this is Yibo. I'm also a student here from UC San Diego. Very interesting talk and I can definitely see the use case of collecting this energy measurement. So one question I have for you is how, like, do you think your tracing would adapt well to like a multi-user scenario where you have, you're sharing, time sharing these devices or what are, and what are the main challenges for solving that problem?

20:17 So, yes, I would think that like there's, in terms of like concurrent users or concurrent requests, I don't think there should be an issue because like distributed tracing already gets this like sort of information separated out anyways. So this is based on like separating the utilization of different hardware devices? Yeah, sort of, essentially that. Like this is where the whole hardware configuration set comes in into like the training generation part. Like this is basically like where we are going to generate all the information we could potentially see at like specific data points in like the whole space of like the potential data that we could see. And then you can come up with like estimates based on that. At least that's like the idea that we had.

21:01 I don't know how far we can take that idea to see if it's going to succeed or not. Thank you. I would love to do. Any more questions for Vaastav? Let's thank the speaker one more time.