SLMs on CPU | Amazon Web Services

Amazon Web Services · Advanced ·☁️ DevOps & Cloud ·1y ago

Key Takeaways

Amazon Web Services discusses running Small Language Models (SLMs) on CPUs, highlighting the benefits of improved model quality, CPU architecture advancements, and quantization techniques, with a focus on cost-effective deployment on AWS Graviton instances.

Full Transcript

Hello, I'm Nolan Chen, partner solutions architect at AWS. And I'm Andrew Wal. I lead the field engineering team at RCI. Andrew, earlier you talked about how we can run SLMs on CPUs. Forgive me, but that sounds a little bit too good to be true for me. Could you talk more about that? Absolutely. And that's the natural reaction is these models require so much parallelization that the idea of running them on CPU almost does sound too good to be true. But in fact, we have run use cases that have worked really well. So let's talk about why that is. So we'll have SLMs on CPUs. And there's really three primary reasons why this has been able to work. One is that SLMs are continuously improving and what I mean by that is we are seeing drastically improved quality of models at lower parameter sizes as time goes on. One clear example is at RCAI we released a model about 6 months ago that was 70 billion parameters. Two months ago, we released a model that was 10 billion parameters that outperformed it. Wow. We're talking about a model that is seven times smaller and outperformed it in only a couple of months. And at that rate, we're able to get drastically improved performance for models at smaller and smaller sizes. Second is CPU architecture improvements. architecture improvements. There we go. Over time. And specifically what we're looking at here is the improvements to instruction sets within the CPUs that allow them to utilize deep learning frameworks. This has been able to improve serving uh frameworks such as VLLM, Llama CPP and others. And then finally, there have been improved quantization techniques. And what this has allowed us to do is run models more efficiently at smaller sizes which allows us to ultimately get them down to run effectively on CPUs. Okay. I think I heard you earlier say talk about how you guys develop models that went from 70 billion to 10 billion parameters. Is there a magical number or sweet spot where in terms of parameter counts where you can actually start running it pretty effectively on a CPU? Yeah, absolutely. And we found two primary model sizes right now that work really well. The first one is an 8B model that has been quantized to four bits as well as a 4 billion parameter model that has been quantized down to 8 bits. And this has been a really good sweet spot in the middle between what is still able to run on a CPU and still produce accurate and reliable results that are useful for a business. And can you tell us again what quantization is? Absolutely. It's the idea of being able to take models and running them at a smaller size so that they can have improved latency, but also and what's most important in this use case is a smaller memory footprint. And what's important to remember here is that when we're talking about models that are less than 10 billion parameters, we've found that quantizing down from 16 bit all the way down to 8 bit has virtually no impact in overall accuracy. And quantizing all the way down to 4bit has very minimal impact when we're talking about models of this size. Got it. So to keep some people from getting too carried away, can you remind us though what are some of the limitations of trying to do inference genai inference on CPUs? Absolutely. So when you're thinking about what impacts you're trading off when you're running on CPU versus GPUs, one is going to be how many parallel requests you're able to do. So typically when you're running SLMs on CPU, you're going to use a batch size of one. So you are very limited on the throughput that you are utilizing. Additionally, you are going to have much greater constraints on the context window for your model. So you are providing less context and smaller throughput. But if you remember you have that massive massive reduction in cost and that is really where the benefit lies. Can I ask you now just give an example of a real world use case where it might make more sense to run an SLM on a CPU. Absolutely. So think of being able to run a model in a grocery store. Let's say that a company wanted to have a model that they ran where cashiers would be able to look up inventory levels, for example, and they wanted them to be able to interact in a natural language form there. That's very simple. The information that's provided to the model is what the inventory level is for the product that they're asking about. And you're only having a few requests every once in a while. Let's say that model actually runs locally on the cache register or the computer that they're running there. And that is one that would make sense because again very limited throughput, small context size, and you're able to run it very efficiently from a cost perspective. Wow. So, who knows, maybe in the very near future, an SLM will be at every checkout the grocery store potentially. But that said, being that we're AWS, we're always trying to find more cost-effective ways for our customers to run their workloads in the cloud. What would be a way to take advantage of running SLMs on CPUs in AWS? Yeah. And one of the great things that AWS provides is instances with a really good cost to performance ratio. And specifically, I'm talking about Graviton. So, we actually did have an experiment where we ran this model here, our 8B quantized down to four bits on a Graviton 4. And we were actually able to achieve upwards of 30 tokens per second when running this model on a Graviton 4. Wow. So AWS customers today can start at least experimenting and running SLMs on Graviton. Absolutely. Awesome. Thank you, Andrew. Thanks, Nolan.

