Commit Graph

86 Commits

Author SHA1 Message Date
Georgy Evtushenko
4be0c5bdcd API convention 2024-01-11 10:48:52 -08:00
Georgy Evtushenko
dacbee127c Base method naming convention 2024-01-11 10:41:11 -08:00
Georgy Evtushenko
182c77e4f4 Got rid of the params description API 2024-01-10 12:30:17 -08:00
Georgy Evtushenko
42c6bdea70 Handle empty input in mean 2024-01-10 09:52:14 -08:00
Georgy Evtushenko
fade52fa2e Different singleton convention 2024-01-08 14:08:12 -08:00
Georgy Evtushenko
85ed6f007c Rename criterion registry to criterion manager 2024-01-08 13:15:46 -08:00
Georgy Evtushenko
de724a21f1 Rename get_params to get_params_description 2024-01-08 13:06:48 -08:00
Georgy Evtushenko
b789240c76 Entropy-based stopping criterion 2024-01-05 14:59:48 -08:00
Vyas Ramasubramani
a3b729bca8 fmt::memory_buffer is no longer an iterator. 2022-11-03 10:04:02 -07:00
Yunsong Wang
af4c35d78b Fix a bug in config count unit test: count number of devices as well 2022-02-11 18:24:58 -05:00
Yunsong Wang
6159d9c6cb Minor correction in unit test 2022-02-06 20:19:21 -05:00
Yunsong Wang
33a896f99e Update copyright year 2022-02-04 17:25:50 -05:00
Yunsong Wang
470beda9f0 Add nvbench::state stream tests 2022-02-04 16:55:29 -05:00
Allison Vacanti
a72f248af6 Require the NVBench package in test_export testing. 2022-01-19 15:42:26 -05:00
Allison Vacanti
6dee1eec3b Refactor summary API and update nvbench/summary.cuh docs.
The string used when constructing a summary is no longer a human
readable name, but rather a tag string (e.g. "nv/cold/time/gpu/mean").
These will make lookup easier and more stable going forward.

name vs. short_name no longer exists. Now there is just "name", which
is used for column headings. The "description" string may still be
used for detailed information.

Updated the json tests and compare script to reflect these changes.
2022-01-11 15:06:26 -05:00
Allison Vacanti
2f8bb28c52 Merge pull request #64 from allisonvacanti/noise_convergence
New convergence check
2021-12-21 21:30:39 -05:00
Allison Vacanti
178dd0eb68 Implement new convergence check for noisy kernels.
Previously, convergence was tested by waiting for the relative stdev
of cuda timings ("noise") to drop below a certain percentage
(`max_noise`).

This assumed that all benchmarks would eventually see their noise drop
to some threshold, but this is not the case. In practice, many benchmarks
never converge to the default 0.5% relative stdev and instead will always
run to the 15s timeout -- even if the means have converged in a second
or two.

Added a new check that tests when the noise itself stabilizes and ends
the benchmark, even if noise > max_noise.

After testing, this patch alone significantly reduces the runtime of the
Thrust+CUB benchmark suite (from 30 hours to 5 hours) and produces similar
timing results.

The parameters used to tune this feature are not exposed -- if this
approach works long-term and there's a strong motivation to let users
tweak them, then we can worry about names/APIs/CLI/docs later.
2021-12-21 21:24:02 -05:00
Allison Vacanti
8e56a7bd94 Add noisy_bench with some benchmarks that currently always time-out. 2021-12-21 21:05:13 -05:00
Allison Vacanti
c9ab8e2eb3 Fix progress display for inactive type axis values.
When type axis values were disabled they were still counted towards
a benchmark's total number of configs.
2021-12-21 20:36:52 -05:00
Allison Vacanti
20522c807d Add an nvbench-ctl executable.
This will provide functionality such as clock locking (--lgm),
persistance mode (--pm), device querying (--list), version checking
(--version), and documentation (--help).

