AI/ML frameworks for cloud TPUs

Google Cloud Tech · Beginner ·🧬 Deep Learning ·8mo ago

Key Takeaways

The video covers AI/ML frameworks for cloud TPUs, including PyTorch, JAX, Keras, and Nvidia's Triton, highlighting their differences and use cases for model training, inference, and fine-tuning.

Full Transcript

[music] If you're already working in AI [music] or learning about it, you've probably dealt with a few frameworks. PyTorch, Caris, Jax, Triton, VLLM. But what are they all for? How are they different? And when should you use one over the other? We'll break them down and look at some of the trade-offs, give them a definition, and talk about which tests they're good at. In other words, we'll do a little if this then that comparison. First, let's cover model training frameworks. We all like shortcuts, right? Think of a framework as a toolkit. A shortcut from zero to production code. You could build everything from scratch if you're some kind of super genius. Or you could lean on these tools to pre-build part of the puzzle for you. Whether that's doing complex math, data handling, or optimization. For many, the perfect starting point is Caris. Caris is an easy to use interface or API for building models. It's like a clean dashboard that sits on top of a powerful engine. You can build a powerful neural network in just a few lines of caris code. And a huge advantage today is that caris is multibackend. That means you can write your caris code once and run it using jacks or pietorrch as the underlying execution engine. That kind of flexibility is incredible for defining your models. Underneath caris or for more granular control, we have pietorch and jax. PyTorch, an open-source framework originally created by Meta, is loved by researchers for its Pythonic feel and flexibility. Jax from Google is a high performance numerical computing library, excellent for research and large-scale model development due to its speed and automatic differentiation capabilities. These are the engines that power your model definitions. It's important to remember that while Caris, PyTorch, and Jax define models, they're also fully capable of training models directly. Researchers often leverage these frameworks for their full access to parameters, allowing for highly customized and experimental training workflows, allowing them full control over the process. But now that we've trained the model, what's next? Once you've defined and trained your model, you need to put it to work for end users. making predictions or generating outputs based upon new unseen data. While training is about learning, inference is about making it quick and easy for them to apply that knowledge, often in real time and at scale, allowing for them to serve predictions and generate text for whoever is using the model. To do that, you need dedicated inference frameworks and servers. These tools allow your models to handle anywhere from 10 to 10 million requests quickly and reliably in a production environment. Let's look at some key players on the inference stage. For GPUs, Nvidia's Triton inference server is a highly performant open-source inference server. It supports models from various training frameworks like TensorFlow, PyTorch and ON&NX runtime offering features like dynamic batching and concurrent model execution for maximum efficiency. TGI from hugging face is another popular solution specifically designed for deploying LLM for fast inference providing features like continuous batching and quantitization. It works great if you're solely working with textonly models deployed through hugging faces model garden. For more than just texton models, consider vlm. VLM is a wellknown as a fast and affordable library for LLM serving using techniques like page detention to manage memory efficiently during text generation. And when it comes to scaling up your inferencing workload to handle more incoming traffic, perhaps you might want to consider LLMD. LLMD is a powerful open-source framework designed for high throughput LLM serving, offering advanced features to optimize performance and cost for large-scale deployments. While many developers focus on inference, understanding fine-tuning is fundamental. This involves taking a pre-trained model, one that has already learned from a general data set, and further training it on a smaller specific data set to adapt it for a particular task or domain. It's way more efficient than training a model from scratch. For efficient fine-tuning of large models, especially LLM, a powerful approach is parameter efficient fine-tuning or PFT. Libraries like hugging faces PFT provide methods like Laura. Low rank adaptation that allow for you to adapt massive models to a new task with less compute and less data. But keep in mind that HuggingFace only offers tools for PyTorch. So to quickly recap, when you're looking to define your models, caris stands out for its user-friendly API, offering a highle abstraction that can run on powerful engines like PyTorch and Jax. For more granular control or cutting edge research, PyTorch provides a Pythonic and flexible environment, while Jax excels in high performance numerical computing and automatic differentiation, making them ideal choices for the underlying model definition and training. For inference, which is your primary interaction, tools like Triton Inference Server offer multi-framework support and GPU acceleration for maximum efficiency. TGI is a strong contender specifically for fast LLM deployment with features like continuous batching. And VLM provides an affordable and fast solution for LM serving through techniques like page attention. And for training and fine-tuning, you'll leverage the full capabilities of TensorFlow, PyTorch, and Jax. For efficient adaptation of large models, particularly LLM's hugging faces PFT provides methods like Laura, allowing you to fine-tune with significantly less compute and data, though it currently focuses on PyTorch. Although, don't forget there's no substitute for writing the code and seeing [music] these powerful frameworks in action for yourself. To learn more, check out the link in the description below. Heat. Heat. >> [music]

Original Description

