Migrating LLM Fine-tuning Workflows from Slurm to Kubernetes Using Metaflow and Argo

adept.ai · Tech · 2023 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: LLM fine-tuning and evaluation infrastructure

Adept needed to make LLM training, fine-tuning, evaluation, CI/CD, and infrastructure-monitoring workflows self-serve while gradually moving from a Slurm-centered stack toward Kubernetes without slowing data scientists.

Constraints:

Architecture

Adept put Metaflow plus Argo Workflows on Kubernetes in front of its Slurm training environment. Metaflow packages the workflow DAG and provides Python-flow ergonomics, Argo executes the workflow layer on Kubernetes, and each step temporarily SSHes into a Slurm bastion to run the real srun/sbatch workload. The team also built internal CLI affordances, Slack notifications, links to Slurm job logs, experiment-platform links, CircleCI-driven container builds, and Metaflow/Argo workflow recreation on merge to main. The result is a hybrid orchestration layer that lets users launch fine-tune/eval and nightly workflows now while the infrastructure team gradually moves workloads to fully containerized Kubernetes execution.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  CLI["Internal Adept CLI"] --> Metaflow["Metaflow flows"]
  Metaflow --> Argo["Argo Workflows"]
  Argo --> K8s["Kubernetes cluster"]
  Metaflow --> Bridge["Slurm bastion bridge"]
  Bridge --> Slurm["Slurm training cluster"]
  Circle["CircleCI deployment"] --> Images["Container images"]
  Circle --> Metaflow
  Images --> K8s
  Metaflow --> Obs["Observability notifications"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Internal Adept CLI Developer-facing launcher that abstracts Metaflow commands and prints links to underlying Slurm job logs. Metaflow flows
Metaflow flows Python-defined workflow DAG layer for fine-tuning, evaluation, nightlies, monitoring, and housekeeping. Internal Adept CLI, Argo Workflows, Slurm bastion bridge, CircleCI deployment
Argo Workflows Kubernetes-native workflow executor used by Metaflow for robust orchestration. Metaflow flows, Kubernetes cluster
Kubernetes cluster Container orchestration platform for workflow execution, CI/CD direction, and future training workloads. Argo Workflows, Container images
Slurm bastion bridge Hybrid stopgap where Metaflow steps SSH into Slurm and run srun or sbatch commands. Metaflow flows, Slurm training cluster
Slurm training cluster Existing GPU execution environment for fine-tuning, training, and dev-node workloads. Slurm bastion bridge
CircleCI deployment CI/CD path that builds containers and recreates Metaflow Argo workflows on main-branch merges. Container images, Metaflow flows
Observability notifications Slack messages, dashboards, experiment-management links, and Slurm log links exposed to data scientists. Metaflow flows
Container images PyTorch/NVIDIA-based images built per commit with dependencies for workflows, dev boxes, CI/CD, and future Kubernetes training. Kubernetes cluster, CircleCI deployment

Data flow

A data scientist launches a Metaflow flow, often through an internal Adept CLI. Metaflow packages the flow DAG and Argo runs the workflow on Kubernetes. During the hybrid phase, each workflow step SSHes into a bastion on the Slurm cluster and runs the underlying srun or sbatch command. Long-running fine-tune steps freeze a model and fan out to evaluation tasks, while Slack messages, logs, experiment links, and Slurm job-log links make the hidden execution observable.

3 supporting quotes
“Metaflow flows where will will be the orchestration system and each step will SSH into the bastion node on our Slurm cluster and runs the Srun command”transcript, stated
“workflows is back like what how what are the workflows? What is the ordering of the nodes? What is the DAG look like? That is done by Metaflow.”transcript, stated
“In each of these steps, we are sending Slack messages saying, "Hey, how did this step work?" We are showing dashboards on logs.”transcript, stated

Why this architecture

Metaflow plus Argo gave Adept a Kubernetes-native workflow layer without requiring immediate migration of Slurm execution. That let the infra team improve self-service, observability, nightlies, and CI/CD while preserving training velocity for data scientists. The hybrid bridge is explicitly a stopgap toward full Kubernetes containerized workloads.

3 supporting quotes
“we wanted to keep supporting that without having to say, "Hey, it's going to take some time. Let's just switch everything to Kubernetes."”transcript, stated
“it was like a hey, temporarily we're going to have a middle ground wherein we are using some stuff on Kubernetes and some stuff on Slurm”transcript, stated
“The end goal is the right workflow.”transcript, stated

Models used: Adept computer-use agent model · fine-tuned LLMs · evaluation datasets for browser action types

Scale

Alternatives considered (roads not taken)

Continue with fragmented Slurm entry points

Rejected because: Self-serve fine-tuning became too complex as config loading, workflow entry points, and execution conventions diverged.

“creating these self-serve fine-tuning pipelines where you could change around the steps was getting too complex.”transcript, stated
“there was a training file that, uh, loaded a config which might have some hyper parameters, set some logic, and then call a call on the Slurm as batch command”transcript, stated

Force an immediate full Kubernetes migration

Rejected because: The team needed to keep existing Slurm-backed fine-tuning velocity while code cleanup and containerization were still in progress.

“we wanted to keep supporting that without having to say, "Hey, it's going to take some time. Let's just switch everything to Kubernetes."”transcript, stated
“what we really want to do is to run fully containerized workloads on Kubernetes. And that is a work in progress.”transcript, stated

Use a workflow alternative with custom orchestration

Rejected because: Adept was more comfortable with Metaflow because it used Argo, a robust Kubernetes-native orchestration system.

“The alternative has their own custom orchestration and it might be great, but for for our design perspective, we were more comfortable choosing the first one.”transcript, stated
“Argo being a very robust, battle-tested um um appro- like work workflow orchestration system, we wanted to use Metaflow with this.”transcript, stated

Patterns

durable-execution (workflow)

Metaflow and Argo provide a DAG-based workflow layer for fine-tune/eval, nightlies, monitoring, and housekeeping jobs.

“because of our combination of using Argo and Metaflow, we have workflows for everyone.”transcript, stated
“one very big popular one for which, you know, uh uh the the DAG approach is is super good wherein is is a fine-tuning eval flow.”transcript, stated

fine-tuning-adaptation (model_optimization)

The platform exists to let users run fine-tuning jobs and nightly fine-tune/eval workflows self-serve.

“So, to conclude, Metaflow plus Argo on Kubernetes works well. The wins were users can launch fine-tuned jobs, self-serve.”transcript, stated

eval-driven-development (evaluation)

Fine-tuned models are frozen and evaluated across action-type datasets, with nightly and programmatic evaluation workflows.

“We freeze the model so that it can be, uh, used for eval.”transcript, stated
“we have different, uh, eval data sets for different type of actions that uh, the the the the agent can do.”transcript, stated

observability-tracing (operations)

The workflow layer sends Slack updates, exposes dashboards/logs, links to experiment management, and monitors Slurm jobs and zombie workflows.

“what's happening behind the scenes is we have a complex, uh, way of providing observability to our data scientists on how their jobs are.”transcript, stated
“we monitor Slurm jobs, detect long-running workflows, detect zombies workflows, completed workflows, and so on.”transcript, stated

batch-offline-processing (workflow)

The system runs long fine-tuning jobs, nightly jobs, training runs, monitoring workflows, and housekeeping tasks asynchronously.

“there's some nightly jobs that we run for different types of tasks.”transcript, stated
“we also using Metaflow to trigger our housekeeping jobs.”transcript, stated

canary-rollout (deployment)

Workflow definitions are recreated automatically on merge to main through CI/CD rather than manually updated.

“if since it is a merge to main, then please uh you know, deploy the nightlies.”transcript, stated
“every time there's a merge on main, we can do some update our nightly workflows automatically.”transcript, stated

Tradeoffs

Use a hybrid Slurm/Kubernetes bridge

Chose Metaflow and Argo orchestrating steps that SSH into Slurm over Blocking users until all training workloads ran natively on Kubernetes.

Rationale: The hybrid bridge preserved data-science velocity while the team untangled legacy code and moved toward full Kubernetes execution.

“without without compromising on the velocity or having people slow down.”transcript, stated
“this this approach here is a stopgap measure before we migrate everything to Kubernetes.”transcript, stated

Choose Metaflow because it used Argo

Chose Metaflow with Argo Workflows on Kubernetes over An alternative workflow tool with custom orchestration.

Rationale: Adept trusted Argo's Kubernetes-native, battle-tested workflow execution more than a custom orchestration layer.

“Metaflow, one of the things we really liked was it was using Argo as a workflow orchestration system.”transcript, stated
“Argo being a very robust, battle-tested um um appro- like work workflow orchestration system”transcript, stated

Own container builds instead of relying only on Metaflow packaging

Chose Custom PyTorch/NVIDIA-based images built for multiple infrastructure uses over Using Metaflow packaging alone for the legacy codebase.

Rationale: The legacy dependencies were not easily packageable, and the team wanted one containerization approach for workflows, dev boxes, CI/CD, and future gang-scheduled training.

“Metaflow's packaging system does take care of it. We had to do it because a lot of our code was depend like the dependencies were not easily packageable directly.”transcript, stated
“We also want to support dev we also want to support CICD, we also want to support training with gang scheduling on Kubernetes”transcript, stated

Gotchas (what bit them)

Workflow modernization stalls if legacy code and config paths are tangled.

Root cause: Training, fine-tuning, and nightly jobs had multiple configs, entry points, and loading patterns from different contributors.

Resolution: The team spent sprints refactoring logical workflow steps and normalizing config loading for Metaflow containerization.

“Challenge number one was that code was too complex and the config files that I showed in the couple of slides before were in multiple locations”transcript, stated
“it took us like about a couple of sprints to untangle the code into like, "Hey, what are the logical steps that we can plug into the steps approach”transcript, stated

Hybrid orchestration can hide the real execution environment from users.

Root cause: Metaflow and Argo logs describe the container layer, but the actual training still runs through SSH into Slurm.

Resolution: The internal CLI prints Slurm job IDs and log links, while workflow steps expose notifications and experiment-management links.

“in the UI and both Argo as well as Metaflow, you can see the logs of the container, but what's actually happening is we're SSHing into Slurm and running it there.”transcript, stated
“what is the Sbatch job that was run and where can you go and check out its logs?”transcript, stated

Large ML repositories make per-commit container execution expensive.

Root cause: Historical Git LFS usage stored model versions or data in the repo, growing it to about 1 GB.

Resolution: Adept reduced the repository size, removed data and dead code, and built PyTorch/NVIDIA-based containers per commit.

“we had to bring it like reduce the size of the code, remove all the data, remove all the dead code and so on.”transcript, stated
“every time you have a commit, we build a container.”transcript, stated

Resource shortages still crashed large workflows instead of queueing them.

Root cause: The system lacked queueing for flows when requested Slurm resources were unavailable.

Resolution: Queue management was identified as a desired feature for future work.

“queues for flows of resources are not available. So, sometimes somebody launches like a 32-node job and we don't have 32 nodes right now and that crashes.”transcript, stated

Evaluation

Adept evaluated the platform operationally through self-serve launchability, fine-tune/eval DAGs, action-type evaluation datasets, Slack/log/experiment observability, nightly training, CI/CD workflow recreation, and infrastructure monitoring workflows.

Metrics: self-serve launch of fine-tune jobs · 1-3 hour fine-tuning steps completing inside flows · evaluation datasets for browser action types · nightly 32-node training runs · long-running and zombie Slurm job detection · workflow recreation on merge to main

3 supporting quotes
“The wins were users can launch fine-tuned jobs, self-serve.”transcript, stated
“We are showing our links to our experiment management platform, wherein you can see how the fine-tuning loss curves are working”transcript, stated
“we monitor Slurm jobs, detect long-running workflows, detect zombies workflows, completed workflows, and so on.”transcript, stated

Outcomes

The transcript cites 16-node jobs with 8 GPUs each, possible 200-300 node clusters with 8 GPUs per node, 32-node nightly training equivalent to about 240 GPUs, and fine-tuning steps lasting 1-3 hours.

3 supporting quotes
“Metaflow plus Argo on Kubernetes works well. The wins were users can launch fine-tuned jobs, self-serve.”transcript, stated
“I think the CI/CD is super cool when you start uh updating your workflows automatically.”transcript, stated
“What is in work in progress? Moving workloads directly on Kubernetes. Um fine-tuning and training on Kubernetes is a big challenge”transcript, stated