Model Optimization in Microsoft Foundry: Deployment and Evaluations

Microsoft Developer · Advanced ·📰 AI News & Updates ·3mo ago

Key Takeaways

The video covers model optimization in Microsoft Foundry, focusing on deployment and evaluations of fine-tuned models, including cost management and custom grader logic for production-grade reliability.

Full Transcript

On to my favorite part, production. Before we take our model to production, the things we have to do, right? We have to do evaluation to make sure the model does what it's supposed to do. And we already saw the statistics in terms of during finetuning, we're able to reduce the loss and also increase the accuracy of our model. But then now, how do you evaluate the model is doing as it's supposed to do? I'll show you two demos on that. And then we also have to think about deployment. How do you deploy this models? What are the different deployments options? And you want to deploy in production. How much will it cost? So the last thing will be cost management. What should you look out for when you're fine tuning Azure OpenI models in Microsoft Foundry in terms of cost? So let's get started with evaluation. First things first is in terms of evaluations and one of the best places you'll want to explore evaluations is in the fine tuning process itself. So we have the details the monitor and the logs and we check out your logs. You'll realize that it has the model evaluation passed. That means there's evaluation being done during the finetuning process to just make sure it's safe. It's not violating any policy. Right? And then the next thing will be for the agentic tool calling we have a custom grader for us. So this is a custom grader that tries and create a function a python function that uses precision and recall to calculate the f1 score of our model. So for example if um how many pass exact matches were there how many had only name only matches and then we try and see what the precision is what the recall is and calculate the F1 score and with that we round it off and we give our model a score right so for this we will have that grader by the back of your mind so we'll come in and evaluate the GP41 model the 41 mini and the one that we've already fine- tuned. For the evaluation, we'll be using the Python grader that I just already showcased. Then we'll just use our retails tools JSON file to give it the definition of the different tools that we have. And once you've already configured all that, we'll have our faint tuning job running in the cloud. You'll see the evaluation will take a bit of time. So it will take about for for this it took about 44 minutes 11 seconds for the evaluations to be done but it now depends with um the different metrics you've set and also how the grader works that will now determine the time it takes for completion. Once that's done you will be able to see our evaluation output the metrics. So we can also see the same in foundry. So I'll just select the evaluation that we already done and you'll be able to see what the rates are for the difference ones. So you've seen we just use a small data set that's only 100 values and you see the increase for tool calling is about 6% from 59 to 65 which is not bad considering GPT4 is at 74%. So you can see that improvement that we've been able to make. So at the back of your head, you might be wondering how much that does all this cost. Head over to the Microsoft Azure pricing page for OpenAI and you can search. This is the easts region. So you can search depending on the region you're in. So let's say Sweden central, you'll find the fine tuning models. So for reinforcement fine tuning, this is the cost. So it cost probably uh if you're training per hour this will be the cost and then the inputs and the outputs tokens that also counts into the cost right and then also you have to think about hosting. So how much does it cost to host your model? And this is the other thing you also have to think about is how you doing your training, right? You can do your training in a very specific region or globally depending on whichever region you're in. So it just goes to where there is compute or you can use the developer training where this is where you wait for compute to be available for your training to take place. Right? So the other thing you need to do is uh remember for different models this is O4 mini which has reinforcement when tuning for this other different models supervised fine tuning. So for supervised fine tuning, it only takes the input and the output tokens and then the trading uh depending on now where you're located. You can see the it decreases depending on like the size of the model like GPD4 is cheaper and 41 nano is a lot cheaper as well. And then you also still have GPD 4 and 4 mini available for the time being. And yeah, that's basically how you can be able to figure out your cost for training. So, for example, if you're training on developer, you will only it will only cost you $12 per million tokens. But then the other thing you should know is when you're deploying, you can see in global and regional, all of them have hosting charges. But when you're deploying using the developer TM, it does not cost you anything. But then you can only deploy it for only 24 hours. So let's go back and see how you can deploy using developer t. Once you've looked at the options, we'll go back to our model and click on deploy. For this, we'll deploy using the developer tier because we're just experimenting. [snorts] And then we can also try and see how many tokens we want. So depending on now the amount of work it does, you can click on deploy. Once you found the right token limit for you, right, it will take a while for deployment to take place. And you can see it's already creating. Once it's done, you'll be able to use a model.

Original Description

Validate and launch your customized models seamlessly using Microsoft Foundry! In this installment, we tackle what happens after the training is complete. You'll learn how to deploy fine-tuned models effectively, manage long-term inference costs, and rigorously evaluate your model's performance post-training using a custom grader logic to ensure production-grade reliability. 00:03 Welcome and scenario 00:52 Post-training evaluation 01:20 Demo: Using a custom grader for evaluations 03:35 Cost management 05:50 Model deployment Microsoft Foundry - https://aka.ms/foundry-ft Foundry Finetuning Demos on GitHub - https://aka.ms/ft-demos Azure OpenAI Fintuning Costs: https://aka.ms/aoai-ft-cost Bethany Jepchumba, Twitter/X - https://twitter.com/bethanyjep Bethany Jepchumba, LinkedIn - https://www.linkedin.com/in/bethany-jep/ Bethany Jepchumba, GitHub - https://github.com/bethanyjep
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Microsoft Developer · Microsoft Developer · 0 of 60

