Objectives and feasibility
Choose a scalar score when one ranking expresses the trade-off you care about. Use multiple objectives when you want to inspect a Pareto front. The shipped desktop OxIOD example minimizes validation error and model FLOPs separately.
nas:
score:
type: multi-objective
params:
objectives:
- metric: rmse_total
direction: minimize
- metric: flops
direction: minimize
prune:
rules: []
Decide what happens to an unsuitable candidate
Pruning rules can stop a trial before fitting. Feasibility rules expose deployment constraints to the sampler. A candidate that exceeds a deadline can be marked infeasible while keeping its result available for analysis. Each signed constraint is feasible at or below zero.
With nas.feasibility.train_if_infeasible: false, an infeasible candidate skips training and still consumes an attempt. When training is enabled for infeasible candidates, their objective values can be measured while the constraint violation stays recorded.
Scoring, pruning and feasibility fields
The nas block owns scoring, pruning, and constrained-feasibility policy.
Structure
nas.score.typescoring-functionormulti-objectivenas.score.metricsOptional derived metricsnas.score.paramsScore terms or objectives depending onscore.typenas.prune.rulesOptional post-build/pre-fit hard termination gatesnas.feasibility.train_if_infeasibleWhether trials that violate feasibility constraints should still train and return real objective values. Defaults tofalse.nas.feasibility.rulesOptional post-build/pre-fit deployability constraints using the same rule shape asnas.prune.rules, with fieldsrule,metric,condition,reference, andreason.
Built-in derived metric types validated in code include the following.
addenergy-budget-from-power
Scalar term types include the following.
weightednormalized-weightedboundarytarget
Practical guidance
- use
scoring-functionwhen you want one scalar score - use
multi-objectivewhen you want a Pareto front instead of one scalar - use
nas.prune.ruleswith either score type when a pre-fit metric should hard-stop a trial before feasibility is evaluated. Rules run after model build/compile, FLOP counting, and HIL/compile metric collection, but beforetask.build_fit_plan,model.fit, TFLite validation, or Keras validation. Multi-objective gate hits are logged withpruned=Truebut remain Optuna COMPLETE trials with direction-aware penalty values. - use
nas.feasibility.rulesfor deployability constraints that should be visible to Optuna constrained samplers. Feasibility is evaluated after hard failures andnas.prune.rules. Each rule persists one signed constraint where<= 0is feasible and> 0is infeasible. Withtrain_if_infeasible: false, infeasible trials skip training and return penalties while still consumingtraining.max_total_trials. Withtrain_if_infeasible: true, trials train normally but remain constrained-infeasible for samplers, CSV filtering, and plots. - move latency/deadline budget gates such as
latency_ms > latency_budget_msorcadenced_deadline_miss_count > 0tonas.feasibility.ruleswhen you want constrained dominance. Keep the same metric innas.prune.rulesonly when you deliberately want hard early termination for debugging or resource protection. - keep non-HIL configs away from score/prune terms that require measured latency or energy.
latency_ms, energy/power/current/voltage metrics,clock_hz,harness_latency_ms, andcadenced_*metrics requiredevice.hil: true. - set
device.compile_when_hil_disabled: falsefor pure desktop scores such as RMSE/FLOPs. Leave it asautowhen non-HIL score/prune terms still need compile-derived resource metrics. - in cadenced multi-objective runs, overload is telemetry unless you add a
nas.feasibility.rulesconstraint such ascadenced_deadline_miss_count > 0
The most complete commented examples remain in nas_config_stm32.yaml itself.
For more information, read the full config README on GitHub.