HotCarbon 2023

Reducing the Carbon Impact of Generative AI Inference (today and in 2035)

Andrew A. Chien (University of Chicago and Argonne National Laboratory); Liuzixuan Lin, Hai Nguyen, Varsha Rao, Tristan Sharma, Rajini Wijayawardana (University of Chicago)

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 Hi everyone. Today we'll be talking about reducing the carbon impact of generative AI inference today and in the future. And this is a work jointly done by Professor Andrew Chien who's here and Rajini and also Peter Lin, Hai Nguyen, and Tristan Sharma who are UChicago students. So some of the contributions of our research are that we developed a workload model which captures today's emissions, which is like March 2023's carbon emissions. And then also we evaluated some of the geographical request direction algorithms which can reduce the carbon emission for today and again in the future. And we found that increasing the headroom in the future would further decrease the carbon emission. And what is the motivation of this research? First there are like 5.3 billion internet users in the world today that is like 66% of stage of the world population.

1:03 And with chat GPT integration into the integrating into the search engines or generative AI applications basically the compute cost for search would increase by five times. This would also mean that the inference cost would scale with the billions of users and the focus has to shift from like training cost to the inference cost. And Bloomberg has predicted that going forward in the future there would be like a 92 times increase in the generative AI revenue which means that the usage increases and compute cost increases and power consumption increases. But the most concerning is the carbon emissions will also increase. So what do we do about these emissions now? So we ask these following research questions. What first one is like what is the temporal and the spatial structure of these generative AI applications look like?

1:57 And for that we characterize chat GPT's workload model based on compute per request, latency requirements, location of users. And second we ask what is its carbon impact for that we do an estimation of their carbon emissions. And after estimating the carbon emissions we would also like to reduce it. So how can we reduce it? For that we look into geographic research direction, request direction algorithms which can shift the load to low carbon regions. Now first is like why do we have to build this model? So we want to build this model because the LLM models or the large language models which are behind of these generative AI applications, we don't have complete information about them. So instead we estimate and do the modeling. So our workload model is for chat GPT. It's based on the chat GPT visits in the March which is like 1.6 billion.

2:52 And then we also model it for the countries which are densely populated. And the second one we also want to measure its user response latency which we model it for like eight different cities across US, Europe, and Asia. And prompts we consider we engineer prompts of varying complexity.

3:12 So this is the present load model and here again like we are using chat GPT as an exemplar and we see that the chat GPT load is predominantly human generated which means it has a diurnal structure and we also incorporate the diurnal structure in our model from the waking hours. And second for the present load we also use like the chat GPT use and the population. And for the future load we considered Google search and we find that the Google the load increases by 55 times. But we consider Google search because it's also an exemplar of widely used application. Now going to the next one. How does the inference cost compare with its training cost? And we estimate the inference cost and the training cost and using certain assumptions where there are more details which you can find in the paper.

4:06 But the overall point we find that the inference cost is like 25 times higher than the training cost. And there needs to be a shift in focus to the inference cost if we want to reduce the emissions. So we also want to characterize the inference workload. So we study the response size versus prompt size and we find that they are uncorrelated or weakly correlated and we find that it's not easy to estimate the or predict the request compute cost from the prompt size. Rather request compute cost is more related to the response size. And second we find that the use user response latency is proportional to the response size. And the second one is we want to understand how does the user response latency look like across various locations. So for that again we measured the less response latency for different locations. And we find that the response latency has a weak correlation across locations and it varies by locations and it depends on the output complexity. So the final point is like insight is that the inference workload is latency tolerant. And if we want to reduce the carbon cost this is useful. And the carbon cost of the inference depends on where and when it is served. And for that we need to understand how the renewable

5:39 energy generation variations work. It depends on the power grid variations which vary across time and space. It has temporal and spatial variation. In this example, California is the low carbon region during the daytime and during the night time. It's California and Texas are the low carbon regions. Now I would give it over to Rajini to talk about the geographic request direction algorithms.