← Previous Next →
1 Prepare for the DP-300 exam & the Azure Database Administrator Associate cert | Data Exposed
Prepare for the DP-300 exam & the Azure Database Administrator Associate cert | Data Exposed
Microsoft Developer
2 What I Wish I Knew ... about landing a job in tech
What I Wish I Knew ... about landing a job in tech
Microsoft Developer
3 Igniting Developer Innovation with Vector Search
Igniting Developer Innovation with Vector Search
Microsoft Developer
4 Combining the power of vector search with Azure OpenAI then revolutionize image search with vectors!
Combining the power of vector search with Azure OpenAI then revolutionize image search with vectors!
Microsoft Developer
5 What I Wish I Knew ... about finding your place in tech
What I Wish I Knew ... about finding your place in tech
Microsoft Developer
6 Fluent UI React Insights: Accessible by default
Fluent UI React Insights: Accessible by default
Microsoft Developer
7 Signing Container Images with Notary Project
Signing Container Images with Notary Project
Microsoft Developer
8 What I Wish I Knew ... about finding your place in tech
What I Wish I Knew ... about finding your place in tech
Microsoft Developer
9 What programming languages does GitHub Copilot support?
What programming languages does GitHub Copilot support?
Microsoft Developer
10 What I Wish I Knew ... about how much your job can change
What I Wish I Knew ... about how much your job can change
Microsoft Developer
11 What I Wish I Knew ... about how much your job can change
What I Wish I Knew ... about how much your job can change
Microsoft Developer
12 How do I become more confident about AI?
How do I become more confident about AI?
Microsoft Developer
13 How do I become more confident about AI?
How do I become more confident about AI?
Microsoft Developer
14 Performance Demos of SQL’s Intelligent Query Processing Feedback capabilities | Data Exposed
Performance Demos of SQL’s Intelligent Query Processing Feedback capabilities | Data Exposed
Microsoft Developer
15 What I Wish I Knew ... about coming to Microsoft
What I Wish I Knew ... about coming to Microsoft
Microsoft Developer
16 What I Wish I Knew ... about coming to Microsoft
What I Wish I Knew ... about coming to Microsoft
Microsoft Developer
17 Revolutionizing Image Search with Vectors
Revolutionizing Image Search with Vectors
Microsoft Developer
18 Igniting developer innovation with Vector search and Azure OpenAI
Igniting developer innovation with Vector search and Azure OpenAI
Microsoft Developer
19 Getting Started with Azure AI Studio's Prompt Flow - Part 2
Getting Started with Azure AI Studio's Prompt Flow - Part 2
Microsoft Developer
20 What I Wish I Knew ... about finding my career path
What I Wish I Knew ... about finding my career path
Microsoft Developer
21 What I Wish I Knew ... about finding my career path
What I Wish I Knew ... about finding my career path
Microsoft Developer
22 Windows Terminal's journey to Open Source
Windows Terminal's journey to Open Source
Microsoft Developer
23 Can I trust the code that GitHub Copilot generates?
Can I trust the code that GitHub Copilot generates?
Microsoft Developer
24 What I Wish I Knew ... about interviewing
What I Wish I Knew ... about interviewing
Microsoft Developer
25 What I Wish I Knew ... about interviewing
What I Wish I Knew ... about interviewing
Microsoft Developer
26 What is the Microsoft TechSpark Program?
What is the Microsoft TechSpark Program?
Microsoft Developer
27 SQL Server 2022: Accelerate query performance while reducing query compile time - w/ no code changes
SQL Server 2022: Accelerate query performance while reducing query compile time - w/ no code changes
Microsoft Developer
28 What I Wish I Knew ... about discovering computer science
What I Wish I Knew ... about discovering computer science
Microsoft Developer
29 What I Wish I Knew ... about discovering computer science
What I Wish I Knew ... about discovering computer science
Microsoft Developer
30 Call center transcription and analysis using Azure AI
Call center transcription and analysis using Azure AI
Microsoft Developer
31 How to use Text Analytics for health in Azure AI Language
How to use Text Analytics for health in Azure AI Language
Microsoft Developer
32 Azure OpenAI-powered summarization in Azure AI Language
Azure OpenAI-powered summarization in Azure AI Language
Microsoft Developer
33 Accelerate data labeling using Azure OpenAI and Azure AI Language
Accelerate data labeling using Azure OpenAI and Azure AI Language
Microsoft Developer
34 Building a Private ChatGPT with Azure OpenAI
Building a Private ChatGPT with Azure OpenAI
Microsoft Developer
35 What I Wish I Knew ... about how to interview
What I Wish I Knew ... about how to interview
Microsoft Developer
36 What I Wish I Knew ... about how to interview
What I Wish I Knew ... about how to interview
Microsoft Developer
37 Getting Started with Azure AI Studio's Prompt Flow - Part 3
Getting Started with Azure AI Studio's Prompt Flow - Part 3
Microsoft Developer
38 Intelligent Apps with Azure Kubernetes Service (AKS)
Intelligent Apps with Azure Kubernetes Service (AKS)
Microsoft Developer
39 Getting Started with Azure Blob Storage | Data Exposed: MVP Edition
Getting Started with Azure Blob Storage | Data Exposed: MVP Edition
Microsoft Developer
40 Chat + Your Data + Plugins
Chat + Your Data + Plugins
Microsoft Developer
41 What I Wish I Knew ... about different career paths
What I Wish I Knew ... about different career paths
Microsoft Developer
42 What I Wish I Knew ... about different career paths
What I Wish I Knew ... about different career paths
Microsoft Developer
43 Advanced Dev Tunnels Features | OD122
Advanced Dev Tunnels Features | OD122
Microsoft Developer
44 Learn Live - Manage performance and availability in Azure Cosmos DB for PostgreSQL
Learn Live - Manage performance and availability in Azure Cosmos DB for PostgreSQL
Microsoft Developer
45 Plan your SQL Migration to Azure with confidence | Data Exposed
Plan your SQL Migration to Azure with confidence | Data Exposed
Microsoft Developer
46 What I Wish I Knew ... about social skills in a tech career
What I Wish I Knew ... about social skills in a tech career
Microsoft Developer
47 What I Wish I Knew ... about social skills in a tech career
What I Wish I Knew ... about social skills in a tech career
Microsoft Developer
48 All About Vectors, Search, and Function Calling in Azure OpenAI - Labor Day Special
All About Vectors, Search, and Function Calling in Azure OpenAI - Labor Day Special
Microsoft Developer
49 Introduction to project ORAS
Introduction to project ORAS
Microsoft Developer
50 What I Wish I Knew ... about finding the right major
What I Wish I Knew ... about finding the right major
Microsoft Developer
51 What I Wish I Knew ... about finding the right major
What I Wish I Knew ... about finding the right major
Microsoft Developer
52 What I Wish I Knew ... about how to approach programming
What I Wish I Knew ... about how to approach programming
Microsoft Developer
53 What I Wish I Knew ... about how to approach programming
What I Wish I Knew ... about how to approach programming
Microsoft Developer
54 Learn Live - Scale from a single node to multiple nodes with Azure Cosmos DB for PostgreSQL
Learn Live - Scale from a single node to multiple nodes with Azure Cosmos DB for PostgreSQL
Microsoft Developer
55 What I Wish I Knew ... about diversity in tech #1
What I Wish I Knew ... about diversity in tech #1
Microsoft Developer
56 What I Wish I Knew ... about diversity in tech #1
What I Wish I Knew ... about diversity in tech #1
Microsoft Developer
57 Get started with SQL Server AGs across Windows, Linux and Container Replicas | Data Exposed
Get started with SQL Server AGs across Windows, Linux and Container Replicas | Data Exposed
Microsoft Developer
58 Writing LLM Apps with Azure AI and PromptFlow
Writing LLM Apps with Azure AI and PromptFlow
Microsoft Developer
59 What I Wish I Knew ... about how cool working in tech could be
What I Wish I Knew ... about how cool working in tech could be
Microsoft Developer
60 Open Source foundation models in Azure Machine Learning & optimization techniques behind the scenes
Open Source foundation models in Azure Machine Learning & optimization techniques behind the scenes
Microsoft Developer

This video teaches how to deploy and evaluate fine-tuned models in Microsoft Foundry, including cost management and custom grader logic for production-grade reliability. Viewers will learn how to effectively deploy models, manage long-term inference costs, and rigorously evaluate model performance. The video provides a demo of using a custom grader for evaluations and discusses cost management strategies.

Key Takeaways
  1. Deploy fine-tuned models using Microsoft Foundry
  2. Evaluate model performance using a custom grader logic
  3. Manage long-term inference costs
  4. Use Azure OpenAI for finetuning and cost estimation
  5. Implement production-grade reliability measures
💡 Using a custom grader logic can help ensure production-grade reliability for fine-tuned models

Related Reads

Chapters (5)

0:03 Welcome and scenario
0:52 Post-training evaluation
1:20 Demo: Using a custom grader for evaluations
3:35 Cost management
5:50 Model deployment
Up next
Why India Needs a New Kind of Hardware Engineer | Kunal Ghosh, Co-Founder at VSD | Scaler Pod
SCALER
Watch →