Comments (3)
You may find these CUDA event benchmarks useful: https://github.com/harrism/cuda_event_benchmark. In my tests on V100 / Ubuntu 18.04 / CUDA 10.2 / AMD Ryzen 7 3700, a default event record (timing enable) has a throughput of about 400K records per second. With timing disabled it is 10x faster, but if you are intending to use events for timing, go with the lower throughput.
The event approach works well with tools like Google Benchmark, however you may need to take extra steps to flush the L2 cache between kernels if you need to benchmark the performance assuming a cold cache. You can see how we do this in RAPIDS libcudf benchmarks with this class, and an example benchmark that uses it:
https://github.com/rapidsai/cudf/blob/f78f80e94c74c08fface696cfd7e03881b9b0380/cpp/benchmarks/transpose/transpose_benchmark.cu#L46-L49
Note that using CUDA events for timing may be inaccurate if there are concurrent kernels running. (?)
I do think that the overhead of NVTX is nearly zero when nsys or other tools are not attached. We use it and I haven't noticed a penalty. Typically we wrap up the calls in utility functions that we have the option of disabling with a preprocessor definition.
from nvtx.
You may find these CUDA event benchmarks useful: https://github.com/harrism/cuda_event_benchmark. In my tests on V100 / Ubuntu 18.04 / CUDA 10.2 / AMD Ryzen 7 3700, a default event record (timing enable) has a throughput of about 400K records per second. With timing disabled it is 10x faster, but if you are intending to use events for timing, go with the lower throughput.
The event approach works well with tools like Google Benchmark, however you may need to take extra steps to flush the L2 cache between kernels if you need to benchmark the performance assuming a cold cache. You can see how we do this in RAPIDS libcudf benchmarks with this class, and an example benchmark that uses it:
https://github.com/rapidsai/cudf/blob/f78f80e94c74c08fface696cfd7e03881b9b0380/cpp/benchmarks/transpose/transpose_benchmark.cu#L46-L49Note that using CUDA events for timing may be inaccurate if there are concurrent kernels running. (?)
I do think that the overhead of NVTX is nearly zero when nsys or other tools are not attached. We use it and I haven't noticed a penalty. Typically we wrap up the calls in utility functions that we have the option of disabling with a preprocessor definition.
I'm shock by your show up! Your developer blogs in early years are really helpful and I learnt a lot from them. Thank you very much!
When concurrent kernels are running, the elapsed time that cuda events record on the same kernel code may be very different in different running tries, because of other concurrent kernels' competition on the same GPU cores resource. Is my understanding right?
Thanks a lot again for your help!
from nvtx.
No worries, happy to help. I think your understanding is correct.
from nvtx.
Related Issues (20)
- Python nvtx.push_range function missing category argument HOT 3
- `end_range` should be templated with the domain and use `nvtxDomainRangeEnd` HOT 10
- Functions missing the `noexcept` specifier
- Deleting the default constructor of some classes HOT 3
- Implement the `NVTX3_FUNC_RANGE_IF_IN` and `NVTX3_FUNC_RANGE_IF` macros HOT 8
- Implement `domain_process_range` without storing the handle in `std::unique_ptr` HOT 1
- Compilation error when if `NVTX_DISABLE` is defined
- Rename range classes HOT 2
- Building wheel for nvtx (PEP 517) ... error HOT 13
- error: declaration of template parameter āDā shadows template parameter HOT 1
- Installing NVTX on python fails in nvidia docker image. HOT 11
- NVTX C++ availability HOT 2
- Failed to build nvtx HOT 3
- scoped_range does not work with domain::global HOT 1
- `nvToolsExt.h` defines min/max macros on Windows HOT 2
- NvToolExt_LIBRARIES-NOTFOUND
- how can i get nvToolsExt64_1.dll and nvToolsExt64_1.lib
- Python 3.11 support HOT 3
- PyPi README missing
- pip install nvtx on macOs HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvtx.