How do you run hyperparameter sweeps on cloud GPUs? A developer at Nodus Compute benchmarked hyperparameter sweep strategies on cloud GPUs, running 36 trials of a scikit-learn MLPClassifier on the 1,797-image digits dataset across grid, random, and Optuna TPE samplers with and without pruning. TPE reached 98% validation accuracy in 31.7% of trials versus 12.8% for grid search, while successive halving pruning cut epochs used from 1,080 to 386.8 and wall time from about 95 to 35 seconds, though it dropped the share of successful trials to 11.7%. The writeup recommends running each trial as its own GPU job with per-trial and sweep-wide spending caps, priced as trials times GPU-hours times hourly rate. Run each trial as its own GPU job, launch them in parallel, and put a spending cap on every trial and on the sweep as a whole. On Nodus, a Sweep runs one Job template for every combination of the values you list, caps the combined spend with maxCostUSD , and reports what each trial cost. Price it as trials x GPU-hours per trial x hourly rate, then cut it with early stopping, which used 36% to 60% of the full compute in our test. This post shows the setup, a small sweep we ran ourselves, and the cost math for sizing a real one. If you are pricing a single training run, start with our LLM training cost calculator https://www.nodus-compute.ai/blog/llm-training-cost-calculator/ instead. A sweep is the same training script run many times with different settings, such as learning rate, weight decay and batch size. Each run is a trial. Grid and random trials don't depend on each other, so they parallelize perfectly: 36 trials on 12 GPUs finish in a third of the time of 36 trials on 4 GPUs, and cost the same. Three common tools handle the search side. Weights & Biases Sweeps https://docs.wandb.ai/guides/sweeps/ offers grid , random and bayes search methods. Optuna https://optuna.readthedocs.io/en/stable/tutorial/10 key features/004 distributed.html runs many worker processes against one shared storage backend. Ray Tune https://docs.ray.io/en/latest/tune/api/doc/ray.tune.schedulers.ASHAScheduler.html ships an ASHA scheduler that stops weak trials early. None of them decides where trials run or how much they may spend. That part is the compute platform's job, and it is where sweep bills go wrong: one diverging trial with no time limit, or 200 trials launched when you meant 20. Random search wasted fewer trials than grid search in our test, and pruning cut compute far more than the choice of sampler. We ran it on CPU, on a sandbox, in about 6 minutes. The task was a small neural network scikit-learn's MLPClassifier on the 1,797-image digits dataset, tuning learning rate, L2 penalty, hidden size and batch size. Each method got 36 trials of up to 30 epochs, repeated over 5 search seeds. The grid was 3 x 3 x 2 x 2 = 36 cells. Random search and TPE drew learning rate and L2 penalty from log-scale ranges covering the grid's values, and hidden and batch size from four choices each. We also ran Optuna's TPE sampler alone, with its median pruner https://optuna.readthedocs.io/en/stable/reference/generated/optuna.pruners.MedianPruner.html , and with its successive halving pruner https://optuna.readthedocs.io/en/stable/reference/generated/optuna.pruners.SuccessiveHalvingPruner.html . We kept the script and the raw per-trial results, so every number below traces to a logged trial. | Method | Trials clearing 98% val. accuracy | Epochs used of 1,080 | Wall time per search 1 CPU core | |---|---|---|---| | Grid | 12.8% | 1,080 | 105.4 s | | Random | 20.0% | 1,080 | 88.5 s | | TPE Optuna | 31.7% | 1,080 | 95.5 s | | TPE + median pruning | 26.1% | 647.6 | 58.9 s | | TPE + successive halving | 11.7% | 386.8 | 34.7 s | Means over 5 search seeds. Optuna 5.1.0, scikit-learn 1.9.1, run November 27, 2026. Grid search spent the most trials on settings that were never going to work. The grid's problem was one axis. A third of its cells used a learning rate of 0.0001, which averaged 76% validation accuracy and never reached 97.5%. Random search doesn't repeat a bad value 12 times. That matches the finding in Bergstra and Bengio's paper https://www.jmlr.org/papers/v13/bergstra12a.html that randomly chosen trials are more efficient than trials on a grid. Mostly no, but aggressive pruning makes the search less reliable. Every method found a best configuration around 98.5% to 98.6% validation accuracy. With 359 validation images, that spread is about one image. Pruning, not the search method, is what shrinks the bill. Median pruning used 60.0% of the compute and reached 98% validation accuracy in a median of 4 trials, the same as TPE without pruning. Successive halving used 35.8%, but needed a median of 13 trials to reach 98%, and one of the 5 seeds never reached 98.3%. Pick median pruning when you want savings without much risk. Pick successive halving when trials are expensive and you can afford more of them. Not when it wins by one validation image. The grid's pick for one seed scored 98.6% on validation. Retrained for the full 30 epochs with 5 different random seeds, the same settings scored between 95.3% and 98.1% on the test set. Differences that small are noise, so re-run your top 3 configurations with 2 or 3 seeds each before you commit a long training run to one of them. Write one Sweep manifest, give each trial a number, and let the script turn that number into hyperparameters. A Nodus Sweep runs one Job for every combination of the values you list, and each parameter reaches your code as an environment variable: TRIAL arrives as NODUS PARAM TRIAL . This is the Sweeps guide https://www.nodus-compute.ai/docs/guides/sweeps/ 's manifest shape with a 36-trial random search: apiVersion: nodus.dev/v1 kind: Sweep metadata: name: lr-search spec: maxCostUSD: "216" 36 trials x $6.00 per-trial cap maxParallel: 12 matrix: gpu: H100 params: TRIAL: "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35" template: kind: Job spec: image: nodus/pytorch timeout: 3h maxCostUSD: "6.00" per-trial cap command: python, train.py outputs: - name: metrics path: /nodus/outputs/metrics.json The docs' own example inlines its script with python -c ; for a real project, use an image that contains your code. Inside train.py , seed a random generator with the trial number so each trial gets fixed, reproducible settings: python import json, os, random trial = int os.environ "NODUS PARAM TRIAL" rng = random.Random trial same TRIAL, same settings cfg = { "lr": 10 rng.uniform -5, -3 , log scale "weight decay": 10 rng.uniform -4, -1 , "batch size": rng.choice 16, 32, 64 , } val = train and evaluate cfg your training loop with open "/nodus/outputs/metrics.json", "w" as f: json.dump {"trial": trial, cfg, "val": val}, f Submit it with nodus apply -f sweep.yaml and watch it with nodus get sweep/lr-search -w . Each cell runs as a Job named lr-search-