6:09 We have shown that generative AI serving is a suitable candidate for geographic load shifting since its latency is weakly correlated with client location. Okay so in line with that we introduce a variety of request direction algorithms focused on hardware utilization and carbon reduction. When a compute region receives a user's request it can either be processed locally or sent to another compute region. And the choice of this region can be made on multiple criteria. In the balanced algorithm requests are directed proportional to the available resources producing equal utilization across all regions. In CarbonMin that we propose, when a user sends an inference request to the nearest cloud region, it is directed to the region with the lowest carbon intensity intensity that has available capacity. But request direction in CarbonMin is constrained by available resource capacity. And we consider the case of unlimited capacity in CarbonMin unlimited.

7:06 We model a cloud platform with eight regions in distinct geographies powered by different grids. The emissions produced by serving the inference workload at each region is determined by the average carbon intensity of the corresponding grid. We obtain hourly ACI values from the repeat project and electricity maps. Based on the average utilization of production workloads, we model an average 30% of available resource capacity at each data center that can be used for serving inferences. And we model the consequent carbon emissions for inference serving as the sum of operational and embodied carbon for A100 hardware. More details on the carbon modeling is in our paper. Next, we evaluate these algorithms for their effectiveness in reducing emissions and maintaining user responsiveness. If we take no action today, the annual carbon cost of serving ChatGPT at the current global ACI rate is substantial, producing the equivalent emissions of 2,500 US homes electricity use annually. Looking at the locations that the workload is served from, local and balance schemes serve larger fractions of the request at high carbon regions, indicated by the brownish shades in the plot. In contrast, CarbonMin directs a higher fraction of request to lower emissions locations, California and the UK. And CarbonMin unlimited does even better with the removal of the resource capacity constraint and directs load to the greenest

8:30 location, which is the UK today. Our results show that the CarbonMin scheme consistently reduces emissions by 35% on average compared to inference serving at the global ACI. CarbonMin unlimited by eliminating the available resource capacity constraint directs load to the greenest region, giving a 63% carbon reduction. We then analyze whether these request direction algorithms can maintain the expected user response latency for inferences which we have characterized previously. Request direction in CarbonMin has an associated cost in terms of latency. However, the average increase in latency is always less than 1.5% over the baseline of local serving. Since computation time for inference dominates the network latency between regions, the impact to user response latency from request direction is negligible. Looking forward to the future of generative AI serving, we expect changes on multiple fronts. Next, we evaluate how these changes will affect the outcome of request direction. Greater use of generative AI-backed applications will lead to an explosive growth in the workload. Modeling the future workload based on Google visits, the inference workload would grow 55 times by 2035. With the slowing yet continuing improvements in hardware, the per inference energy efficiency is expected to improve 10x in the next 10 years.

9:57 And apart from the workload and hardware, power grids too will see significant change with two to three times lower ACI. To model the future grid ACI, we obtained detailed generation history and scaled up wind and solar generation to match public renewable portfolio standard goals. In 2035, if we take no action for carbon reduction of generative AI, the 55 times increase in the workload, offset by the grid decarbonization and advanced computing technology, would still produce a 2.6 times increase in emissions compared to 2022 emissions from inference serving. CarbonMin mitigates the overall emissions to 1.2 times of this. However, resource capacity constraints limit the potential carbon benefits. With unlimited capacity, the overall emissions can be brought down to 0.4x. These reductions in emissions are possible because CarbonMin effectively selects Germany, UK, Ireland and California, which will have greener grids by 2035.

11:00 Geographic request direction is constrained by available capacity. What would happen if we have higher capacity data centers and how much capacity would be enough? In addition to the average 30% available capacity in the CarbonMin baseline, we consider adding headroom capacity to the data centers with older and used hardware. While most of the carbon benefit is achieved with only this 30% available capacity, 100% headroom further reduces emissions from 56% to 71%, a smaller per unit reduction in comparison, and adding further headroom gives very little benefit. This is because adding more hardware as headroom introduces embodied emissions at a higher rate than the amount that is offset by the reduction in operational emissions. On to the conclusions. The inference cost of generative AI dominates its training cost. If we are to control its environmental impact, our attention is necessary on inference serving.

