NVIDIA / NVIDIA/nvbench

Specify the kernel name or nvtx range for benchmarking.

Open
#92 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2: nice to have type: enhancement
Dominant language
Cuda
Stars
927
Forks
123
Avg merge
2d 10h
Merged PRs (30d)
2

Description

Right now it seems the intended method for benchmarking is simply encapsulating the kernel like so:

void my_benchmark(nvbench::state& state) {
  state.exec([](nvbench::launch& launch) { 
    my_kernel<<<num_blocks, 256, 0, launch.get_stream()>>>();
  });
}
NVBENCH_BENCH(my_benchmark);

What I have is more of an application built with multiple kernels (2 or more), so the benchmark looks more like this:

run_my_app(...) {
  my_kernel1<<<num_blocks, 256, 0, launch.get_stream()>>>();
  cudaDeviceSynchronize();
  my_kernel2<<<num_blocks, 256, 0, launch.get_stream()>>>();
}

void my_benchmark(nvbench::state& state) {
  run_my_app(params);
}
NVBENCH_BENCH(my_benchmark);

What I would like to ask/request is (1) if there was an option to specify which kernel to benchmark within the app (either through kernel name or nvtx range). And (2) currently, I have the wrapper around the whole application, is it aggregating different kernel launch metrics provided by cupti? When I see the following output, which kernels is it reporting for (or is it aggregated for all launches)?

HBWPeak LoadEff StoreEff L1HitRate L2HitRate Samples Samples CPU Time Noise GPU Time Noise
0.03% 64.10% 85.46% 19.56% 47.72% 3x 1024x 563.111 us 41.55% 558.423 us 41.54%

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the benchmark wrapper around run_my_app and inspect how CUPTI metrics are collected across multiple kernel launches. Determine whether the current output aggregates all launches, then assess how kernel names or NVTX ranges could select one launch. Done means the requested selection behavior and aggregation semantics are documented or implemented with validation for multi-kernel applications.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.