Skip to content

perf: prefer GPU types per job with openrl.gpu_types - #372

Draft
hodaaaaaaaaaa wants to merge 2 commits into
openrl-dev:mainfrom
hodaaaaaaaaaa:perf/gpu-type-preference
Draft

hodaaaaaaaaaa wants to merge 2 commits into
openrl-dev:mainfrom
hodaaaaaaaaaa:perf/gpu-type-preference

Conversation

@hodaaaaaaaaaa

Copy link
Copy Markdown
Collaborator

Problem

The scheduler puts each worker on the smallest GPU that fits. A gemma-4-E2B LoRA trainer asks for about 15 GiB, so it lands on an L4 next to free A100s and trains several times slower. A job has no way to say which GPU type it should prefer.

Change

A new openrl.gpu_types setting lists accelerator types in order of preference, as values of the node label cloud.google.com/gke-accelerator (for example nvidia-a100-80gb;nvidia-l4; semicolons, since TINKER_TAGS splits on commas). The API server puts it on the job's Workloads as accelerator.preferredTypes, and the scheduler then ranks nodes by type (weights 100, 90, ...) instead of by size. It is a preference: a worker still lands on any GPU that fits when those are busy. --accelerator-type-label / OPEN_RL_ACCELERATOR_TYPE_LABEL names the node label on other clusters.

Results

Measured on GKE with eight GSM8K GRPO jobs launched together (gemma-4-E2B and Qwen3-0.6B, LoRA and full fine-tuning, 7 A100 80GB + 5 L4), with openrl.gpu_types=nvidia-a100-80gb on the gemma-4-E2B jobs against main, two runs each:

  • On main the gemma-4-E2B LoRA trainer lands on an L4; with the setting it lands on an A100. Its median step drops from 177.5 s to 53.6 s.
  • The whole workload took 733 s instead of 1336 s. The other jobs are unchanged.

Workers land on the smallest GPU that fits, through the claim's tiers and
the tight-fit node-affinity weights. That is the wrong choice for a job
that runs several times faster on a bigger device, and a job had no way to
say so.

accelerator.preferredTypes lists accelerator types, most preferred first.
When set, the pod's preferred node-affinity terms are one per type on the
node label --accelerator-type-label (OPEN_RL_ACCELERATOR_TYPE_LABEL,
default cloud.google.com/gke-accelerator), weighted 100 and 10 less per
position, floored at 1, in place of the tight-fit terms. The required
affinity is unchanged, so a busy preferred type still overflows to any GPU
that fits. Without the field the pod renders as before.
openrl.gpu_types is a comma-separated, ordered list of accelerator types
(values of the cloud.google.com/gke-accelerator node label). It is stored
on the model's metadata and sent on both the trainer and sampler Workloads
as accelerator.preferredTypes. A shared LoRA runtime's Workloads carry the
preference of the job that created them. Servers that do not launch
workers as pods refuse it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant