In short
```markdown
TWIML AI Podcast Episode #720
Accelerating AI Training and Inference with AWS Trainium2
Host: Sam Charrington Guest: Ron Diamant, Chief Architect for Trainium at Amazon Web Services (AWS)
Episode Overview In this episode, Sam Charrington speaks with Ron Diamant about the recent advancements in AI hardware acceleration through the AWS Trainium2 chip. The discussion includes architectural comparisons between Trainium and GPUs, the tooling ecosystem for Trainium, various deployment options, and performance benchmarks related to AI model training and inference.
Key Themes and Concepts
- Background and Introduction to Trainium
- Ron Diamant has been with AWS since the acquisition of Annapurna Labs in 2011, contributing to several major product lines including Nitro, Graviton, and Trainium.
- Trainium and its architecture are designed specifically for AI/ML workloads, focusing on efficiency and performance for training frontier models.
- Architectural Differences: Trainium vs. GPUs
- Trainium:
- Uses a systolic array-based compute design.
- Optimized for data reuse and energy efficiency, enhancing compute performance.
- GPUs:
- Typically employ massively parallel architectures with thousands of cores executing the same instruction.
- Differences in performance optimizations and workload handling.
- Performance Metrics
- Trainium2 provides significant performance advantages:
- 21 petaflops of dense compute performance, 83 petaflops of sparse compute performance (4x higher than traditional solutions).
- 46 terabytes per second of HBM bandwidth, nearly double the next competitor.
- Effective memory and compute utilization rates exceeding 60% in real workloads.
- Tooling Ecosystem
- Neuron SDK: Software development kit for deploying models on Trainium.
- Neuron Compiler: Maps higher-level frameworks (like PyTorch) to the instruction set of Trainium.
- Neuron Kernel Interface (NKI): Provides low-level access for experts to optimize performance, akin to CUDA.
- Deployment Options
- TRN2 Instances: Servers that integrate Trainium chips for scalable AI workloads.
- UltraServers and UltraClusters: Offer increased performance through tightly integrated multi-server configurations, suitable for large-scale AI tasks.
- Uses AWS Bedrock and other managed services to simplify integration.
- Sparsity and Efficient Training
- Trainium2's architecture supports 4 to 16 sparsity, significantly improving performance while reducing compute and energy costs.
- Sparsity allows for more compact models without sacrificing accuracy, beneficial for both training and inference applications.
- Customer Adoption and Case Studies
- Customers like Anthropic are building large-scale training clusters with Trainium, aiming to train advanced AI models.
- Notable collaborations include work with Adobe, Poolside, and Databricks to optimize models for Trainium.
- Future Directions
- Trainium3 development is already in progress, focusing on tighter collaboration with leading AI labs to address next-generation model architectures.
- Anticipated improvements in compute efficiency, specialized optimizations, and support for emerging AI workloads.
Conclusion The episode highlights the pivotal role of specialized hardware like AWS Trainium2 in advancing AI training and inference capabilities. Ron Diamant's insights reflect a strategic focus on optimizing the architectural design to meet the evolving needs of AI researchers and developers, ensuring that Trainium remains at the forefront of AI hardware innovation.
For more details, refer to the complete show notes: [TWIML AI Podcast Show Notes](https://twimlai.com/go/720). ```
Written by AI. May contain mistakes. Listen to the episode to check what was said.
Transcript
Automatic transcript. May contain errors.0:00So, Antropic is an amazing customer to work with Project Rainier. we're building a gigantic training cluster that fully embraces the scaling laws. That cluster will have many hundreds of thousands of training to devices. That cluster is at least 5x larger than Anthropic's previous training cluster. And they're planning to train the largest and most intelligent frontier model on top of that cluster.
0:42All right, everyone. Welcome to another episode of the TwiML AI podcast. I am your host, Sam Charrington. Today, I'm joined by Ron Diamant. Ron is Chief Architect for Tranium at Amazon Web Services. Ron, welcome to the podcast. Thanks for having me, Sam. I'm super excited to have you on the show. I'm looking forward to our chat. You joined AWS as part of the Annapurna Labs acquisition, and we're connecting at a pretty big moment for the Annapurna team, including the 10th anniversary of that acquisition, the Tranium 2 launch at last year's reInvent, and some pretty big customer announcements with Apple and Anthropic.
1:19We'll be digging into all of these and more, and I'd love to have you get us started by sharing a bit about your background. Sure, yes. So first of all, thanks again for having me today. I joined Annapurna Labs in 2011, just a few weeks after it was founded, very early on. And since then, I've been fortunate to participate in all of the different product lines that we built in Annapurna Labs. That includes Nitro, where we basically offloaded the hypervisor from the host CPU to dedicated chips. And we reinvented how virtualization in the cloud happens. Then we built Graviton, our host CPUs that are ARM-based and provide the best performance and price performance in the cloud for a variety of cloud workloads.
2:07And in the past eight years or so, I've been running the architecture team for Trainium, where we build dedicated, highly performant and highly efficient AI ML accelerators for deep learning workloads and the training of frontier models. I was at the reInvent when those first chips were announced and even when the acquisition was announced. And it's hard to believe that it's been 10 years already. We've been amazingly lucky to get acquired by AWS and get integrated into that team. I can tell you personally that this is the second acquisition that I've been through in my career. And the first acquisition, I won't mention the names, but it wasn't as smooth as Anapurna Labs and AWS.
3:00But AWS's culture is like a sea of startups. And the startups are, on the one hand, very autonomous and progressing to their roadmaps and milestones with minimum dependencies on other teams. But on the other hand, they share roadmaps and share information extremely collaboratively and openly. So it's been a blast for us at Annapurna building chips for internal customers in AWS that tell us exactly where the pain points are and what they're trying to achieve. And at the same time, keeping our startup culture and moving very quickly to build devices and solutions in new grounds. So how many chips has it been all told since the acquisition?
3:47So since the acquisition, it's been a decade and we've built more than 10 chips, so more than a chip per year. It's across three product lines, as I mentioned before, Nitro, Graviton and Tranium. And each one of these product lines is shipping in many millions and in some cases, tens of millions of parts. and almost all of our chips got to these volumes in the very first tape out, which is quite unique in the semiconductor industry. Tape out is like when a design is released to manufacturing? Oh yeah, exactly. Yes, that's what it is. And in the chip world, we basically work extremely hard before we release the design to manufacturing because at that point you trigger an activity, the manufacturing activity that costs tens of millions of dollars.
4:35So we work extremely hard to make sure that the device is healthy and well tested and can support scaling into volumes before we trigger manufacturing. One of the things that's always struck me in my conversations with folks about hardware in general and chips in particular is really as a result of those lead times being so long and how important it is to, you know, get a lot of things right, kind of catch the market. And we've seen kind of waves of accelerator startups come over the past, you know, 10 years or more. And it strikes me that we're in a really interesting point in time right now because we're finally seeing like a convergence or, you know, critical mass at scale of a particular type of workload in the form of LLMs and transformers.
5:29Whereas before, it struck me that there were a lot of companies trying to innovate around a more generalized, you know, work set of workloads in deep learning. You know, so some folks would specialize on convolutional architectures, but there wasn't enough volume there to really, you know, scale it the way we're seeing with LLMs. Does that resonate with you, first of all? And then, like, how do you think about, you know, what you're doing there in that context? It absolutely does. So I think we're seeing the convergence of two market forces roughly at the same time. So first of all, the transformer architecture took the industry by storm.
6:14And many, many workloads are mapping towards some variance of the transformer architecture, which means that we can dedicate our efforts more towards optimizing that architecture as long as we keep enough generality. And we should probably touch on that more as we talk through the details. But the other force that we're seeing across the industry is the force of scaling laws. So we now have about a decade or slightly more than a decade where the scaling laws are empirically proving themselves again and again. And what the scaling laws mean is that the more compute we put into training of a model, the better intelligence or accuracy we get on the other side.
7:00Now, if I think about the convergent of these two forces, it means that there are a few companies out there or a few players out there that are spending a lot of compute in order to train frontier models. And most of them are deploying some form of a transformer architecture with a few tweaks. Everyone has their own secret sauce. Now, what that means is that instead of kind of spreading our efforts in supporting a wide variety of workloads, we can dedicate our efforts, our engineering efforts, into being extremely efficient in these massive scale workloads. And by doing that, we can enable the folks that are training for frontier models to be even more efficient in their deployments and thus spend more compute during training and get more intelligent models overall.
7:59Now, I'm simplifying things to some extent here because the last thing that I think we want to do is build a chip that can only do Transformer. I don't think that's wise by any stretch of the imagination because new innovation will come through and none of us can anticipate what new operators will get invented in the next couple of years. But we can focus our engineering efforts where it matters the most because the majority of the industry is driven by a few workloads and not thousands of workloads. And so when you think about architecting a chip, how do you balance, you know, where the workload is today, projecting forward into time to where the workload and the customer will be tomorrow and manage the requirements for the chip that you're trying to build?
8:50Yeah, definitely. So I think we start from a concept that may sound very simple, but I think it's very powerful. It's actually a quote from Jeff Bezos from back in the days where people spend a lot of time trying to anticipate how the world is going to change in the next five years, but they don't spend enough time thinking about what's not going to change in the next five years. And I think it's quite powerful to think about what's actually not going to change. So, for example, we know that folks are going to want more compute performance. We know that they're going to want better cost structures.
9:29We know that power efficiency is going to be a big deal in training and in ML in general. And we also know that folks will want the flexibility to innovate on top of our platform because they don't want to be confined to just one or five workloads, but rather they want the ability to invent the new secret sauce that will make their models perform better than others. So the first thing that we do is to make sure that we keep our design very efficient across these different dimensions. And we can go on a very long tangent on what each of these dimensions mean, but I'll try to keep it short. For example, performance doesn't only mean compute performance.
10:20Performance is actually driven by quite a few dimensions of the design. So by getting to know the workload, we see that some workloads are dominated or bound by our compute performance. So we make sure to pack a lot of compute in our chips. But other workloads are bound by memory bandwidth. For example, when we interact with a chatbot, it processes your input request, your prompt, and that portion tends to be very compute bound. But after that, it enters what we call an autoregressive stage, where it generates one token or one word after the other. And that portion of the workload tends to be very memory bandwidth bound.
11:04So we pack a lot of memory bandwidth into our chips. We also pack a lot of memory capacity and a lot of network bandwidth into our chips because other workloads, and I'll kind of skip through the details for now, other workloads tend to be either memory capacity bound or network bound. So we make sure that we balance the design across all these dimensions. But then there's also a second level of design considerations that is probably what you were referring to with your question, which is what actual building blocks do we put into our chips? And it's funny because for the very first chip that we built, we started building it before transformers existed.
11:51So we didn't even know about the building blocks of a transformer when we designed that chip. But what we did do back in the days is to break a set of popular workloads into primitives and then the first goal or the first attempt was to make sure that we support all the different primitives that serve as building blocks to supporting all these different workloads but then the second step after that was to kind of zoom out and try to generalize each one of these primitives such that if any new operator will get invented there will be a high chance that our generalized primitives would be able to support it.
12:32And then what we do after that, just two more sentences on this topic. What we do after that is we take a few workloads that we didn't see before and test our hypothesis on these workloads. We basically try to see whether, for example, if we design the chip to support language workloads and vision workloads, we test ourselves on an audio workload. and we try to see whether new kernels emerge that we don't support yet or we actually support our generalized set of kernels do support all the different workloads. And one of our kind of fun experiences during the design of Tranium is that when we were building the first chip, which was named Inferentia back in the days, as I said, transformer didn't exist.
13:20And when the transformer paper came out, We basically mapped it to our generalized set of kernels. We saw that it's fully supported by the building blocks that we designed. And it was actually more performant than other workloads that we designed before and that we designed the building blocks based on. So that was a happy moment during the growth of this training architecture that we've been working on. How should we think about what is a kernel in this context? Is it a set of functionality for common operations like multiply, add, accumulate, that kind of thing? Or is it a higher level abstraction?
13:58That's a good question. I actually tend to intermix three terms and we might want to distinguish between them a little bit. One term is what we call an instruction. Then there's another term that is an operator. And the third term is a kernel. And so as a hardware architect, we care a lot about, or I care a lot about the instruction set architecture. These are basically the building blocks of the hardware, or you can think about it as the software hardware contract. This could be a matrix multiplication or a nonlinear activation function, or maybe addition of two tensors to one another. So that's the language that the hardware operates with.
14:51And any software that operates the hardware needs to map higher level workloads to that instruction set, that language. Then an operator is a framework level computation that is agnostic of the hardware underneath it. So that could be a layer normalization operator, a fully connected operator, which is a matrix multiplication followed by a nonlinear activation layer. And there's a bunch of other operators. And a kernel tends to be the mapping between an operator and the instruction set. So a kernel basically is a function that a software programmer wrote that implements an operator or a set of operators and maps them to the instruction set of the hardware.
15:44So maybe before we go further, talk a little bit about the Tranium architecture as a whole relative to GPUs and where are the similarities and distinctions? Yeah, definitely. So Tranium is a different architecture from a GPU, and I'll touch on the differences in a second, but we also see some form of convergence between the two architectures. So it would be interesting to compare and contrast there. So to begin with, a GPU architecture is a massively parallel architecture where we have thousands of different cores that are working together to run the same program. The programming model is typically called SIMD, a single instruction, multiple data.
16:37Basically, we have a single instruction set that is running on multiple cores, and each core is processing a different portion of the data. The training architecture is built around a small number of very powerful cores and very power-efficient cores. We built them around what we call a systolic array, which is a hardware architecture that optimizes for data reuse and energy efficiency, such that we read the data into one set of compute elements. They perform a computation and move the data to the next set of compute elements. so it minimizes the amount of memory touches that we need to do when running a workload on Tranium and that in turn improves the energy efficiency quite dramatically.
17:35Now having said that, we do see that the two architectures are somewhat converging, at least partially because Tranium is now introducing multiple cores, a multiple powerful cores but it but we are growing from two cores to four cores to eight cores and even more in the future and the gpu landscape starting from a the volta 100 generation by nvidia started introducing what they call tensor cores which are systolic array based compute units that try to take advantage of data reuse in order to improve energy efficiency so even though there There are a lot of differences between the architectures.
18:23There's also some similarities and they're increasing over time. Talk about how the user needs to think about these architectural differences. Does the user need to be very aware of it or are the differences managed by whatever frameworks they're using? So that's a nuanced answer to that question. So it depends on the type of user. We have lots of users that want their models to run, be decently optimized, but they're not necessarily trying to squeeze out every last percentage of hardware performance. So for these users, they actually don't need to be aware of the architectural differences. They can implement their model on PyTorch or JAX or any framework of choice.
19:16and then we have what we call the neuron compiler that maps between the framework level implementation and the instruction set of the hardware and optimizes the execution as it lowers the abstraction level. For example, if you go to Hugging Face today and you look at the, you have thousands of models there that natively map to Tranium and they just run efficiently. Specifically with Hugging Face, they introduce what they call the Neuron Optimum library that basically connects between the Transformer library and Neuron. So you just get automatic optimizations under the hood. You don't need to do much.
19:58That's one. And Neuron is the SDK for Tranium. Oh, yeah, I should have said so. Thanks, yes. And then there's another type of customers. Typically, the folks that are training very large foundation models. and for them, every last percentage of performance matters. If you can improve performance by three or 4%, it makes a world of a difference. I think that was one of the interesting things that we saw out of the DeepSeek team is that they talked about going underneath CUDA and writing assembly code to optimize their models or something along those lines. Like it's for teams operating at a certain degree of scale, it becomes very important to be able to do that.
20:43Exactly right. And that's exactly the type of examples that I'm referring to. And for these customers, we recently introduced the Neuron Kernel Interface, NKI, or we like to call it NICI. And NICI delivers basically instruction set architecture interface to any programmer. So basically you can come as an expert customer and say, I don't want to be reliant on the entire software stack, but rather I want to get direct access to the bare metal hardware along with its instruction set. And I want to program my operators or kernels and squeeze the maximum performance out of them. And we've had quite a few examples of customers, including Antropic and Poolside, and a few internal customers in AWS as well, that use Nikkei in order to really squeeze performance from the devices.
21:43How does CUDA compare to what you offer with Nikkei for Tranium 2? So first of all, I think NVIDIA did a fantastic job with CUDA. So props to them, and they built a very large user base on top of CUDA, which I think was a significant and important achievement in the industry. and at the same time cuda is somewhat hard to use because you need to map an algorithm which you think of as an atomic computation and you need to break it into hundreds or sometimes even thousands of cores and handle all the synchronization that is needed between the cores and that's one of the reasons that folks in the industry try to build abstraction levels on top of CUDA, including the Triton language by OpenAI.
22:40What we are doing with Niki is to provide with the same level of bare metal access, but in a way that we think is much easier to program. With the Niki AISA, I didn't mention, but Niki actually delivers two namespaces or abstraction levels to the programmer. The first one is called Niki AISA. You can literally import Niki.ISA and get that namespace. And the second namespace is Niki.lang. And we basically are trying to give customers the ability to choose the abstraction level in which they want to program the devices. With the Niki AISA abstraction level, the name is pretty telling. You get full control over the instruction set.
23:34So you get to program at the instruction level, and we believe that it's easier to program at the NICI-ISA level than in the CUDA level because you know exactly what the hardware is doing, and you also are interacting with a small number of large cores, so you have less of a communication overhead that you need to manage. with the nikki lang abstraction level we basically raise the abstraction a bit higher and we provide numpy like semantics which scientists are used to and and enjoy in their day-to-day life and that's that's an abstraction level that is useful for quick experimentation so think about trying to invent a new operator you probably don't want to squeeze every bit of performance in the first go.
24:24You just want it to run relatively quickly, see if the operator does what you want it to do. And if it's important, you'll optimize it later on. So that's what the Niki-Lang abstraction level is for. So if I kind of try to summarize a bit, I think CUDA is a phenomenal programming environment. We're trying to provide with more capabilities and easier interface with the Neuron Kernel Interface or NICI language that we provide to customers. And we're actually collaborating with quite a few universities that are now teaching the Neuron Kernel Interface as part of their high-performance programming courses.
25:03And we're seeing really good feedback from students so far. To what degree today in 2025 do you think that CUDA still represents this moat for NVIDIA that companies can't overcome? Or do you think that, you know, Nikkei or other technologies or, you know, the pace of innovation, like some set of factors has created an environment where CUDA no longer represents this unassailable moat for NVIDIA? So I think CUDA is a phenomenal programming environment and it's been very useful. and we as an industry built a large customer base around it. But I think the world has changed quite a bit in the last five to 10 years.
25:52And what we're seeing today is that the transformer architecture is extremely popular. And in order to build a transformer, all you need is five to 10 operators. We don't need to implement 100 or 200 different operators. And on top of that, folks that are training frontier models are spending lots of dollars on compute infrastructure. So if you take these two considerations together, it's absolutely worthwhile for leading AI labs to spend time in optimizing five to 10 operators to have their transformer running as efficiently as possible. and they'd be absolutely willing to do it in an alternative programming environment to CUDA, which I think is a good tailwind behind the neural kernel interface these days.
26:53So the folks that really care about performance and would go to the level of CUDA or even lower than CUDA, they just want something that's going to allow them to do what they need to do and gives them the most bang for the buck from a performance perspective. And the folks that aren't as performance sensitive, they can do whatever they want without going to that level just because of the framework compatibility. Exactly. So just to restate this in slightly different words, I think the folks that are training frontier models are going to chase the best compute efficiency, even if it requires them to do extra engineering work.
27:36And we're seeing that very clearly. and that's the driving force behind folks migrating to Tranium and also using the Neuron Kernel Interface and the folks that are not spending as much on compute will want to stay on the framework level they will not want to code neither in the CUDA level nor in the Neuron Kernel Interface level and that's why we built an XLA compiler that allows you to take a model from PyTorch or from JAX and seamlessly map it to training. Is the XLA compiler part of the neuron interface that you mentioned at Hugging Face? Is that under the covers? Or if I'm using a PyTorch model, will I need to run that XLA compiler myself?
28:24Both PyTorch and JAX have integrated plugins into the XLA compiler. The JAX framework was actually built on top of the XLA compiler. And the PyTorch framework introduced it over time with a shared project by Google, Meta, and us in AWS and a few others. What the XLA compiler does is it basically aims to be a just-in-time compiler, which means that it's pretty seamless to you. You run the model from the framework without any know-how that an XLA compiler is working under the hood. And then for the very first time that the framework encounters an uncompiled code, it will trigger the XLA compiler and map the framework level graph to the hardware.
29:18And every subsequent time that you call the same computation graph, it will map automatically to the previously done compilation. When does Train EM make sense? And for which types of users? Is it primarily targeting the users with these large workloads? Is it meant to ultimately be an alternative to the GPU for kind of your everyday generative AI workloads? How do you think about the user base in that way? So we generally build Trainium to be a general purpose AI acceleration platform, which can serve lots of needs across the AI ML community. But we do think along the lines that you mentioned before, and we have the following mental model.
30:07For the folks that are training frontier models, Trainium, and especially Trainium 2, is highly beneficial because it provides the highest performance and highest performance efficiency, whether you're denominated by energy or by cost. So folks that really need to build large compute clusters can benefit a ton from migrating to training. On top of that, we partner with a few providers, including Meta and HuggingFace and Ray and a few others, to provide with a list of already supported architectures, including transformers and the diffusion transformers and stable diffusions models. So folks that are using already existing model architectures can very well ramp on Trinium 2 with minimal efforts on their side.
31:03They run the model at the framework level and just trust the Neuron software stack to do the rest and map it to the device. And I would also say that the folks that might want to wait a little bit before migrating to Trinium are the folks that are inventing new models. but are not using large clusters. So for those folks, you might not want to take the burden of migrating to a new architecture for optimizing for a relatively low level of cost. So these folks might want to wait a little bit until the trinium infrastructure matures a bit and the migration becomes simpler and simpler over time. So in the near term, if I'm in a research environment, for example, experimenting with novel architectures, the burden to ensure that those architectures work efficiently on Tranium would fall on me since I'm not able to take advantage of a popular abstraction.
32:03And that might be someone who, you know, won't reap the full benefit. Even though there are caveats to that, that we might want to discuss. So Tranium does come with a couple of capabilities that just don't exist in other hardware out there. One of these capabilities, for example, is 4 to 16 sparsity. So an interesting sparsity optimization that allows you to scale, to speed up your compute by up to 4x. So if you want to try to make, take advantage of this capability and 4x speed up is something that seems quite compelling to you, you might want to try Tranium as well. But because you're trying to break new grounds, the way to take advantage of this capability would be through the neuron kernel interface or NICI programming environment that we described before.
Read the full transcript
33:03So we've talked quite a bit about Tranium, but not about like how it's offered to customers, right? You can't just go buy a Tranium chip. You're getting these through AWS instances. and that was part of the big news at reInvent was the general availability of the TRN2 instances. Can you talk a little bit about, you know, how they're packaged at the instance level? And I think there was also announcements around ultra servers and ultra clusters. What do all these things mean? Yeah, definitely. So when we talk about the Tranium 2 chip, or when we talk about Tranium 2, we mean the Tranium 2 chip.
33:41It's something that looks roughly like that. And we actually had the chips in our labs for quite a while now. But what we announced at reInvent is general availability of the Tranium 2 chips via servers that we can rent by the hour or in any other constellation. And these are called the TRN2 instances or TRN2 servers. Each TRN2 server packs one host CPU and 16 Trinium 2 devices. So that's one of the advantages with Trinium 2. They're very cost and energy efficient, which means that we can pack more of them in a single server without burdening either the cost of the server or the energy consumption of the server.
34:31Now, Tranium 2, the TRN 2 servers are the most powerful AI ML servers that we have in AWS, which means that that's one way to consume Tranium 2. You can rent these servers, again, either rent by the hour or rent as a longer term engagement, and just run your workload on the Tranium 2 servers available in AWS. So that's one entry point, let's call it. Another entry point is through managed services. So we have a couple of managed services in AWS, including AWS Bedrock, which is an ML API provider that supports various models, including Cloud and Lama and Dipsick and Nova. So when you use Bedrock, we actually map many of these models to Tranium under the hood in order to improve the speed and cost structure of these services.
35:33So that's another way that you might be consuming Tranium 2 chips without even noticing that. And maybe a third way to consume Tranium chips is via complete services by Amazon and other teams. So when you, for example, you might have noticed that when you go to Amazon.com, you have an AI shopping assistant called Rufus that gives you recommendations and gives you summarization of different products. So Rufus also uses a fleet of training devices under the hood, again, in order to improve performance, scaling, and cost track. So throughout this conversation, we've talked generally about performance, but there were some specific stats tossed out at reInvent with regard to the Tranium 2 instances in particular.
36:29But generally speaking, how do you think about the performance advantages of Tranium relative to alternatives? Yeah, definitely. So the TRN 2 instances provide with 21 petaflops of compute performance, and that's dense compute without making use of sparsity or 4x that, 83 petaflops of sparse compute performance in a single server, which is about 1.3x faster than any other compute platform in AWS for the dense computation and 2.6x faster than any other compute AIML accelerated platform for sparse computations. We also provide with 46 terabyte per second of HBM bandwidth, which is a massive amount of memory bandwidth that's close to 2x faster than the next in line instance.
37:29And we also provide with 3.2 terabyte per second of network connectivity to thousands of other servers via an ultra cluster network, which we can talk more about. Now, all of that was the TRN2 servers. We also announced at reInvent the TRN2 Ultra servers, which are essentially four TRN2 servers that are tightly integrated with one another. And you can basically think about it as the entire spec is increased by 4x compared to a single TRN2 server. And then the Ultra clusters are some number of Ultra servers, presumably? Right. So the ultra clusters connect thousands of ultra servers with one another with what we call internally the 10P10U network.
38:21So that's a network that allows you to connect any server to any other server within the ultra cluster between thousands of ultra servers with a 10 petabit per second of network and less than 10 microsecond of latency. So that's the reason for the name, 10p is the 10 petabits. Yeah, exactly. Practically speaking, can I go into my AWS console and make sure my credit card is in there and spin up an ultra cluster? Yeah, so not exactly. So these supercomputers are extremely expensive. They're gigantic. And we basically manage an ultra cluster in a very different way than we manage general purpose compute platforms.
39:06So you would need to communicate with your AWS support person and schedule an UltraCluster for your needs. I suspected that that was the answer. Tranium in the name is training, and we've talked thus far about kind of these large training workloads. But Tranium is also used for inference. Can you talk a little bit about the use of Tranium for inference and how that compares relative to Inferentia and where you see inference workloads on Tranium going? And when we started designing Inferentia and Tranium, and we're talking about eight years back, we've seen somewhat of a different requirement for inference workloads and for training workloads.
39:57Influence workloads back in the days required less memory bandwidth, very different from today. We'll talk about it in a second. And it required a slightly smaller set of operators. It was very focused on matrix multiplications, convolutions, and some nonlinearities. But as the transformer architecture picked up, and specifically a transformer decoder architecture picked up. What we've seen, and this is quite a few years back now, is that the inference workload is actually broken down to two very different workloads. I touched on it before. The first step of the workload is what we call the prompt processing, or sometimes we call it pre-fill, where we take a user query and we process the entire query at once.
40:48And a good way to think about it is that we read all the model parameters from memory, but then we get to amortize these red bytes or red weights from memory. We get to amortize them over the computation that is required to compute the entire prompt, or typically hundreds or maybe thousands of tokens or thousands of words. But then a transformer decoder enters the second phase of the workload when it is autoregressive, which means that it generates one token or one word at a time. It basically generates a token and then feeds the token in an autoregressive manner into the input and generates the next token.
41:29This ends up being very memory bound, which breaks the assumptions that we had for these workloads from about 10 years ago. So quite a few years ago, we realized that serving models or performing inference on top of Tranium is actually quite efficient today. And we're seeing that the majority of our inference serving is done on Tranium devices today. So naming might have not been ideal, but we're definitely using Tranium to serve both large cluster training as well as inference workloads. A number of customers were mentioned at the reInvent launch, including Adobe, Poolside, Databricks, and Qualcomm.
42:22You also had a representative from Apple and their machine learning engineering team talking about their early experiences with Tranium 2 and mentioned that they were expecting to see significant, like 50 % efficiency gains based on their evaluations. can you talk a little bit about generally what you've seen from customers thus far? Yeah, so first of all, customers are extremely excited about Trinium 2 as are we because it provides with a couple of clear advantages over alternatives in the market right now. The first of all is just raw specs. The raw specs are better than alternative hardware available in the market.
43:07But on top of that, the efficiency and the path to getting efficiency is also better than alternative offerings out there. And when I talk about the path to efficiency, it's worthwhile talking about two metrics that we tend to measure ourselves according to. The first one is called MFU, or model flops utilization. And the second one is called MBU, or memory bandwidth utilization. And the idea with both of these metrics is that we give ourselves a score on how much of the entitlement of the hardware, how much of the raw specs are we able to achieve when we're running a real workload. So what we've seen with Tranium 2 is that when we're running microbenchmarks, we can almost entirely saturate the memory bandwidth, just get above 90 % of the spec memory bandwidth of the device, which is quite unique.
44:07It's not easy to achieve. But even when we run end-to-end inference workloads and there's a bunch of other considerations other than just reading from the memory as fast as you can, we still can get to 60, 70 and beyond percent MBO, which is quite an impressive number. And I can kind of quote similar numbers for the MFU land or for the compute land of the entitlements corps. Now, we've been extremely, extremely lucky to collaborate with the customers that you mentioned. We're learning a ton from their engineers. And one of the things that we've done together is to build a set of models on top of Niki, on top of our neuron kernel interface.
44:59And the benefits go both ways here. On the one hand, we try to help our customers to fully optimize performance and get the maximum from the devices that they're paying for. And on the other hand, they get to tell us where the sharp edges are and what we need to improve in Nikkei, such that we build a sustainable and easy-to-use programming environment that will be with us for quite a few years down the road. Another interesting customer announcement from reInvent was Anthropic, who, in addition to talking about many of the things that they're doing with the cloud models on AWS, talked about this project for NIR, which is a large supercomputer cluster based on the Tranium 2 instances.
45:48Can you talk a little bit about, you know, what can you share about that project and the size and scale and what they're hoping to achieve with it? Yeah, so Antropic is an amazing customer to work with. They're the most talented AI lab that I've ever interacted with. We're super fortunate to work with them. With Project Rainier, we're building a gigantic training cluster that fully embraces the scaling laws. What we've said publicly is that that cluster will have many hundreds of thousands of training to devices, but we didn't disclose the exact number. But that cluster is at least 5x larger than Anthropic's previous training cluster.
46:37And they're planning to train the largest and most intelligent frontier model on top of that cluster. That work has already started. I've been working with them quite closely. And I'm super excited about what they have in store for us. For the general audience, the Antropic team is the AI lab behind the Claude AI model. And if you haven't tried it, I highly recommend it. When you're building at the scale of hundreds of thousands of chips, what additional considerations beyond some of the things that we've talked about come into play? I've got to imagine there's all of the traditional data center cooling and power issues, networking.
47:24can you talk a little bit about those? Definitely, yes. So when you're building at that scale there's a whole list of considerations that come into play. The first one is just architectural where we need to rethink how we shard the model in order to fit a gigantic model on a cluster of that scale. Now, we all are familiar with tensor parties pipeline parallelism, data, expert sequence parallelism, all these techniques are quite well known at this point. But when you push the boundary to a cluster of that scale, you also work against what we call the global mini batch constraint. So basically, there's a maximum number of examples that the model can train, can work through before updating the weights.
48:19and beyond that number, scaling is significantly diminished. So basically you add more compute, but you don't get better speedups. The model will just need the same number or roughly the same number of steps in order to convert. So the first thing to do is to decide on the sharding strategy in a way that optimizes across multiple dimensions from system performance and all the way to the science or mini-dash construct. on top of that when you train at that a scale you also need to pay lots of attention to error detection and error recovery because even if we and we do we pay a ton of attention to making these training two devices extremely robust and i can i can spend the full hour talking about all the techniques that we employ there but even after doing that when you train on hundreds of thousands of devices, every once in a while, a device will fail and you need to recover from that.
49:25So it's really critical. Without starting your training job that you started two months ago all over again. Oh, 100%. Yes. So the first order set of optimizations are to identify the failure really quickly. So you don't want to identify the failure after 10 minutes or after an hour when you kind of wasted a lot of compute. And you also want to be able to replace a node and recover extremely quickly. But these are kind of table stakes. There are also more advanced optimizations where you actually don't recover from a checkpoint, but rather can dynamically change the set of nodes that are participating in a computation.
50:12And all of that goes into every large-scale training run that we do without going into specific techniques by certain customers. It's interesting that all of your response to this was primarily architectural and software related as opposed to where I thought you'd have challenges is, you know, the topology and network and things like that. I imagine the implication being that at AWS's scale, you figured a lot of that out already. Yeah, I mean, I consider the networking and power optimizations that we do as table stakes. We need to give our customers an extremely smooth experience from that perspective, because that's our responsibility.
51:02That's not our customer's responsibility. And that's where AWS's reputation lies. And that's the reason that people come to AWS to train large models. But after doing all of that, we still need to acknowledge the laws of physics. Even if every single device can fail like at 0.1 % of a percentage annually, we still need to create systems around the cluster in order to deal with these failures. And when you're operating a cluster at that scale, are you using the traditional AWS primitives to do it? Are you using the same console? Are you using cloud formation and things like that? Or are you getting maybe more of a raw set of instances that you are operating yourself with your own tooling?
51:59So different customers make different choices here. We've seen quite a few customers that are leveraging what we call HyperPod, which is another AWS service for managing large training clusters. And it provides you with fault detection and recovery and many other services like that. But other customers decide to just get their raw instances and maybe run a Kubernetes cluster on top of it and manage it themselves. And we're non-opinionated here. We would support customers in whichever place they want to meet us. There are a couple of things that you mentioned earlier that I wanted to follow up on.
52:44One of those was your comments around sparsity. You talked a little bit about how Tranium 2 provide some advantages relative to sparsity, but can you talk a little bit about how those are used and what's required to take advantage of them? One of the things that we've seen over the last couple of years is that model intelligence improves with the number of parameters and with compute that is invested during training. But at the same time, we're already spending a ton of compute energy and spend in order to train these models. So one of the challenges that we're seeing is how to support larger models without increasing the amount of compute and the amount of energy spent in a proportional manner.
53:31And one of the nice ways to achieve that is what we call sparsity, where we basically grow the amount of parameters in the model, but take some assumption or actually constrain the model to have a certain percentage of zeroed parameters. And there's nice research out there, which I'll mention in a sec, on the gains that can be had with such sparsity techniques. But as of today, the hardware available in the market doesn't support a lot of sparsity acceleration. We have various GPUs that support what we call 2 to 4 sparsity. and when I say 2 to 4, it means that out of every four elements, two elements are non-zero and the other are zeros.
54:25And on top of that, we also saw that the speedup that you get from sparsity is not linear. So you would expect that 2 to 4 sparsity will give you 2x speedup, but what we're seeing is that that's actually somewhat lower than that. The speedups are somewhat lower than 2x. so we we decided to tackle that with the training to architecture and we've built in a sparsity capability that we call 4 to 16 so you should note two things here first of all the the potential speed up is much much higher than than 2x it's actually 4x because we have four non-zero element out of every 16 elements. And we also have an extensive benchmarking of the hardware that shows that we can actually get the 4X speedup.
55:18So it's not only spec numbers, it's actually achievable in benchmarks. Now, when we introduced this capability to our science team, the first thing that they wanted to do actually surprised me a little bit, but it makes tons of sense. They didn't want to try the 4 to 16 sparsity as a first step, but rather the 4 to 8 sparsity as a first step. And the rationale behind it is that now they can benchmark 2 to 4 sparsity by other hardware platforms with 4 to 8 sparsity, which provides the same spec speedups, but provides you with a better flexibility in the sparsity pattern. Because if you think about it a little bit, you'll see that 4 to 8 sparsity is more flexible than 2 to 4 sparsity.
56:03and what we've done is we took a set of models specifically we used llama 3.1 8b 70b and 405b so across various sizes and we sparsified these models to either 2 to 4 sparsity or 4 to 8 sparsity and we saw that across the board the 4 to 8 sparsity was more accurate so that was already a win and we also saw that we were getting the 2x and 4x speedups in this case and 4x speedup in 4 to 16 sparsity for the gem portion of the workload. Now, the second thing that we did, which was quite exciting, was to then compare the accuracy of the sparsified model with the accuracy of the original dense model.
56:52And we've seen that we've been able to recover, to fully recover the accuracy of the model with the sparse representation. And there's a paper from a team in Amazon that is going to come out soon to discuss the techniques that were used to achieve that. Meaning the techniques that were used to sparsify the models? Exactly, yeah. So if after applying sparsity, you have reached parity from an accuracy performance perspective, is it efficiency that you've gained? Or is it latency because you're doing a greater amount of effective flops? What is the ultimate advantage? It's actually all of the above.
57:33So basically, during inference, we get to read sparse weights and we won't read the zeros. We only read the non-zero weights. So token generation becomes linearly faster or close to linearly faster. We also improve latency or what's typically called time to first token because we skip all the computations for the zero parameters. And during training, you can actually decide how you use the gains. You can either cut your spend by about half or you can just throw more compute at the problem and get a more intelligent model. So for folks that really managed to recover the full accuracy of the model, this is almost like jumping a generation in the hardware and training with the hardware that will come up in a year and a half, like training three.
58:27One way that you can think about mixture of experts is as a kind of a sparse network architecture. Have you done anything with MOEs? Oh, I 100 % agree with you. So I think the community is looking into deploying sparsity in different ways. And the way that I look at things is that structured sparsity is a form of fine-grained sparsity. And mixture of experts is exactly, as you said, a coarse grain level of sparsity. And we're definitely working with quite a few customers that are deploying a mixture of experts models. models. One that I can definitely name because it's public at this point is Databricks with their DPRX MOE model.
59:12And we've been working quite a bit to optimize the Tranium 2 and the neuron stack to support mixture effect models, including efficient all-to-all communication primitives, including dynamic compute and including advanced sharding techniques for expert parallelism versus sequence parallelism. One of the things that we've seen lately, especially with DeepSeq, is that there's a gradual migration from a small number of large experts to a large number of small experts. And that actually shifts the system optimization trade-offs quite a bit and pushes us more towards expert parallelism techniques that we've been working to optimize quite significantly.
1:00:03Well, we talked about some of the work with developing new kernels and supporting new architectures. Are there any examples that come to mind for that? Yeah, we have a ton of examples. We have too many to mention, but most of them are customers that are building their own unique secret sauce operators on top of Trinium. But one example that we've shared broadly and is super fun, you can read about it online, we actually go in quite a bit of depth into how this was built, is what an internal team did with the Mamba 2 network. So just to give a little bit of background, Mamba 2 is a state space model, which is a state space models are a family of models that are a tweak to the Transformers architecture that replaces the attention operator in a way that can support very long sequence length of millions of tokens.
1:01:05but one of the challenges with state space models is that they're inherently sequential which means that you need to pay really close attention to performance optimization to get them to perform. So we have an internal team that is optimizing these state space models. They identified a kernel that was a bottleneck for them when running on top of Trinium. So they just took that kernel and migrated it to a NICI implementation. And that kernel was sped up by 17x, and they did it with 77 lines of Nikky code. It's all online. Oh, wow. Yeah, it's all online. We're super happy with that achievement. And they ended up providing really good performance for their Mamba 2 implementation.
1:01:52Well, we'll dig up that link and include it in the show notes and also link to my interview with Albert Gu, who is one of the researchers who created Mamba 2. So one of the other things that came out of the Tranium 2 keynote or Matt Garman's keynote at the last reInvent, I should say, was that we should expect Tranium 3 to be released sometime late this year. How are you thinking about evolving the Tranium architecture to meet new challenges and evolving needs and be positioned for the way that generative AI workloads are evolving? Yeah, so Tranium 3 is in very advanced development stages. I'll try to avoid talking about the exact stage.
1:02:44the exact stage and we're actually already working on training four so we're working on a couple of generations ahead and we're definitely in terms of how we're thinking about evolving the training architecture and making sure that it provides the maximum value to our customers there's a couple of tenets that we work through the first one is very straightforward We tightly collaborate with a set of lead customers, including the ones that we mentioned before, Antropic, Poolside, and many others. And we work with them to define the next steps of the architecture evolution and what would it require to support the next generation of model architecture and the next generation of model architectures, including a couple of primitives that we bake into the architecture that just don't exist in any other hardware that is the market today.
1:03:49But on top of that, we actually build on two tenets in Annapurna Labs that I think are paying a lot of dividends. The first one is what we call the builder operator approach where every person that builds the training devices also operates them in the fleet, in the giant clusters that we're building. And that gives us a really good flywheel where the builders that are designing the chip are the ones that know exactly how to optimize the chip, how to optimize its power operating point and many other considerations. And this is really critical because they can solve problems faster than anyone else, but they also highly incentivize to build an easy to operate system for the next generation.
1:04:45So we kind of get a flywheel there. And the other tenet that we pay a lot of attention to is the designer optimizer. So folks on my team that are architecting the next generation also spend a lot of time with customers and with the software teams to optimize existing workloads. And again, we get two benefits there. They know the hardware the best so they can optimize it, but they also feel firsthand where the sharp edges are and they build improvements towards the next generation. So we get a very nice flywheel from these two tenants. So any specific predictions about where the architecture goes?
1:05:24I'll give you the easy predictions. There's going to be way more compute. Better, faster, cheaper. Yes, exactly. But on top of that, I definitely see us going more towards more compact data types. I think that's very clear these days. And I see us going towards a few dedicated optimizations that I won't touch on right now, but we're planning to talk about them at the next three minutes. Awesome. Details to come. Yes. Well, Ron, thanks so much for taking the time to jump on and share a bit about what you've been working on, both immediately and over the past 10 years. We went back a little bit, but it's been great catching up on all this.
1:06:11Thank you, Sam. I enjoyed the conversation. Thanks for having me. Thank you.
From the publisher
Today, we're joined by Ron Diamant, chief architect for Trainium at Amazon Web Services, to discuss hardware acceleration for generative AI and the design and role of the recently released Trainium2 chip. We explore the architectural differences between Trainium and GPUs, highlighting its systolic array-based compute design, and how it balances performance across key dimensions like compute, memory bandwidth, memory capacity, and network bandwidth. We also discuss the Trainium tooling ecosystem including the Neuron SDK, Neuron Compiler, and Neuron Kernel Interface (NKI). We also dig into the various ways Trainum2 is offered, including Trn2 instances, UltraServers, and UltraClusters, and access through managed services like AWS Bedrock. Finally, we cover sparsity optimizations, customer adoption, performance benchmarks, support for Mixture of Experts (MoE) models, and what’s next for Trainium.
The complete show notes for this episode can be found at https://twimlai.com/go/720.