Explore the diverse landscape of AI/ML frameworks, including, PyTorch, JAX, and Keras. This video breaks down what these frameworks are, how they differ, and when to choose one over another for model training, inference, and fine tuning. We cover additional specific purpose frameworks like Nvidia's Triton Inference Server and Hugging Face's TGI and PEFT, providing insights into their strengths for building and deploying efficient AI models. Chapters: 0:00 - Introduction to AI/ML frameworks 0:34 - Defining your models: The builders 0:57 - Keras: The user friendly API 1:30 - PyTorch and JAX: Granular control and performance 2:23 - Inference: putting models to work 3:38 - vLLM for LLM serving 4:13 - Fine tuning: The learning process 4:58 - Conclusion and recap Resources: Keras Overview → https://goo.gle/3JOiCCX PyTorch Overview → https://goo.gle/3LyarLE Get Started with JAX → https://goo.gle/3LUjlTK Get Started with vLLM → https://goo.gle/47xuYbQ Hugging Face PEFT Documentation → https://goo.gle/49MZyzz NVIDIA Triton Inference Server → https://goo.gle/4qTBv8f Subscribe to Google Cloud Tech → https://goo.gle/GoogleCloudTech #GoogleCloud #AIFrameworks Speakers: Duncan Campbell Products Mentioned: AI Infrastructure, JAX, PyTorch, Keras, Cloud TPUs
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Google Cloud Tech · Google Cloud Tech · 0 of 60

