Skip to content

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.type scoring-function or multi-objective
  • nas.score.metrics Optional derived metrics
  • nas.score.params Score terms or objectives depending on score.type
  • nas.prune.rules Optional post-build/pre-fit hard termination gates
  • nas.feasibility.train_if_infeasible Whether trials that violate feasibility constraints should still train and return real objective values. Defaults to false.
  • nas.feasibility.rules Optional post-build/pre-fit deployability constraints using the same rule shape as nas.prune.rules, with fields rule, metric, condition, reference, and reason.

Built-in derived metric types validated in code include the following.

  • add
  • energy-budget-from-power

Scalar term types include the following.

  • weighted
  • normalized-weighted
  • boundary
  • target

Practical guidance

  • use scoring-function when you want one scalar score
  • use multi-objective when you want a Pareto front instead of one scalar
  • use nas.prune.rules with 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 before task.build_fit_plan, model.fit, TFLite validation, or Keras validation. Multi-objective gate hits are logged with pruned=True but remain Optuna COMPLETE trials with direction-aware penalty values.
  • use nas.feasibility.rules for deployability constraints that should be visible to Optuna constrained samplers. Feasibility is evaluated after hard failures and nas.prune.rules. Each rule persists one signed constraint where <= 0 is feasible and > 0 is infeasible. With train_if_infeasible: false, infeasible trials skip training and return penalties while still consuming training.max_total_trials. With train_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_ms or cadenced_deadline_miss_count > 0 to nas.feasibility.rules when you want constrained dominance. Keep the same metric in nas.prune.rules only 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, and cadenced_* metrics require device.hil: true.
  • set device.compile_when_hil_disabled: false for pure desktop scores such as RMSE/FLOPs. Leave it as auto when 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.rules constraint such as cadenced_deadline_miss_count > 0

The most complete commented examples remain in nas_config_stm32.yaml itself.

Inspect trial outputs

For more information, read the full config README on GitHub.