11:58 We developed a workload model and we show that generative AI inference is latency tolerant, making it a suitable candidate for geographic request direction. We have then shown that these emissions are reduced by CarbonMin tied to grid carbon information. In the future, the workload from generative AI will grow rapidly. Even with grid decarbonization and hardware advancements, its carbon impact would still be substantial. Therefore, CarbonMin request direction can be an important way to reduce emissions in the future as well. And finally, we show that the potential carbon benefit is constrained by available resource capacity and can be further reduced by adding headroom capacity, but with diminishing per unit benefit. And this brings us to the end of our presentation. Thank you so much. And we'd be happy to answer the questions. Okay, so we have time. We have time for a few questions. Can you just go to the previous slides just to reflect? That's a lot on that slide. On the conclusion. Other conclusions? You have a question? No, no, no. Just wanted to do a little more.

13:23 Thank you. So my question is, you mentioned that your work increases the user's latency by an average of 1.5%. What about the tail latency like the P99 quantile? We have measured the average round trip latency that we have considered. We have not measured the P99. Oh, okay. So there might be some cases where you cannot ship them to a greener region

14:05 because their quality of service needs to be constrained within some threshold, right? Yes, of course. But what we found was that the computation time of inference is so much greater than the round trip latency is between regions. It's in the scale of milliseconds while the computation is in seconds. So it's always going to be like, in our results, we found that it's always going to be 1.5% less.

14:38 I see. All right. Thank you. Yeah, I think it's a really good question because you just nailed why this work is really specific to AI inference. You can't do it with any workload, but you can do it with AI inference because in any case, the computation takes some time. So this is really, really interesting work. I just want to make sure, I think, can you go back a few slides where you compared to Google? Like there was like a, there was like a table that said that here's ChatGPT, here's Google. I want to understand a little bit about what those multipliers are, because I think it's a really interesting data point if that's what I think it is.

15:18 It was kind of early on and yeah. So what do you mean by inference divided by training for Google-RR? Like what exactly is that measuring? Oh, so it's just for comparison. We want to understand how would, how much would the inference cost compared to a single training cost would be. And so what is, what is the model for Google-RR? So it's, it's similar to the ChatGPT one, but instead of using the ChatGPT usage percentage or like allocating to the number of requests there, we are using Google search visits, the total number of Google search visits. So that is why still the shape remains same. The number of requests would increase by 55 times. Got it. Got it. Got it. Good. So your 25 for your 25 X numbers with current usage of ChatGPT.

16:06 And this is if it, if ChatGPT magically replaced Google, uh, this is what the, okay, good. Okay. Perfect. But it's just for comparison. That wouldn't factor in retraining. So, you know, that retraining, once the model is deployed, they have to continuously retrain it. Yes. So we are not saying, because we don't know how many times a model, this model is going to be retrained. We have no information on that. It is just for comparison, how much it would be costing in compared to a single training cost. So there are kinds of questions here, right? Yeah. Yeah. All right. You go. Oh, you asked. Oh, oh, I asked your first question. Okay. Great. Sorry about that. Any question here?

16:53 I think you addressed kind of like my question, but still, I think it is important to like have these details about how many times these models are actually trained during training, because all of the papers generally report one time training results. And, uh, there is literally no, um, visibility into how many times they are actually trained. And another way to think of this is kind of like training is basically the embodied of inference or like, if I am using my embodied carbon is the, what went into training and operational is basically, however much is consumed by the inference. So that is why like just having a single training values are not important, but overall how much was considered. So I would say that embodied carbon cost, it's also included here, but there's also some operational cost, even for training. There is an energy consumption, right? For training, the operational cost of training, uh, model is embodied for inference. It's just a way of looking at it.

18:03 Yes. But how like we are saying that the inference cost is going to be higher because the usage is increasing earlier. There was like generative AI was not integrating so much in our everyday applications and all that, but now the usage would be increasing. So the inference cost is going to be higher. That's the point.