Original Description

In part 3 of this 5 part video series on Small Language Models with Arcee AI, Andrew Walko and Nolan Chen discuss whether running SLMs on CPU is all hype or if there's a real way to do it in production. They discuss which model sizes can be used and how it can be done in the most cost-performant manner on AWS. Learn more - https://go.aws/4laWv7r Subscribe to AWS: https://go.aws/subscribe Sign up for AWS: https://go.aws/signup AWS free tier: https://go.aws/free Explore more: https://go.aws/more Contact AWS: https://go.aws/contact Next steps: Explore on AWS in Analyst Research: https://go.aws/reports Discover, deploy, and manage software that runs on AWS: https://go.aws/marketplace Join the AWS Partner Network: https://go.aws/partners Learn more on how Amazon builds and operates software: https://go.aws/library Do you have technical AWS questions? Ask the community of experts on AWS re:Post: https://go.aws/3lPaoPb Why AWS? Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud. Millions of customers—including the fastest-growing startups, largest enterprises, and leading government agencies—use AWS to be more agile, lower costs, and innovate faster. #AWS #AmazonWebServices #CloudComputing #SLMs #LLMs #smalllanguagemodels #generativeai #ai #CPU #cpuinference #graviton
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Amazon Web Services · Amazon Web Services · 58 of 60

