Skip to content

Batched min-time is modeled as a stdrel criterion parameter, causing unintuitive CLI behavior with other stopping criteria #408

Description

@oleksandr-pavlyk

--min-time options is currently treated as a stopping-criterion parameter owned by stdrel.

This creates surprising CLI behavior when users select another stopping criterion such as sample-count, entropy, or a custom criterion. For example:

./build/bin/nvbench.example.cpp20.throughput \
    --stopping-criterion sample-count \
    --target-samples 3 \
    --min-time 1e-5

fails with:

NVBench encountered an error:

/home/opavlyk/repos/nvbench/nvbench/option_parser.cu:1107: Error handling option `--min-time 1e-5`:
/home/opavlyk/repos/nvbench/nvbench/option_parser.cu:1073: Unrecognized stopping criterion \
      parameter: `min-time` for `sample-count`.

The same happens with entropy:

./build/bin/nvbench.example.cpp20.throughput \
   --stopping-criterion entropy \
   --min-time 1e-5

Confusingly, this ordering works:

./build/bin/nvbench.example.cpp20.throughput \
    --min-time 1e-5 \
    --stopping-criterion entropy

but --min-time does not actually apply to "entropy". It is accepted while the default "stdrel" criterion is active, then --stopping-criterion entropy resets the benchmark criterion parameters.

Conceptually, --min-time does not seem like it should be a "stdrel"-specific stopping-criterion parameter.

It is used by hot/batched measurement logic, where it behaves more like a benchmark or measurement option.

Suggested improvements:

  1. Keep rejecting invalid options, but improve the error message. For example:
--min-time is only valid for the 'stdrel' stopping criterion in the current CLI model.
  Current criterion 'entropy' accepts: --max-angle, --min-r2.
  1. Move min-time out of 'stdrel; criterion params and model it as a benchmark/measurement option, or introduce a more explicit hot/batch option such as --batch-min-time.

  2. Once min-time is no longer criterion-owned, simplify the example CTest logic and remove or reduce the need for no_min_time_examples.

Metadata

Metadata

Labels

Type

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions