Tips
Small tricks that make gflow workflows faster and safer.
Dependency Shortcuts (@)
Use @ to refer to recent submissions:
@: most recently submitted job@~1: previous submission@~2: two submissions ago
gbatch --time 10 python preprocess.py
gbatch --depends-on @ --gpus 1 --time 4:00:00 python train.py
gbatch --depends-on @ --time 10 python evaluate.py@ also works in lists:
gbatch --depends-on-all @,@~1,@~2 python merge.pyConda Env Auto-detect
When submitting a command (not a script), if --conda-env is omitted, gbatch will use the current shell’s $CONDA_DEFAULT_ENV (if set).
Example:
conda activate myenv
gbatch python -c 'import os,sys; print("CONDA_DEFAULT_ENV=", os.getenv("CONDA_DEFAULT_ENV")); print("python=", sys.executable)'Example output:
Submitted batch job 42 (silent-pump-6338)Verify:
gjob show 42
cat ~/.local/share/gflow/logs/42.logExample log output:
CONDA_DEFAULT_ENV= myenv
python= /path/to/miniconda/envs/myenv/bin/pythonParameter Sweeps
Use --param to submit multiple jobs from one command by filling {param} placeholders (cartesian product across params).
gbatch --dry-run \
--param lr=0.001,0.01 \
--param bs=32,64 \
--name-template 'lr{lr}_bs{bs}' \
python train.py --lr {lr} --batch-size {bs}Example output:
Would submit 4 batch job(s):
[1] python train.py --lr 0.001 --batch-size 32 (GPUs: 0)
[2] python train.py --lr 0.001 --batch-size 64 (GPUs: 0)
[3] python train.py --lr 0.01 --batch-size 32 (GPUs: 0)
[4] python train.py --lr 0.01 --batch-size 64 (GPUs: 0)Ranges are supported (no commas): start:stop or start:stop:step (use :step for floats, e.g. 0:1:0.1).
From a CSV (--param-file)
gbatch --param-file params.csv --name-template 'run_{id}' python train.py --id {id}params.csv must have a header row; each row is one job’s parameter set.
Limit Concurrency (--max-concurrent)
gbatch --param lr=0.001,0.01 --max-concurrent 1 python train.py --lr {lr}Tree View When Debugging Pipelines
gqueue -tPreview Before Cancelling
gcancel --dry-run <job_id>
gcancel <job_id>Redo a Whole Chain
Fix the root cause, then redo the failed job and all dependent jobs:
gjob redo <job_id> --cascadeRestrict GPUs at Runtime
Keep GPUs free for non-gflow workloads by restricting what gflow can allocate:
gctl set-gpus 0,2
gctl show-gpus
gctl set-gpus allSee also: Configuration -> GPU Selection.
GPU Reservations (gctl reserve)
Block out GPUs for a user/time window (e.g. a demo) so other users can't take them while the reservation is active.
gctl reserve create --user alice --gpus 2 --start '2026-01-28 14:00' --duration 2h
gctl reserve list --active
gctl reserve list --timeline --range 48h
gctl reserve cancel <reservation_id>--start supports ISO8601 (e.g. 2026-01-28T14:00:00Z) or YYYY-MM-DD HH:MM (local time). Times must be on :00 or :30; durations are multiples of 30 minutes.