mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-04-20 14:58:54 +00:00
More cleanup
This commit is contained in:
@@ -243,7 +243,7 @@ Keep the rapid growth of combinations due to multiple parameter axes in mind whe
|
||||
choosing the number of values in an axis. See the section about combinatorial
|
||||
explosion for more examples and information.
|
||||
|
||||
## Zipped/Tied Iteration of Value Axes
|
||||
## Zipped Iteration of Value Axes
|
||||
|
||||
At times multiple value axes need to be iterated like they are actually a tuple
|
||||
or zipped together. To enable this behavior you can request axes to be 'zipped'
|
||||
@@ -252,8 +252,8 @@ together.
|
||||
```cpp
|
||||
// InputTypes: {char, int, unsigned int}
|
||||
// OutputTypes: {float, double}
|
||||
// NumInputs: {2^10, 2^20, 2^30}
|
||||
// Quality: {0.5, 1.0}
|
||||
// NumInputs: {1000, 10000, 100000, 200000, 200000, 200000}
|
||||
// Quality: {0.05, 0.1, 0.25, 0.5, 0.75, 1.}
|
||||
|
||||
using input_types = nvbench::type_list<char, int, unsigned int>;
|
||||
using output_types = nvbench::type_list<float, double>;
|
||||
@@ -267,6 +267,8 @@ NVBENCH_BENCH_TYPES(benchmark, NVBENCH_TYPE_AXES(input_types, output_types))
|
||||
Zipping these two axes reduces the total combinations from 216 to 36, reducing the
|
||||
combinatorial explosion.
|
||||
|
||||
Note: Only value axes may be zipped together.
|
||||
|
||||
# Throughput Measurements
|
||||
|
||||
In additional to raw timing information, NVBench can track a kernel's
|
||||
|
||||
@@ -60,29 +60,21 @@ void copy_sweep_grid_shape(nvbench::state &state)
|
||||
num_values);
|
||||
});
|
||||
}
|
||||
void naive_copy_sweep_grid_shape(nvbench::state &state)
|
||||
{
|
||||
copy_sweep_grid_shape(state);
|
||||
}
|
||||
void tied_copy_sweep_grid_shape(nvbench::state &state)
|
||||
{
|
||||
copy_sweep_grid_shape(state);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
// Naive iteration of both the BlockSize and NumBlocks axes.
|
||||
// Will generate the full cartesian product of the two axes for a total of
|
||||
// 16 invocations of copy_sweep_grid_shape.
|
||||
NVBENCH_BENCH(naive_copy_sweep_grid_shape)
|
||||
// Full combinatorial of Every power of two from 64->1024:
|
||||
NVBENCH_BENCH(copy_sweep_grid_shape)
|
||||
.set_name("naive_copy_sweep_grid_shape")
|
||||
.add_int64_axis("BlockSize", {32, 64, 128, 256})
|
||||
.add_int64_axis("NumBlocks", {1024, 512, 256, 128});
|
||||
|
||||
//==============================================================================
|
||||
// Zipped iteration of BlockSize and NumBlocks axes.
|
||||
// Will generate only 4 invocations of copy_sweep_grid_shape
|
||||
NVBENCH_BENCH(tied_copy_sweep_grid_shape)
|
||||
// Every power of two from 64->1024:
|
||||
NVBENCH_BENCH(copy_sweep_grid_shape)
|
||||
.set_name("tied_copy_sweep_grid_shape")
|
||||
.add_zip_axes(nvbench::int64_axis{"BlockSize", {32, 64, 128, 256}},
|
||||
nvbench::int64_axis{"NumBlocks", {1024, 512, 256, 128}});
|
||||
|
||||
@@ -160,11 +152,8 @@ struct under_diag final : nvbench::user_axis_space
|
||||
}
|
||||
};
|
||||
|
||||
void user_copy_sweep_grid_shape(nvbench::state &state)
|
||||
{
|
||||
copy_sweep_grid_shape(state);
|
||||
}
|
||||
NVBENCH_BENCH(user_copy_sweep_grid_shape)
|
||||
NVBENCH_BENCH(copy_sweep_grid_shape)
|
||||
.set_name("user_copy_sweep_grid_shape")
|
||||
.add_user_iteration_axes(
|
||||
[](auto... args) -> std::unique_ptr<nvbench::axis_space_base> {
|
||||
return std::make_unique<under_diag>(args...);
|
||||
|
||||
Reference in New Issue
Block a user