Enjoying this issue?
Get tomorrow's AI & engineering digest in your inbox — hand-picked, summarized, and always spam-free.
TLDR
DigitalOcean's optimization agent improved token throughput by 17.5% for GPT-OSS and doubled it for DeepSeek R1 Distill while cutting ITL in half, using Bayesian optimization via Optuna to automatically search over LLM serving configurations. The agent automates the tuning process, reducing the time needed to find optimal settings compared to manual trial and error.
Key points
The agent uses Optuna's Bayesian optimization to search over LLM serving parameters.
The user provides the starting YAML, hardware, and number of trials.
The agent outputs an optimized YAML config and an HTML report.
For GPT-OSS, the agent improved token throughput by 17.5% over the default config.
For DeepSeek R1 Distill, the agent doubled token throughput and reduced ITL by half.
Tools mentioned
Techniques
- Bayesian optimization
Stop scrolling. Start reading smarter.
Receive the day's most important AI & engineering updates in one concise email. No spam.
Transcript (captions)
All right. Hello everyone. So, my name is Rohan and this is a quick demo on the optimization agent that what has been recently built. So, a quick intro into what the purpose is and what the goal is
of this agent and then I'll get into a brief demo and results that from a previous run that we just did. So, what the goal is here is to build an agent that helps
find the best VLM serving config for any given model. The purpose is to reduce the time it takes to manually find the best configs and the VLM
serving recipe and if we can automate this and have it run in the background and have the agent find the recipes and the optimized parameters faster then it will
save a lot of time. So, that's the goal of the agent and a little bit more into how the agent actually does this. So, the strategy that the agent uses is called Bayesian optimization
and Bayesian optimization is a technique that's used to find the most optimal numbers in any given situation. So, in our situation it's to find the optimal numbers in these VLM
recipe. It uses mathematical steps that essentially minimizes the search space. So, by minimizing the search space it reduces a lot of the time that it takes
in finding the optimized numbers in this recipe during the run. So, BO Bayesian optimization is a strategy that is used but Optuna is the tool that uses a strategy in the search loop. So, Optuna
uses Bayesian optimization. It feeds it the current recipe, the starting recipe. Bayesian optimization runs on that and over many iterations or many trials it eventually finds the optimized recipe
and Optuna basically takes each recipe after every trial, assesses it, gets a score, uses a strategy to change the recipe, improve and then it reruns it within the
uh search loop um until the trials is done. So let's go a little bit into how we do this. So um currently in a droplet here and this droplet for example has GPT OSS
120B model uh loaded up. So what we can do is uh we can look at the current
um recipe. So what we see here is four regimes, right? That we're testing it on. So there's chat short, there's chat long, there's rag and batch classify. Uh they have their own set of ISO OSL
tokens that we're feeding it through. Uh all these um can be changed depending on what uh we want to see. But essentially this is the starting config, starting recipe that you would get when you
download the weights of the model. Um so moving on, once you have the model downloaded in your droplet and you are ready to run this agent, you paste in
this command uh which essentially tells you you know where the where where the weights are coming from, um activate a virtual environment and have um
uh or not have but run the script called tuner.py. Uh this script essentially tells you or it it has a couple of things you have to tell it. So you you
want to give it the name of the study. You want to tell it the starting YAML file which we just saw above here. You want to tell it the hardware that it's running on and you want to tell it the
number of trials that you want. So uh in this example we have 24. Um briefly I'll show you another example of a past run that was run uh that had only nine trials. So
um anyway uh this is the command that's that's run. Uh typically these commands take um a couple hours to run. I think for the
GPT OSS it took about four or five hours and then for the other model it took a couple of hours as well. So we can go into the HTML report that's generated after the
uh agent finishes its work. So this one is for the GPT-OSS model that I mentioned. Uh what what we see in the HTML report is which trial number was the best trial
out of the total of how many trials. So in this case it was 50 trials. Uh you get so at the end of the run you get an optimized YAML file which includes all the numbers that we
currently look for in the BLM serving recipe. So in this case we found or the agent found that 256 was the optimized number so on and so forth. And the way that it's getting the accuracy is the
amount of good put tokens that's being generated. So overall we found that from the first config we had an improvement of 17.5% in terms of tokens generated. And
this one as I mentioned is for GPT-OSS. We have another HTML report here which is for the DeepSeek R1 Distill model. In here we found that or in here we had nine trials that was run and out of the
nine the ninth one was the best. Uh we found that token throughput doubled and ITL was improved by almost half aka it was reduced by almost half. So this is a quick intro and brief demo
on the commands you run and what the output looks like. In in in general you get a HTML report that tells you um how each trial went and then you also get um a YAML file that has the optimized
recipe at the end of the day. So hopefully that was helpful. Thank you.