1 Agentic AI Design Patterns Introduction and walkthrough | Amazon Web Services
Agentic AI Design Patterns Introduction and walkthrough | Amazon Web Services
Amazon Web Services
2 Galileo on modernizing on banking infrastructure | Amazon Web Services
Galileo on modernizing on banking infrastructure | Amazon Web Services
Amazon Web Services
3 Alliander Speeds Innovation and Energy Transition Using AWS | Amazon Web Services
Alliander Speeds Innovation and Energy Transition Using AWS | Amazon Web Services
Amazon Web Services
4 AWS and Scuderia Ferrari HP streamline F1 power unit assembly | Amazon Web Services
AWS and Scuderia Ferrari HP streamline F1 power unit assembly | Amazon Web Services
Amazon Web Services
5 How AWS machine learning supports Scuderia Ferrari HP pit stops | Amazon Web Services
How AWS machine learning supports Scuderia Ferrari HP pit stops | Amazon Web Services
Amazon Web Services
6 Nasdaq Builds Market Infrastructure of the Future with AWS | Amazon Web Services
Nasdaq Builds Market Infrastructure of the Future with AWS | Amazon Web Services
Amazon Web Services
7 AWS Security Hub Exposure Findings | Amazon Web Services
AWS Security Hub Exposure Findings | Amazon Web Services
Amazon Web Services
8 How do I use Session Manager port forwarding to connect to my EC2 instance through RDP?
How do I use Session Manager port forwarding to connect to my EC2 instance through RDP?
Amazon Web Services
9 How do I extend an EBS volume with LVM partitions?
How do I extend an EBS volume with LVM partitions?
Amazon Web Services
10 AWS Graviton makes it easy to optimize performance, cost, and sustainability | Amazon Web Services
AWS Graviton makes it easy to optimize performance, cost, and sustainability | Amazon Web Services
Amazon Web Services
11 Run Cloud Adoption Framework workshops with Miro | Amazon Web Services
Run Cloud Adoption Framework workshops with Miro | Amazon Web Services
Amazon Web Services
12 Getting Started with AWS Cost Optimization Hub | Amazon Web Services
Getting Started with AWS Cost Optimization Hub | Amazon Web Services
Amazon Web Services
13 Why did my Amazon SQS messages get sent to a dead-letter queue?
Why did my Amazon SQS messages get sent to a dead-letter queue?
Amazon Web Services
14 Declarative Policies for EC2 | Amazon Web Services
Declarative Policies for EC2 | Amazon Web Services
Amazon Web Services
15 How do I troubleshoot IAM permission issues for the Billing and Cost Management console?
How do I troubleshoot IAM permission issues for the Billing and Cost Management console?
Amazon Web Services
16 Integrity at Scale: Inside the Flo Health Mission | Amazon Web Services
Integrity at Scale: Inside the Flo Health Mission | Amazon Web Services
Amazon Web Services
17 Fueling Success: Small shifts, powerful performance | Amazon Web Services
Fueling Success: Small shifts, powerful performance | Amazon Web Services
Amazon Web Services
18 WEX enhances customer experience with AI-powered chatbot | Amazon Web Services
WEX enhances customer experience with AI-powered chatbot | Amazon Web Services
Amazon Web Services
19 Accelerate troubleshooting with Amazon CloudWatch investigations | Amazon Web Services
Accelerate troubleshooting with Amazon CloudWatch investigations | Amazon Web Services
Amazon Web Services
20 Why is my Windows WorkSpace stuck in the starting, rebooting, or stopping status?
Why is my Windows WorkSpace stuck in the starting, rebooting, or stopping status?
Amazon Web Services
21 Telemetry Pipelines for AI | Amazon Web Services
Telemetry Pipelines for AI | Amazon Web Services
Amazon Web Services
22 Getting Control over Security and Observability Data | Amazon Web Services
Getting Control over Security and Observability Data | Amazon Web Services
Amazon Web Services
23 The Problem with Telemetry Data Volume | Amazon Web Services
The Problem with Telemetry Data Volume | Amazon Web Services
Amazon Web Services
24 Telemetry Pipelines on AWS | Amazon Web Services
Telemetry Pipelines on AWS | Amazon Web Services
Amazon Web Services
25 What are Telemetry Pipelines? | Amazon Web Services
What are Telemetry Pipelines? | Amazon Web Services
Amazon Web Services
26 Using AI for RegEx on Telemetry Pipelines | Amazon Web Services
Using AI for RegEx on Telemetry Pipelines | Amazon Web Services
Amazon Web Services
27 Multi-Session Support in the AWS Console | Amazon Web Services
Multi-Session Support in the AWS Console | Amazon Web Services
Amazon Web Services
28 How CloudHedge delivers assessment with AWS ISV Tooling Program at no cost?
How CloudHedge delivers assessment with AWS ISV Tooling Program at no cost?
Amazon Web Services
29 How customers speed up migration and modernization to AWS with CloudHedge | Amazon Web Services
How customers speed up migration and modernization to AWS with CloudHedge | Amazon Web Services
Amazon Web Services
30 Chaos Experiment with Amazon ElastiCache | Amazon Web Services
Chaos Experiment with Amazon ElastiCache | Amazon Web Services
Amazon Web Services
31 Amazon S3 Access Points: Easily manage access for shared datasets on S3 | Amazon Web Services
Amazon S3 Access Points: Easily manage access for shared datasets on S3 | Amazon Web Services
Amazon Web Services
32 ElastiCache Valkey 8.0 - Savings and Efficiency | Amazon Web Services
ElastiCache Valkey 8.0 - Savings and Efficiency | Amazon Web Services
Amazon Web Services
33 Pennymac scales document processing with AWS | Amazon Web Services
Pennymac scales document processing with AWS | Amazon Web Services
Amazon Web Services
34 AWS | Next Level Innovation | Amazon Web Services
AWS | Next Level Innovation | Amazon Web Services
Amazon Web Services
35 Driving Cloud Innovation: Mindtickle's Partnership with AWS Enterprise Support | Amazon Web Services
Driving Cloud Innovation: Mindtickle's Partnership with AWS Enterprise Support | Amazon Web Services
Amazon Web Services
36 A Leader's Edge from Executive Insights | Amazon Web Services
A Leader's Edge from Executive Insights | Amazon Web Services
Amazon Web Services
37 How do I create a custom Amazon WorkSpaces image?
How do I create a custom Amazon WorkSpaces image?
Amazon Web Services
38 Charles Leclerc tests his AI-generated race track | Amazon Web Services
Charles Leclerc tests his AI-generated race track | Amazon Web Services
Amazon Web Services
39 Redington Scales India’s Cloud Access with AWS Partnership | Amazon Web Services
Redington Scales India’s Cloud Access with AWS Partnership | Amazon Web Services
Amazon Web Services
40 How do I prevent the resources in my CloudFormation stack from getting deleted or updated?
How do I prevent the resources in my CloudFormation stack from getting deleted or updated?
Amazon Web Services
41 How do I troubleshoot authentication errors when I use RDP to connect to an EC2 Windows instance?
How do I troubleshoot authentication errors when I use RDP to connect to an EC2 Windows instance?
Amazon Web Services
42 Exploring the Possibilities of Digital Twin & AI at the Edge | Amazon Web Services
Exploring the Possibilities of Digital Twin & AI at the Edge | Amazon Web Services
Amazon Web Services
43 Exploring the Possibilities of Digital Twin & AI at the Edge | Amazon Web Services
Exploring the Possibilities of Digital Twin & AI at the Edge | Amazon Web Services
Amazon Web Services
44 AWS at the FORMULA 1 AWS GRAN PREMIO DELL'EMILIA-ROMAGNA 2025 | Amazon Web Services
AWS at the FORMULA 1 AWS GRAN PREMIO DELL'EMILIA-ROMAGNA 2025 | Amazon Web Services
Amazon Web Services
45 What's new in RCPs | Amazon Web Services
What's new in RCPs | Amazon Web Services
Amazon Web Services
46 API Caching using Amazon ElastiCache | Amazon Web Services
API Caching using Amazon ElastiCache | Amazon Web Services
Amazon Web Services
47 Pendula: Amazon Nova Customer Testimonial | Amazon Web Services
Pendula: Amazon Nova Customer Testimonial | Amazon Web Services
Amazon Web Services
48 InDebted : Amazon Nova Customer Testimonial | Amazon Web Services
InDebted : Amazon Nova Customer Testimonial | Amazon Web Services
Amazon Web Services
49 Amazon DynamoDB global tables with multi-Region strong consistency | Amazon Web Services
Amazon DynamoDB global tables with multi-Region strong consistency | Amazon Web Services
Amazon Web Services
50 Siemens Mobility uses AWS to operate securely, efficiently on a global scale | Amazon Web Services
Siemens Mobility uses AWS to operate securely, efficiently on a global scale | Amazon Web Services
Amazon Web Services
51 How do I reuse a knowledge base session in Amazon Bedrock?
How do I reuse a knowledge base session in Amazon Bedrock?
Amazon Web Services
52 EP5: MBZUAI, CMU : Causal AI, Answering The “Why“ and “What if“ Questions | AWS for AI Podcast
EP5: MBZUAI, CMU : Causal AI, Answering The “Why“ and “What if“ Questions | AWS for AI Podcast
Amazon Web Services
53 Hema scales time to market developing a data mesh on AWS (Technical) - Cloud Adventures
Hema scales time to market developing a data mesh on AWS (Technical) - Cloud Adventures
Amazon Web Services
54 Hema scales time to market developing a data mesh on AWS (Business) - Cloud Adventures
Hema scales time to market developing a data mesh on AWS (Business) - Cloud Adventures
Amazon Web Services
55 How Langfuse Scaled Their AI Platform with AWS: From Open-Source to Enterprise | Amazon Web Services
How Langfuse Scaled Their AI Platform with AWS: From Open-Source to Enterprise | Amazon Web Services
Amazon Web Services
56 SLMs and LLMs: What’s the Difference? | Amazon Web Services
SLMs and LLMs: What’s the Difference? | Amazon Web Services
Amazon Web Services
57 SLMs and LLMs: When to use them? | Amazon Web Services
SLMs and LLMs: When to use them? | Amazon Web Services
Amazon Web Services
SLMs on CPU | Amazon Web Services
SLMs on CPU | Amazon Web Services
Amazon Web Services
59 Intelligent Model Routing | Amazon Web Services
Intelligent Model Routing | Amazon Web Services
Amazon Web Services
60 SLMs, LLMs, and Model Routing in Agents | Amazon Web Services
SLMs, LLMs, and Model Routing in Agents | Amazon Web Services
Amazon Web Services

Running SLMs on CPUs is a viable option with improved model quality, CPU architecture, and quantization techniques, offering a cost-effective solution for deployment on AWS Graviton instances.

Key Takeaways
  1. Evaluate model size and complexity
  2. Apply quantization techniques
  3. Choose suitable CPU architecture
  4. Deploy on AWS Graviton instances
  5. Monitor and optimize performance
💡 Quantization techniques can significantly reduce model size and improve performance on CPUs, making them a viable option for deployment.

Related Reads

Up next
Containers on Amazon ECS with Mama J
AWS Developers
Watch →