This is possible already with any nvbench executable, but having
one with a reliable name will be helpful for scripting and writing
documentation.
2021-12-21 12:02:07 -05:00
Allison Vacanti
5d70492714 Enable more warning flags.
- /W4 on MSVC
- -Wall -Wextra + others on gcc/clang
- New NVBench_ENABLE_WERROR option to toggle "warnings as errors"
- Mark the nlohmann_json library as IMPORTED to switch to system includes
- Rename nvbench_main -> nvbench.main to follow target name conventions
- Explicitly suppress some cudafe warnings when compiling templates in
  nlohmann_json headers.
- Explicitly suppress some warnings from Thrust headers.
- Various fixes for warnings exposed by new flags.
- Disable CUPTI on CTK < 11.3 (See #52).
2021-12-18 20:13:25 -05:00
Georgy Evtushenko
1bc715267c CUPTI support 2021-12-18 12:03:52 +03:00
Allison Vacanti
b2d37c21fd Add export tests. 2021-10-20 14:02:16 -04:00
Allison Vacanti
ef36d3a558 Port to rapids-cmake.
- Add export sets
- Add install rules
- Remove manual CPM import, port to rapids_cpm_*, etc
- Organize CMake code into cmake/*.cmake files.
- NVBench is now a shared library.
2021-10-20 14:02:16 -04:00
Allison Vacanti
ed27365a41 Disable portion of test due to GCC 7 bug.
Fixes #39.
2021-10-19 12:26:02 -04:00
Allison Vacanti
0dcd915ea6 Fix test failure. 2021-03-18 16:07:50 -04:00
Allison Vacanti
4e83e048ba Store percentages as ratios.
Human-readable outputs (md) and CLI inputs still use percentages.
In-memory and machine-readable outputs (csv, json) use ratios.

This is the convention that spreadsheet apps expect. Fixes #2.
2021-03-18 13:42:43 -04:00
Allison Vacanti
ea53972af8 Add nvbench.all metatarget.
This builds all NVBench tests and examples without building targets in
any parent projects.
2021-03-18 13:33:23 -04:00
Allison Vacanti
ab8fc13aac Simplify enum_type_list usage.
Using C++17 auto template parameters enables two improvements:

1. Enum type no longer needed in `enum_type_list`:

```
// Old:
nvbench::enum_type_list<my_enum, my_enum::value1, my_enum::value2, ...>
// New:
nvbench::enum_type_list<my_enum::value1, my_enum::value2, ...>
```

2. New `nvbench::enum_type` helper cuts down on verbosity when writing
benchmarks

```
// Old
template <typename T, my_enum_a MyEnumA, my_enum_b MyEnumB>
void my_bench(nvbench::state &state,
              nvbench::type_list<T,
                                 std::integral_constant<my_enum_a,
                                                        MyEnumA>,
                                 std::integral_constant<my_enum_b,
                                                        MyEnumB>>)
{ ... }

// New
template <typename T, my_enum_a MyEnumA, my_enum_b MyEnumB>
void my_bench(nvbench::state &state,
              nvbench::type_list<T,
                                 nvbench::enum_type<MyEnumA>,
                                 nvbench::enum_type<MyEnumB>>)
{ ... }
```
2021-03-18 02:59:51 -04:00
Allison Vacanti
9f6404bac6 Pad range max for floating point types.
This avoids an annoying case where the max value is dropped due to
rounding errors.

Adds a few other missing test cases for `nvbench::range`, too.

Fixes #3.
2021-03-16 15:12:53 -04:00
Allison Vacanti
56414078ea Added state::get_XXXX_or_default(axis_name, default_value) 2021-03-16 14:36:20 -04:00
Allison Vacanti
60c94d9ed6 Add enum_type_axis and examples/enums.cu.
- `enum_type_axis` simplifies using integral_constants with type axes.
- `examples/enums.cu` demonstrates various ways of implementing parameter
  sweeps with enum types.
2021-03-16 13:57:52 -04:00
Allison Vacanti
f15b668b03 Add nvbench.test.all and nvbench.example.all metatargets. 2021-03-09 16:03:14 -05:00
Allison Vacanti
cc01d8863c Fix copyright year. 2021-03-08 18:39:27 -05:00
Allison Vacanti
c133784763 Add the first example.
- New NVBench_ENABLE_EXAMPLES CMake option.
- examples/axis.cu provides examples of parameter sweeps.
- Moves testing/sleep_kernel.cuh -> nvbench/test_kernels.cuh
  - Accessible to examples and provides some built-in kernels for users
    to experiement with.
  - Not included with `<nvbench/nvbench.cuh>`.
2021-03-08 18:26:26 -05:00
Allison Vacanti
078919b6b4 Add LICENSE file and boilerplate.
for i in `find  ./ -regex ".*\.cuh?$"`
do
  sh -c "cat ~/boilerplate ${i} > tmp && mv tmp ${i}"
done
2021-03-04 16:03:02 -05:00
Allison Vacanti
cf71f6ee15 Update NVBench build system with initial standalone support. 2021-03-03 13:59:29 -05:00
Allison Vacanti
8d6d934dfe Add default axis names.
Also cleaned up the annoying quirk where `set_type_axes_names` *had*
to be called on all benchmarks with type axes.

Default names are {"T", "U", "V", "W"} for up-to four type axes. For
five or more, {"T0", "T1", ...} is used instead.
2021-02-19 12:37:05 -05:00
Allison Vacanti
a747982415 Add nvbench::main CMake target.
Linking to this instead of `nvbench::nvbench` will automatically include
the `NVBENCH_MAIN` macro.
2021-02-19 09:34:02 -05:00
Allison Vacanti
37e753f7b6 Update benchmark macros:
s/NVBENCH_CREATE/NVBENCH_BENCH/g
s/NVBENCH_BENCH_TEMPLATE/NVBENCH_BENCH_TYPES/g

This will fit nicer once the exec_tags version are added:

NVBENCH_BENCH
NVBENCH_BENCH_TYPES
NVBENCH_BENCH_FLAGS
NVBENCH_BENCH_TYPES_FLAGS
2021-02-16 16:08:38 -05:00
Allison Vacanti
bb871094c3 Fixes for multidevice/gcc.
- Allow devices to be cleared during benchmark definition.
- Fix various demangling bugs.
2021-02-15 21:26:21 -05:00
Allison Vacanti
6c67578dcd Implement skip_time and improve logging. 2021-02-15 17:39:46 -05:00
Allison Vacanti
d323f569b8 Add termination criteria API.
- min_samples
- min_time
- max_noise
- skip_time (not yet implemented)
- timeout

Refactored s/(trials)|(iters)/samples/s.
2021-02-15 12:04:15 -05:00
Allison Vacanti
92cc3b1189 Execute benchmarks on all devices. 2021-02-12 20:53:10 -05:00
Allison Vacanti
9f9c6e5278 Refactor state_generator.
The old implementation was scattered and ad hoc. This one is slightly
less so.

More importantly, refactoring to this design will make it easier to
add device traversal.
2021-02-11 21:24:58 -05:00
Allison Vacanti
56d182ad41 Fix float64_axis test.
Changed to use `{:0.5g}` formatting for input strings until I figure
out something better.
2021-02-11 21:13:48 -05:00
Allison Vacanti
3bc8291b28 Allow benchmarks to be specified by index with --benchmark. 2021-02-10 21:40:39 -05:00
Allison Vacanti
0477514bb6 Axis spec revamp.
- Add support for single values ("Axis=Value").
- Make other value specs shell friendly:
  - Range: "Axis:(2:10:2)"  -> "Axis=[2:10:2]"
  - List:  "Axis:{2,3,4,5}" -> "Axis=[2,3,4,5]"
  - ":" -> "=" feels more natural
  - "{}()" characters have special meaning in bash.
  - "[]" character don't require escapes.
  - Using the same braces for both ranges/list is easier to remember,
    only the delimiter changes.
2021-02-10 09:55:50 -05:00
Allison Vacanti
4bdc27de8c More fixes for int64_t != long long. 2021-02-04 19:02:58 -05:00
Allison Vacanti
74d19a8e16 Clean up formatting. 2021-02-04 18:54:44 -05:00