iTranslated by AI
re:Invent 2025: Building AI at Scale with AWS AI Infrastructure - GPU Management, LLM Optimization, and Inference Best Practices
Introduction
By transcribing various overseas lectures into Japanese articles, we aim to make hidden, high-quality information more accessible. This project focuses on the following presentation!
For transcription articles from re:Invent 2025, please check the information summarized in this Spreadsheet.
📖 re:Invent 2025: AWS re:Invent 2025 - How customers build AI at scale with AWS AI infrastructure (AIM252)
In this session, three experts share practical insights on scaling AI applications using AWS infrastructure. Andrea Klein from ARM explains best practices for fault detection, observability tools, and cluster management using Kubernetes when managing over 1,000 GPUs. Henri Dwyer from Genentech introduces hardware fault countermeasures for training 7 billion to 70 billion parameter LLMs, networking optimization, and specific improvement methods that boosted GPU utilization from the 60% range to the 90% range. Shaunak Godbole from Fireworks AI details optimization principles from the hardware layer to the runtime layer, covering prompt caching, session affinity, and cross-region serving for an inference stack processing over 13 trillion tokens per day.
Note: This article is automatically generated while maintaining the content of the existing lecture as much as possible. Please be aware that there may be typos or incorrect information.
Main Content
Overview of the AI Infrastructure Optimization Session and Panelist Introduction
Hello everyone. Thank you for taking time out of your busy schedules to join this customer panel today. We have prepared an exciting session that is highly relevant to what you heard in the morning keynote. Has anyone seen Matt's keynote this morning? Fantastic. Then you must have heard about AI infrastructure optimization, the AI Factory, the launch of Trainium 3 now generally available, and further details on ultra clusters and ultra servers.
Today, we are joined by distinguished panelists: Andrea Klein, Engineering Director at ARM; Henri Dwyer, Senior Director of Engineering at Genentech, a member of the Roche Group; and Shaunak Godbole, Field CTO at Fireworks AI. The takeaway we want you to have from this session includes practical tips, tricks, and mechanisms for scaling AI applications using AWS infrastructure and its stack.
There is a very effective framework for thinking about AI scaling. Our agenda for today starts with me explaining this framework. When we think about AI scaling, we consider it in terms of scaling up—that is, increasing T-flops, memory, and memory bandwidth—and scaling out—that is, increasing the number of GPUs, servers, ultra clusters, and the clusters themselves. We also consider scaling across the entire inference stack. Each of our panelists today will focus on a different aspect of this framework.
Andrea will talk about her experience with scaling out. She will cover fault detection, observability tools, and points to watch out for when scaling to thousands of GPUs and thousands of clusters. Henri will talk about scaling up. He is working on very interesting applications involving not just large language models, but also molecular dynamics including spatial coding. And he will conclude with what Genentech calls "lab in the loop" agentic AI.
This provides a good flow into Shaunak's session. He will talk about the principles for building agentic AI and optimization across all layers—hardware layer, model framework, and runtime layer—and how to achieve over 10 trillion tokens per day. Fireworks also has a booth, and Shaunak will be able to provide further details there.
Basic Concepts of Scaling Up and Scaling Out in AI and HPC
When thinking about scale-up and scale-out, two workloads come to mind. I work on accelerated computing every day and understand customer needs regarding AI and HPC. When considering AI as frontier models with over 100 billion parameters, a massive amount of compute is required. Even for smaller models sensitive to network latency, such as video or image models, scaling up and scaling out are necessary for inference. This is essential especially for aggregated batch-mode inference and real-time scenarios where latency is critical.
These models process vast petabytes of data and execute large-scale parallel computing and scientific calculations. That is why scaling on the infrastructure is important, and that is what our team at AWS discusses with customers every day. To introduce myself, I am a Principal Specialist for the Gen AI Accelerated Compute team. Everything related to accelerated compute at the hardware layer is handled through our team. Of course, we deal with Trainium and Inferentia, but we also handle NVIDIA GPUs and other GPUs daily.
HPC also has interesting characteristics. It has both tightly-coupled and loosely-coupled workloads. I have been fortunate to work in various domains. Henri will speak about his use case for protein folding. These use cases also lead to large-scale requirements. Diving deeper into one of the workloads, training workloads are typically episodic. They take anywhere from weeks to months but are tightly coupled. In reality, when customers request GPUs, they often request them within a single Availability Zone. In fact, they request a single spine. One of the reasons we introduced the UltraServers mentioned in the keynote is that even a single spine was not enough. We had to create high-performance domains for them.
However, customization is a bit different. These executions are short but very frequent, so they can run between one and four weeks, with 4 to 10 cycles per year. In many cases, because you can use heterogeneous compute, you might have P-series GPUs and G-series with CPUs. You need to think about how to scale up using containers. Andrea will likely have a word or two about how to scale up heterogeneous compute clusters using tools like AWS ParallelCluster or Amazon EKS.
Inference Workload Characteristics and Infrastructure Scaling Framework
Inference is completely different. It is often spiky and sporadic. Even batch-mode inference lasts for hours. For example, in document processing or summarization, these are often loosely-coupled workloads. Depending on whether it is real-time or batch-mode, you can have different latency requirements. Let's consider the mock example of a chatbot. This is a very simple chatbot example that generates one output token at a time. Of course, chatbots are more sophisticated now, but generally, the input token length remains on the higher side.
The first part, i.e., the encoding or prefill portion, is compute-bound. The intuitive thought here is to load hyperparameters from HBM memory. Depending on the prompt length, you can essentially execute the entire prompt calculation using those hyperparameters, so you are amortizing the one-time load operation across the entire large context length. Moving to the decoding portion, the intuitive thought is the same. We load hyperparameters again from HBM memory, but this time we are processing the output one token at a time. In other words, we are amortizing that load operation one token at a time. Of course, this is a simplified explanation. In reality, you can process many tokens at once, and in fact, Shaunak will talk about how he optimizes that at the runtime layer.
Think of memory capacity as inference. Some large-scale models like Llama 4 or DeepSeek require at least P5E, and without P5EN, i.e., our H200s, it is not possible. Therefore, memory capacity becomes important. However, even in the case of training, considering pipeline parallelism, if you are trying to compress a model into a single GPU and lack memory, you begin to enter pipeline parallelism. And the more pipeline parallelism there is, the less memory usage efficiency you have, so that also begins to negatively impact performance.
Especially mixture of expert (MoE) models, MoE models, mixture of agents, parts of multimodal models, video processing, and some of the large-scale frontier models are network-bound. We introduced 10P10U networking a few years ago. As the name implies, the goal is to provide dozens of petabytes of non-blocking bandwidth within 10 microseconds across tens of thousands of servers. This is what we use for UltraClusters, which I will explain shortly.
This is the framework I want to present. When scaling infrastructure up or scaling out, you can scale out. That is, you can add more servers, clusters, and UltraClusters. This is Andrea's topic. Or you can scale up. This is for when models are small, such as under 10 billion parameters, or even if you have larger models but want to homogenize procurement, if there is a specific cluster you are purchasing. This is Andre's domain. You can scale up and migrate from A100s to H100s, H200s, and now Blackwell. Or you can scale across. This is the inference stack, and it depends on what kind of models you have. Is it distributed high-performance inference on the right, or single-node GPU on the left?
I mentioned UltraClusters. In fact, when Trainium 3 was announced today, we also announced UltraCluster 3.0. Even UltraCluster 2.0 provides 60 bandwidth. This is our way of managing tens of thousands of GPUs or Trainium accelerators within a single high-speed domain. So, this becomes really important when scaling out to hundreds or thousands of GPUs. There is another paradigm called UltraServer. Last year, we heard how you can use UltraServers within a single high-speed domain of either 72 GPUs or 64 Trainium accelerators. And this morning, Matt announced Trainium 3. This is our way of packing 144 Trainium chips into a single high-speed domain, providing 5x performance per megawatt.
In terms of scaling, we have built a partnership with Nvidia for over 15 years. We have launched instances almost every year, and you can see that the pace has accelerated over the last 6 months. We announced the B300-based P6 a few weeks ago, which provides an incredible networking speed of 6.4 terabits per second and 270 gigabytes of memory per GPU. This is the largest and best GPU we have, but you can look and read the other specs as well. GP 200-based P6E, and many of you should also be using Hopper-based instances.
The stack consists of a hardware layer, which is the part our team at AWS mainly focuses on, but there are many other abstraction layers above the hardware layer. From the security hypervisor using Nitro, to storage, EFA networking, and managed services like SageMaker. This is the framework I want to set up, and from here, each speaker will talk about their experience with optimization. In fact, the best part of this session is that you can hear from them. We have also set aside time for Q&A, so if possible, I would like you to save your questions until later. First, I will proceed with the narrative, and then we will have time for Q&A to pass the microphone around and answer your questions.
Andrea Klein: Initial Planning and Procurement Strategy for Managing 1,000 GPUs
Next is Andrea. She is a Director at ARM and will talk about her experience. Hello, I'm Andrea. I'm here from ARM. I work with GPUs, and in the past, I've had experience working with even more GPUs at once. The following advice is targeted at those who are handling large amounts of GPUs for the first time. Maybe you've had a few servers and run some experiments, but 1,000 GPUs sounds like a lot, and you're not really sure what you should be doing, right? If you haven't budgeted for more than a few machines, you don't need to worry about most of this. On the other hand, if you've raised $1 to $10 billion in a seed round and are building pre-training clusters, this advice isn't for you.
I'm going to offer a lot of different suggestions. The basic idea is that there are certain problems that appear predictably at scale with GPUs, and 1,000 is the line where you can no longer ignore them. Somewhere between 1,000 and 10,000, all these problems occur, and then beyond that, exciting new problems emerge. I intend to ignore those. Don't worry. I'm going to solve all these problems in about 10 minutes, so if this is you, pay attention. For the sake of this, let's assume you are my target audience and you have money. Money is not an issue. You need to buy GPUs, and you need to manage them.
This is great. Congratulations. Now you have a GPU farm. However, you need to plan ahead and think about how you will handle them. Especially if you have worked with a few machines and think you know how to run GPUs and that everything will be fine, it is a bit harder than it looks. I think there are a few things you really need to pay attention to at this scale. The first thing is that because you are adding more GPUs, the problems that occur with GPUs will happen more frequently. You are likely adding more jobs and larger jobs too. Larger jobs are those that use more GPUs at once.
As jobs get larger or run for longer durations, problems happen more often. There is a higher chance that your workload will be interrupted and fail, and discovering and recovering from this quickly becomes crucial. At this scale, you likely have multiple different use cases. You might have multiple tenants or customers sharing capacity. The types of jobs might also be different. There might be training, inference, and other things going on. You might think you bought a lot of GPUs, but if you ask the users, you actually haven't bought that many. Very quickly, all the workloads will pile up, start requesting GPUs all at once, and you'll get into trouble.
The second point is that with this type of machine and at this scale, you are likely running some kind of distributed workload. It's probably distributed training, and in some cases, distributed or multi-node inference. You need to pay attention to the network and be mindful of optimization and failures in distributed jobs. Finally, as I mentioned, when you scale up, everything fails more frequently. Rare failures become constant failures.
You need to worry about this. However, it's not all bad. There are established ways to deal with machines at this scale. However, before talking about what to do with the machines, I want to consider the possibility that you haven't made purchasing decisions yet. It might be a scenario where you have money but don't have the GPUs yet. If you are in that situation and looking at many great slides showing many different types of GPUs and accelerated instances, it might feel overwhelming to decide what to pick.
There are a few rules of thumb that are helpful. One thing, which is obvious, is to try and put all your machines in one place. This is a bit difficult, especially when availability is limited. Someone might be able to provide a few machines on one coast immediately and a few in another location, but in that case, you will need a lot of work to manage them, and if the system is fragmented, utilization will likely be much lower. If you have a choice, especially with new GPUs, I recommend consolidating capacity into one place from the start or through pre-negotiation over time.
With modern GPUs, this doesn't just mean one region or one zone with one control plane. It means one physical UltraCluster build, or equivalently, one networking spine. Try to place the same type of machine in the same physical cluster with very fast interconnects in one location. Because you can choose from a wide range of instance types, it might be tempting to hyper-optimize machines for your workloads. Because you have many different workloads and have benchmarked them all, one is fast on one machine and another is fast on another.
However, if you are greedy to get capacity from wherever you can, you run the risk of the same fragmentation. If you try to get hyper-optimized machines for each workload, you might not have consistent traffic to keep all the machines busy all the time. I prefer what I call "workhorse machines." These are machines that are fast enough, of which you have many of the same kind, that can handle most of the traffic and can be kept busy at all times. If you manage this and choose to put all one or two accelerated instances in one place, there are many ways to manage capacity.
Kubernetes Cluster Configuration and Scheduling/Orchestration Practices
At this scale, you should think about running your own clusters, and it is a fairly safe recommendation that you should do so with Kubernetes. It is also fairly safe to say that for most use cases, there are no major downsides to using a managed Kubernetes service like Amazon EKS. There are exceptions, but fundamentally, you should have a reason for not using it, rather than a reason to justify it. This significantly simplifies cluster management.
There are good practices for setting up clusters, and we will look at an example diagram shortly. You should standardize your clusters. If all machines use the same version, all jobs can run on all machines, and they tend to have the same dependencies and the same failures. You should do something to deal with GPU failures, which I will talk about in more detail.
This is the diagram I promised, and this is just an example. Your setup might be a bit different, but there are a few points I want to draw your attention to. The first point is that the machines are all in one place, so there is only one account in this diagram. There is only one cluster, all machines are in one cluster, and this is very good.
The second point to note is that besides the built-in Kubernetes scheduler, there is a mysterious scheduling or orchestration component implicitly suggested within the cluster. There are many options, and we will look at some of them shortly, but especially for batch computing, it is widely accepted that Kubernetes is not going to have all the scheduling properties you need for AI workloads. You will likely layer something on top to manage how workloads are scheduled onto machines.
The third point to focus on is node pools. This is intentionally obscured. It might be autoscaling groups or some kind of managed node groups, but they are partitioned. Machines are not all in one giant pool. You probably have different labels and taints in Kubernetes, and workloads are directed to one node pool or another. There is also CPU-only capacity. Don't forget to budget for that. You will likely need it.
There are multiple types of GPUs. They are placed in different node pools and likely have different driver versions. In this scenario, multiple GPUs are procured for batch use cases. There are P5s and P6Es, and they are in different node pools, logically separated. Workloads either go to one or the other. If you end up combining real-time inference use cases and offline batch processing, there may be reasons for that, but in that case, you need to think about how you manage that.
To manage this, I think you should at least have some kind of logical barrier between real-time capacity and offline processing capacity. Finally, while I don't intend to give a sales pitch for specific storage technologies, planning your storage hierarchy will be a really important part of cluster planning. It is helpful that new GPU instances have an increasing amount of built-in SSDs in the form of NVMe, especially P5s and certainly P6Es. This is the first and best option for storage between training etc. It is very fast, essentially free, and built into the machine.
However, that is not a durable place to store anything you care about in the long term. So, you probably have other storage in the picture, holding long-term records of training data and checkpoints, or data your workload is processing while running in the cluster. Finally, what this implicitly suggests is that you need to budget for things other than GPUs. I pointed out that there are CPU-only machines, so don't forget these. There is storage. Don't forget to budget for storage. And finally, because these things communicate with each other, as long as all data is inside the cluster and never leaves, you might have some network traffic here. There is data flow coming in and out, so make sure you plan and budget for the network.
I mentioned scheduling and orchestration. You should probably create some options rather than just starting Kubernetes and deciding you're done. For batch jobs, there is a longer list of quality tools I could list, and anyone who says there is a perfect scheduler for every workload is a bit suspicious, as I don't want to sell a specific tool. You need to evaluate the scope for what you are doing. If you are hosting serving workloads, you are likely looking at a different toolset than someone doing primarily batch processing.
When considering options, especially at this scale—1,000 GPUs is not as many as it sounds—if the size of large jobs is about the same as the size of the cluster and there is no such thing as gang scheduling on Kubernetes, jobs will deadlock very quickly. You end up with two or three jobs half-started, nothing proceeds, and the entire system locks up. So, at this scale for this type of workload, you absolutely cannot ignore this.
In addition to scheduling, you need to worry a bit about resource management. There is certainly a range of workloads, and you will likely have multiple tenants competing for this capacity; really, all you can do is have the system execute some policy that everyone has agreed upon. The tool that makes scheduling decisions will likely have something to say about resource management decisions as well. So, when choosing that tool, you need to look at interest in both these properties.
Most of these are quite robust, but you should not only look at the documentation in principle to see how scheduling works and what promises it makes, but also ensure that the system can handle the expected load and traffic when it goes live. Because scheduling will become a single point of failure for the system. I would like to make a special mention of the GB200. When dealing with rack-scale capacity like the GB200 or the upcoming GB300, at this point, you really cannot avoid addressing topology in your scheduler choice. Some workloads might have some constraints; multi-node workloads might need to go to the same rack, or large training workloads might need to use multiple racks for training. And when choosing a scheduling component, you must choose one that allows you to express that in the way you hope.
Observability and Resource Management in Large GPU Clusters
Finally, observability. If you've spent all that money buying GPUs, you need to know what's happening with them. This is partly for your own sanity—to be able to tell if the system is working. It's partly for the sanity of your users, so they can tell if it's working and also how busy it is. And finally, it's for what I call the "powers that be"—the people who might have a financial interest in what you are doing with all that money and all those GPUs. By the time they come asking what your utilization looks like, ideally, you should already know.
I think there are specific things you should be monitoring in real-time and over the long term so that you can always have this information. You should know how much of your capacity looks like it's working, how much of that is being used by end-user workloads, and what kind of scheduling utilization you're getting. And depending on your use case, you should have some concept of live traffic to the system. The graph shown is like a batch system with queued and running jobs, which is also very interesting for people who want to know why their jobs are queued and if the queue is very long.
Over a longer period, not necessarily real-time but on a daily or weekly basis, you should track additional metrics to understand the system's performance and resource utilization patterns.
At this scale, I really recommend having some concept of how responsibly your end users are acting. It's a great idea to have a notion of workload efficiency, detecting workloads that are requesting GPUs they aren't using, running at very low average utilization, or being configured with really weird settings. This allows you to detect these issues earlier before they hurt your overall metrics. Finally, you need to know how compute time or cost is being spent across tenants or use cases within the system, and you should have some sort of monitoring or showback.
Henri Dwyer: Scaling Experience with "lab in the loop" AI at Genentech
Now, I'll hand it over to Henri, who will talk about his real-world experience in this domain. Hello, my name is Henri. I wish I had heard Andrea's talk a few years ago because I was the target audience. What I'm going to talk about is walking through the lessons learned scaling "lab in the loop" AI compute. First, let me start with a brief overview of what I'm talking about. I work in AI for drug discovery, and what we do is create machine learning models to design molecules. When we talk about "lab in the loop," what we essentially mean is starting with experimental data, training machine learning models on it, using those models to come up with, in our case, new potential molecules, then running experiments on those, getting new data, and ideally feeding that back into the model, and eventually iterating until you reach the level of molecular quality you want—or at least that's the dream.
On the right, this is an example of one class of molecules we've worked on called antibodies. We were optimizing across expression, ease of manufacturing, and affinity. Over successive rounds, you can see us pushing the Pareto frontier forward. This is what you want in this kind of process. For this to work, one of the things you need is a good machine learning model. Lately, having state-of-the-art models means training large models across multiple nodes. I'll focus on one type of model we've been working on, which are LLMs in the 7 to 70 billion parameter range. Maybe still call them large. A brief description of the infrastructure: we have GPUs on AWS ParallelCluster. This is one of the schedulers Andrea was talking about. And most of the long-term data storage is on Amazon S3.
By scaling up model size and compute, we faced all of the following challenges. The first challenge is hardware faults. If you're working on one machine, one node, or a few GPUs, you usually don't face this, but at scale, it's unavoidable. I think we faced this immediately when we were scaling across dozens of nodes. These are usually seen as training jobs crashing for unclear reasons. To solve this, what we did was test the nodes. There are various ways to do this. Ultimately, we run a very simple PyTorch script on new nodes to verify that GPUs can be used, load data onto the GPUs, run a simple calculation, and then remove the bad ones.
One trick that took some time here is that even if you evict a node, the same node might actually come back. This is especially likely if you start worrying about the second challenge: networking. Regarding networking, these are usually errors that are very difficult to debug. You rarely know the clear reason why a networking error occurred, and you can't even confirm it in logs. What we saw were mainly NCCL timeouts. What we found really useful was to avoid hops. If you can avoid traffic between zones or networks between spines, it's much more stable and performs better. But a single spine has limited capacity. That's why the problem of the same node coming back can occur. The final challenge is regarding model implementation, which is something you have full control over.
One strategy that was really helpful is to carefully test the various libraries used, including CUDA, EFA kernels, and NCCL OFI plugins, if you are using P-instances. These are all very fragile, so testing all versions to be run together and upgrading them all together significantly improves stability.
On the data-loading side, a common challenge is supplying data to the GPUs fast enough to get good utilization. This is the most common cause of bugs I see when machine learning scientists come to me with bad GPU efficiency. This is also a Python problem, because to load data quickly, you need multiple threads and multiple processes. This is notoriously tricky in Python, so spending a lot of time stress-testing data loaders is really useful.
On the checkpointing side, whatever you do, faults will occur for your model. Being able to create checkpoints and resume is important, and that really helps save wasted compute. Finally, when we started training larger models, we found that moving away from abstractions and libraries that wrap PyTorch to native PyTorch improved efficiency and stability.
Putting these into practice, here is a chart of GPU utilization. If you don't have the joy of looking at GPU utilization charts in your daily work, I'm sorry. They're quite fun, but what we're looking at here is essentially the Y-axis as the average GPU utilization percentage of an LLM training job. On the one on the left, we see some issues.
The first issue is that GPU utilization is low. We are in the mid-60 percent range, meaning if we're running on 100 GPUs, on average 35 to 40 GPUs are not utilized. Another issue is that we see these pauses where GPU utilization drops to zero every few tens of minutes. This is often a symptom of checkpoint processing, where everything stops, writes all weights to disk, and then resumes. Also, we see relatively short training runs on the order of a few hours because of stability issues.
By addressing the challenges mentioned in the previous slide and implementing some improvements—distributed checkpoint processing, investment in data loading, and shifting to fully sharded data parallel—we were able to significantly improve GPU utilization to the mid-90 percent range where it should be. This is the chart I want to show management to demonstrate how efficiently we are using GPUs, not the previous one.
Of course, just using GPUs is not enough. Using them in an effective way is really important. We run various types of computations, and here I show the two main ones. On the left is molecular dynamics simulation, showing the time it takes to generate a 1 nanosecond trajectory. Here, the shorter the time the better, so we want to reduce the time it takes to generate 1 nanosecond.
Interestingly, an L40S takes almost the same time as a B200 to run this computation. This is a single GPU. The L40S is relatively old in terms of GPU generation time—it's 3 years old—whereas the B200 is quite recent. So, if you have a lot of specific types of workloads, you should benchmark them and adjust your architecture for them to see if it's worth considering dedicated compute.
On the LLM training side, this is what we see with every release of new chips. We saw very similar results where tokens/second increased with newer GPUs. This is good. Summing it all up, thanks to our efforts in optimizing LLM training,
Agentic AI Building Principles and Model Selection Considerations
What we are working on now is the development of agents that understand intent. These agents are trained on all our internal data, so they understand drug discovery and our models. What we are aiming for is to have these agents be able to translate some requirements. In this example, we're citing a phase of drug discovery called lead optimization. Here we have a molecule and are trying to improve specific properties. The idea is that if you ask the agent if it can improve these properties, the agent can translate that into a workflow.
We run generative models and property prediction models. These can identify specific aspects of molecules and rank and filter them. Sometimes we run a few loops, and eventually, we can send it to a wet lab for synthesis and compare the predicted output with the actual output. For the agentic loop to work, you need to deploy all the models. We use Kubernetes to run them and some agentic frameworks to tie them together. This is how we are trying to accelerate the drug discovery process and improve the success rate of R&D.
Thank you, Andre. As Henri was explaining, the most successful agents built are those built using models trained on data that the company possesses. That is what I am going to talk about. We call it artificial autonomous intelligence. This essentially means that since you own the data, you should also own the model and the deployment. I am Shaunak Godbole, Field CTO at Fireworks AI. We specialize in the inference and training of many open models. I think 2025 is the year of agents.
Almost everyone should have used at least one of these agents, especially Cursor or Sourcegraph. They are all in the coding field. There are many in the document processing field. We are seeing many companies appearing that are doing legal processing, healthcare processing, FSNI, and so on. Everyone is building one of these types of agents. The agents at the top are some of the ones that have really garnered attention this year, but we actually feel and observe that many more are being built, and we feel that these will become the agents that become more prevalent this year as well.
When we think about agents, there are two main principles we consider. Both of these principles are based on the fact that your data is your most valuable asset. Generally available models do not match the data existing in a company. In particular, they are trained on public data or trained on data synthetically generated by a few companies. We realized the first principle: do not treat models as commodities. Your model is your product. It needs to be built using a data flywheel. Andre showed a great example of how they built their model by iteratively training on the data flywheel they have and continuously improving the model.
The second principle is that your model is your intellectual property. Your model and your product need to work together to provide the best user experience to your users. The overarching principle is that your model and product should coexist, and your model is your intellectual property. Do not treat it as a commodity. When you think about models, when you think about this infrastructure, when you think about where LLMs are, there really are a lot of choices.
Whether it's related to models or infrastructure, you can make various types of choices. Models are now available in different types of modalities. We have text, images, image generation, video generation, embeddings, and many others. Different model providers have different areas of expertise. There are Amazon, Meta, Deepseek, and Alibaba's Qwen. They are all showing signs of catching up to the proprietary or frontier models we see today. Also, there are many model sizes. Here I am specifically talking about LLMs, or large language models. These range from 1B upwards, and some embedding models are even smaller. Up to 1 trillion, which is the latest model from a company called Kimi, roughly 1 trillion parameters in length.
After selecting a model, the next consideration is model alignment based on the data you have. Here, too, there are many choices. The first is supervised fine-tuning, where you give the model a few examples to align it. Then there is DPO, where you give positive and negative samples. Next is fine-tuning via reinforcement learning, where you have a reward function and try to align the model based on the data you have. The last one is what almost every frontier lab and open model company actually uses to improve model quality, because it is cheaper and provides really good results.
Next is the issue of serving these models and inference infrastructure. There are many trade-offs here. Usually, there are three things. Inference can be better, can be faster, and can be cheaper. Most companies have one or two options, and we can talk about whether you can actually make trade-offs for all three options. Next is security constraints, whether this model and deployment should be SaaS-based, run in your own private VPC, run on-premise, whether you have legal approval to use the models, and whether these models have been appropriately penetration tested.
Shaunak Godbole: Inference Infrastructure Optimization and Fireworks AI Practice Example
Let's move on to the next topic: inference infrastructure. Andrea covered that there are different types of serving stacks for inference infrastructure, one for batch jobs and one for real-time jobs. The next slide talks about how to think about which one to use if you have your own deployment. The first thing is choosing the hardware. There really are many choices. There is accelerated compute via GPUs provided by AWS and Nvidia. There are things called Ampere series, Hopper series, and Blackwell series, and as of today, there is also Trainium 3 for Trainium. All these hardware options have different trade-offs. Some have a massive amount of FLOPs, some have a lot of memory per GPU, and some have really good GPU-to-GPU connectivity.
Once you've chosen your hardware and hardware provider, you need to start thinking about inference engine optimization. Usually, there are a few choices, and I have listed the most common ones here. However, there are many more. Usually, you think about model sharding. If a model is very large and doesn't fit on a single GPU, you need to shard it across different GPUs. Next, there is disaggregated serving. This is the separation of the two phases of generation, the prefill and the generation step. These techniques are very common. They are used especially in generative AI systems where the input is very long but the output is structured and very short JSON output.
Next, you think about which inference kernels to use. There are many choices. TensorRT-LLM does a great job, and Nvidia does a great job providing many inference kernels. vLLM and SGLang are all creating flash infer and flash attention and are achieving very good results. Next, you think about cross-shard serving. What if a model is very large and doesn't fit on a single shard?
If a model is very large and doesn't fit on a single GPU machine, you need to shard the model across different types of hosts. If you do that, you need really good communication. Amazon provides EFA, and the transfer speed of KV cache from one machine to another is very fast, which is essential for faster generation and higher throughput. Speculative decoding is one of the most commonly used techniques, where you can train a very small model to guess, and the larger model just checks if the generated tokens are actually correct instead of generating them itself.
Once you finalize your inference engine options, you move on to the serving stack. Andrea already covered a lot about horizontal scaling in her Kubernetes talk, but I'll go a bit deeper into details specific to inference. There is prompt caching. This is one of the most commonly used techniques right now, used when the same system prompt is used. What kind of system is served by the inference engine, and you can use prompt caching.
Next is session affinity. This is very useful if you have coding-type agents you are building or using. It ensures the same request is sent to the same machine. In these types of cases, machine reliability is very important. Therefore, using something like Amazon EKS, which is actually managed by Amazon, is very important because it is highly reliable and highly available. By doing so, failures related to dropped session affinity or prompt cache are significantly reduced. Next, request failover and load shedding. These are usually cases when you have traffic spikes or want to failover to another region.
Once you choose your serving stack, you need to move to global secure serving. Andrea talked a bit about trying to concentrate GPUs in a single region, but sometimes that's impossible, or you might need cross-region traffic. Or you might need regionality. In such cases, you use global secure serving. You need some kind of global scheduling. You need a private VPC for secure serving. You might want to do things like PrivateLink. By doing so, you can ensure that data never crosses the VPC boundary. All of this is provided through Amazon's ELB system or Amazon's PrivateLink, and we are seeing a lot of adoption of secure and compliant infrastructure here.
This was a very high-level overview of the inference stack. This is the inference stack we actually built, taking all of this into account. Today, Fireworks processes about 150,000 requests per second. We process over 13 trillion tokens a day. We have many models across different modalities and host them in a private secure cloud. We have a booth, booth number 1588. So, if you want to know more about this, please come to our booth and talk to us.
Thank you. Please prepare plenty of questions. We are really looking forward to getting the best questions from you. Please fill out the survey in the app. This is really helpful in raising the bar for future events. The more people who fill out the survey, the better the data we have to grasp what worked, what didn't work, and what needs improvement. So, any questions? Do you have any burning questions about how to scale AI?
- This article was automatically generated using Amazon Bedrock while maintaining the original video information as much as possible.
































Discussion