← Previous Next →
1 I’m going for it #GoogleCloudCertified
I’m going for it #GoogleCloudCertified
Google Cloud Tech
2 I had to get #GoogleCloudCertified
I had to get #GoogleCloudCertified
Google Cloud Tech
3 Be better overall at what you do #GoogleCloudCertified
Be better overall at what you do #GoogleCloudCertified
Google Cloud Tech
4 Cloud Monitoring on our radar #Analysis #Uptime
Cloud Monitoring on our radar #Analysis #Uptime
Google Cloud Tech
5 Introduction to Generative AI Studio
Introduction to Generative AI Studio
Google Cloud Tech
6 How to use Github Actions with Google's Workload Identity Federation
How to use Github Actions with Google's Workload Identity Federation
Google Cloud Tech
7 Introduction to Responsible AI
Introduction to Responsible AI
Google Cloud Tech
8 Networking updates and CDMC-certified architecture
Networking updates and CDMC-certified architecture
Google Cloud Tech
9 Create and use a Cloud Storage bucket
Create and use a Cloud Storage bucket
Google Cloud Tech
10 How to digitize text from documents
How to digitize text from documents
Google Cloud Tech
11 Faster analytical queries with AlloyDB
Faster analytical queries with AlloyDB
Google Cloud Tech
12 Next ‘23 sessions and FaaS Wave
Next ‘23 sessions and FaaS Wave
Google Cloud Tech
13 Introduction to Assured Open Source Software
Introduction to Assured Open Source Software
Google Cloud Tech
14 BigQuery Cost Optimization: Storage
BigQuery Cost Optimization: Storage
Google Cloud Tech
15 BigQuery Cost Optimization: Compute
BigQuery Cost Optimization: Compute
Google Cloud Tech
16 BigQuery Cost Optimization: Select Queries
BigQuery Cost Optimization: Select Queries
Google Cloud Tech
17 Remote Field Equipment Management with Manufacturing Data Engine
Remote Field Equipment Management with Manufacturing Data Engine
Google Cloud Tech
18 Supercharging your applications with Cloud SQL Enterprise Plus
Supercharging your applications with Cloud SQL Enterprise Plus
Google Cloud Tech
19 Vector Support on our radar #GenAI
Vector Support on our radar #GenAI
Google Cloud Tech
20 Architecting a blockchain startup with Google Cloud
Architecting a blockchain startup with Google Cloud
Google Cloud Tech
21 Kubernetes and multitasking updates!
Kubernetes and multitasking updates!
Google Cloud Tech
22 GKE: Using Kubernetes Events
GKE: Using Kubernetes Events
Google Cloud Tech
23 How to configure firewall rules for Cloud Composer
How to configure firewall rules for Cloud Composer
Google Cloud Tech
24 Vertex AI Embeddings API + Matching Engine: Grounding LLMs made easy
Vertex AI Embeddings API + Matching Engine: Grounding LLMs made easy
Google Cloud Tech
25 Geospatial analytics on our radar #EarthEngine #BigQuery
Geospatial analytics on our radar #EarthEngine #BigQuery
Google Cloud Tech
26 Ensuring requests are set in Kubernetes
Ensuring requests are set in Kubernetes
Google Cloud Tech
27 Cloud Next 2023, Google research program, and more!
Cloud Next 2023, Google research program, and more!
Google Cloud Tech
28 How to migrate projects between organizations with Resource Manager
How to migrate projects between organizations with Resource Manager
Google Cloud Tech
29 How to run #MySQL in Google Cloud
How to run #MySQL in Google Cloud
Google Cloud Tech
30 #GenerativeAI for enterprises and #Next2023
#GenerativeAI for enterprises and #Next2023
Google Cloud Tech
31 How Google Photos scales to store 4 trillion photos and videos
How Google Photos scales to store 4 trillion photos and videos
Google Cloud Tech
32 Google Cross-Cloud Interconnect (Demo 2)
Google Cross-Cloud Interconnect (Demo 2)
Google Cloud Tech
33 GKE Cost Optimization Golden Signals: Introduction
GKE Cost Optimization Golden Signals: Introduction
Google Cloud Tech
34 GKE Cost Optimization Golden Signals: Workload Rightsizing
GKE Cost Optimization Golden Signals: Workload Rightsizing
Google Cloud Tech
35 GKE Load Balancing: Overview
GKE Load Balancing: Overview
Google Cloud Tech
36 GKE Load Balancing: Best Practices
GKE Load Balancing: Best Practices
Google Cloud Tech
37 Disaster Recovery in GKE
Disaster Recovery in GKE
Google Cloud Tech
38 How to configure IP masquerade agent in GKE Standard clusters
How to configure IP masquerade agent in GKE Standard clusters
Google Cloud Tech
39 Enable and use GKE Control plane logs
Enable and use GKE Control plane logs
Google Cloud Tech
40 Compliance in Australia with Assured Workloads
Compliance in Australia with Assured Workloads
Google Cloud Tech
41 Creating budgets and budget alerts in Google Cloud #FinOps
Creating budgets and budget alerts in Google Cloud #FinOps
Google Cloud Tech
42 Cloud SQL Enterprise Plus on our radar #mySQL
Cloud SQL Enterprise Plus on our radar #mySQL
Google Cloud Tech
43 What's Next for Google Cloud?
What's Next for Google Cloud?
Google Cloud Tech
44 How Loveholidays scaled with Contact Center AI
How Loveholidays scaled with Contact Center AI
Google Cloud Tech
45 What is fleet team management in GKE?
What is fleet team management in GKE?
Google Cloud Tech
46 Troubleshoot VPC Network Peering
Troubleshoot VPC Network Peering
Google Cloud Tech
47 Introduction to DocAI and Contact Center AI
Introduction to DocAI and Contact Center AI
Google Cloud Tech
48 Cloud Run Direct VPC egress explained
Cloud Run Direct VPC egress explained
Google Cloud Tech
49 Database deployment options in GKE
Database deployment options in GKE
Google Cloud Tech
50 Analyze cloud billing data with #BigQuery
Analyze cloud billing data with #BigQuery
Google Cloud Tech
51 Tips to becoming a world-class Prompt Engineer
Tips to becoming a world-class Prompt Engineer
Google Cloud Tech
52 Serverless is simple. Do I need CI/CD?
Serverless is simple. Do I need CI/CD?
Google Cloud Tech
53 Accelerating model deployment with MLOps
Accelerating model deployment with MLOps
Google Cloud Tech
54 How Hawaii's Department of Human Services scaled with CCAI
How Hawaii's Department of Human Services scaled with CCAI
Google Cloud Tech
55 Pricing API on our #Radar
Pricing API on our #Radar
Google Cloud Tech
56 How Recommendations AI for Media can boost customer retention
How Recommendations AI for Media can boost customer retention
Google Cloud Tech
57 Troubleshooting: Node Not Ready Status
Troubleshooting: Node Not Ready Status
Google Cloud Tech
58 One weekend until Cloud Next 2023!
One weekend until Cloud Next 2023!
Google Cloud Tech
59 #GoogleCloudNext starts tomorrow!
#GoogleCloudNext starts tomorrow!
Google Cloud Tech
60 #GoogleCloudNext will be demand!
#GoogleCloudNext will be demand!
Google Cloud Tech

This video introduces the landscape of AI/ML frameworks, covering their definitions, differences, and use cases for model training, inference, and fine-tuning. It highlights the trade-offs between frameworks like PyTorch, JAX, and Keras, and showcases specialized frameworks like Nvidia's Triton and Hugging Face's TGI.

Key Takeaways
  1. Define models using Keras
  2. Train models with PyTorch and JAX
  3. Deploy models for inference with Triton and TGI
  4. Fine-tune pre-trained models with Hugging Face's PFT
💡 The choice of AI/ML framework depends on the specific use case, with Keras offering a user-friendly API, PyTorch providing a flexible environment, and JAX excelling in high-performance numerical computing.

Related Reads

Chapters (8)

Introduction to AI/ML frameworks
0:34 Defining your models: The builders
0:57 Keras: The user friendly API
1:30 PyTorch and JAX: Granular control and performance
2:23 Inference: putting models to work
3:38 vLLM for LLM serving
4:13 Fine tuning: The learning process
4:58 Conclusion and recap
Up next
RNNs Explained in 60 Seconds #ai #coding #machinelearning
Ascent
Watch →