Skip to content

Configuration

Lemutisme edited this page Nov 7, 2026 · 1 revision

Configuration

GEAR ships one configuration for the results in the paper: the preset gear-f0 (the Python API default). The command-line runner nlp_example.py reads the same settings from exp_configs/NLP_solver/f3.yaml, given with --config. The values below are read from the preset file and the argument schema (complete_verifier/arguments.py). The schema has several hundred keys; this page lists the ones a user would normally change.

Options a user changes

Purpose gear.Options field Configuration key Value in gear-f0 Schema description
Time limit (seconds) time_limit bab.override_timeout 180 Override timeout
Feasibility tolerance (absolute) feas_tol solver.nlp.constr_viol_tol, solver.nlp.bab_feas_tol, solver.nlp.ipopt_constr_viol_tol 1e-6 The three keys must be equal; the same value checks the returned point
Absolute gap gap.abs solver.nlp.bab_primal_dual_abs_tol 1e-5 (schema default) Absolute primal-dual gap at which the search counts as closed
Relative gap gap.rel solver.nlp.bab_primal_dual_rel_tol 1e-4 (schema default) Relative primal-dual gap, scaled by max(1, abs(primal)), at which the search counts as closed
Device device general.device cuda cpu, cuda or cuda:k
Precision dtype general.double_fp double Only float64
Random seed seed general.seed 100 Random seed
Number of boxes per batch batch.domains solver.batch_size 1, with automatic enlargement Batch size in bound solver (number of parallel splits)
Automatic batch enlargement (preset) solver.auto_enlarge_batch_size true Increase the batch size while VRAM use is low
VRAM ratio for enlargement advanced solver.batched_crown_auto_enlarge_max_vram_ratio 0.9 Upper VRAM fraction used when enlarging
GPU memory for stored boxes (MB) batch.gpu_domain_mb bab.domain_storage_gpu_mb 2048 Keep the per-domain storages on the GPU while they take less than this many MB; past it they move to host memory
Budget of the primal search per batch advanced solver.nlp.bab_br_budget 20480 Shared budget (boxes times restarts) of the augmented Lagrangian search

The gap closes when P - D is at most the absolute gap or the relative gap, whichever is reached first. The tables in the paper use only the relative rule (P - D) / max(1, |P|, |D|) <= 1e-4 together with the feasibility check of the returned point (Quick Start).

Setting options

From Python (Python API):

opts = gr.Options(time_limit=60.0, device="cuda:0", feas_tol=1e-6, batch=gr.Batch(domains=64),
                  advanced={"solver.nlp.bab_br_budget": 40960})

A field and an advanced key that map to the same configuration key raise OptionError. An unknown key or a wrong type raises OptionError.

From nlp_example.py, --device, --override_timeout and --batch_size set the corresponding keys, --use_beta False selects plain CROWN bounds, and --config names the YAML file; release runs use --config exp_configs/NLP_solver/f3.yaml. Without --config, nlp_example.py reads nlplib_new.yaml, not the default configuration. gear.cli solve takes --preset (default gear-f0), --time_limit, --device, --seed, --feas_tol and --set KEY=VALUE for any dotted key.

Presets

gear-f0 is stored as a fully resolved configuration, so it does not depend on schema defaults. The Configurations: block at the top of a solver log lists the argument defaults, not the values in effect; the values in effect are those of the preset or YAML file (Output and Logs).

Where the time goes

The time limit covers the whole run under timing="solve". With the command-line runner, loading and model construction are outside the limit. Do not compare timings taken under the two modes.

Clone this wiki locally