Smarter Queues, Faster Science with a Workflow Optimization Agent: How Agentic AI Is Optimizing HPC Pipelines

How ML models trained on your scheduler's own accounting history find the waste on a shared HPC cluster and predict the CPU, memory and runtime each job really needs.

Smarter queues, faster science: how agentic AI is optimizing HPC pipelines. A job's requested versus actually used CPU, memory and runtime, with a right-sized recommendation

On almost every shared HPC cluster, the same quiet problem is costing money every day: jobs ask for far more than they use.

It's completely understandable. A researcher who has watched a job die at hour 30 because it ran out of memory will never make that mistake again, so the next request asks for double. Multiply that caution across hundreds of users and thousands of jobs, and you get a cluster that looks full on paper while CPUs sit idle and memory goes untouched.

The result is familiar to every research computing team: long queues, jobs waiting for resources that other jobs reserved and never used, and a cloud or hardware bill that keeps growing faster than the science.

The cluster isn't too small. The requests are too big.

At Clovertex, we built a Workflow Optimization agent to close that gap, using the most underused dataset in research computing: the scheduler's own accounting history.

The problemWhy over-allocation is so hard to fix

Everyone agrees that right-sizing jobs is a good idea. It rarely happens, because:

  • Users can't see the gap. Most researchers never compare what they requested with what their job actually consumed.
  • The cost of under-asking is visible; the cost of over-asking isn't. A failed job is painful and personal. Wasted capacity is spread across everyone in the queue.
  • Generic rules don't fit real workflows. An alignment step, a variant caller and a training run have completely different profiles, and they change with input size.
  • Administrators lack evidence. Without data on which workflows and users drive waste, every conversation about resource requests is a matter of opinion.

The approachFrom accounting logs to right-sized jobs

How value flows: SGE and UGE accounting files feed DuckDB analytics, which train models in an ML model registry, which produce right-sized CPU, memory and runtime recommendations, served through a Streamlit dashboard, FastAPI service and command-line workflow
Accounting files become analytics, analytics train models, and deployed models produce right-sized recommendations.

Every job a scheduler runs leaves a record: what was requested, what was used and how long it took. The Workflow Optimization agent turns that record into recommendations in four steps.

  1. Accounting files. The agent ingests SGE and UGE accounting data: the full history of what every job asked for and actually consumed.
  2. DuckDB analytics. That history lands in DuckDB, a fast analytical database, where the agent surfaces wasteful workflows and users, efficiency trends over time, and the cost impact of over-allocation.
  3. ML model registry. The same data trains multi-output machine learning models that predict CPU, memory and runtime together. Teams compare algorithms and deploy the best performer to a model registry.
  4. Recommendations. Deployed models produce right-sized recommendations for each job, explainable to the users who submit them and the administrators who run the cluster.

The agent meets people where they work: a Streamlit dashboard for exploring waste and trends, a FastAPI service for plugging recommendations into submission tools and portals, and a command-line workflow for the users and admins who live in the terminal.

Step 1See where the waste really is

Before predicting anything, the agent answers the questions administrators have always wanted answered with data instead of instinct:

Wasteful workflows

Which pipelines consistently request far more than they use.

Wasteful users

Where coaching or better defaults would make the biggest difference.

Efficiency trends

Whether utilization is getting better or worse over time.

Cost impact

What the over-allocation is actually worth, in terms finance understands.

That evidence changes the conversation. Instead of asking everyone to "request less", teams can focus on the specific workflows and users where right-sizing pays off most.

Step 2Predict what each job really needs

The heart of the agent is its prediction models. Rather than predicting each resource separately, they're multi-output models that predict CPU cores, memory and runtime together, because the three are closely related: more cores usually means less time, and bigger inputs need more of everything.

Prediction logic: an incoming job is sized by the trained ML model; if the model has no coverage, the service falls back to workflow history, then user history, then conservative defaults, always producing a CPU, memory and runtime recommendation
Always an answer, never a wild guess. Job details and values shown are illustrative.

Models only know what they've seen, though. A brand-new workflow or a first-time user may have no model coverage at all. So the service never leaves anyone without guidance. When the model can't answer, it falls back in a clear order:

1. The trained model

Best estimate

A multi-output prediction of CPU, memory and runtime, learned from the cluster's own history.

2. Workflow history

Fallback

How this particular workflow has behaved in past runs.

3. User history

Fallback

How this user's jobs typically behave.

4. Conservative defaults

Safety net

Safe sizing that protects the job from failing.

Reducing waste without risking jobs

The goal isn't to squeeze every job to the bone. It's a practical recommendation that reduces waste while protecting job success. Users get the confidence to ask for less; platform teams get fewer oversized requests and better utilization.

Step 3Governance over optimization

Governance loop: administrators train and compare models, deploy the best, monitor impact and keep models aligned with cluster changes, delivering confidence for users, fewer oversized requests, better queue behavior and clearer cost impact
Administrators stay in control of the models, and recommendations stay tied to live cluster behavior.

A recommendation engine that nobody controls is a risk, not a tool. So the agent puts administrators firmly in charge of the models behind it:

  • Train and compare several algorithms side by side on the cluster's own data
  • Deploy the best model to the registry, and keep recommendations active as models improve
  • Monitor impact on waste, queue behavior and cost over time
  • Stay aligned with live cluster behavior as workloads, hardware and users change

That's the difference between a one-off efficiency report and lasting optimization: the models keep learning from the cluster they serve, under the control of the people responsible for it.

The outcomeWhat teams get

Less over-allocation

The same cluster runs more work, because reserved resources are actually used.

Better queue behavior

Right-sized jobs schedule sooner and free capacity for everyone else.

Clearer cost impact

Waste is measured by workflow and user, so savings are visible and defensible.

Explainable recommendations

Both users and administrators can see why a job was sized the way it was.

What's nextYour scheduler already knows the answer

Most HPC teams are sitting on years of accounting data that could tell them exactly how their workflows behave. Workflow Optimization puts that history to work: it finds the waste, predicts what each job really needs, and keeps those predictions honest under administrator control.

And because the same right-sizing insight carries over to the cloud, it's also the foundation for sizing workloads well when they move to managed HPC services, whether on AWS or Google Cloud.

If your queues are long, your utilization is low, or you suspect your cluster is busier on paper than in practice, we'd be glad to show you what your own accounting data says.

#HPC#WorkflowOptimization#MachineLearning#FinOps#ResearchComputing#SGE#DuckDB#AgenticAI#ScientificComputing#Clovertex
Keep Reading

More from the Clovertex blog

Let's Talk

Is your cluster busier on paper than in practice?

Let's look at what your own scheduler accounting data says about waste, queues and cost.