Coder Social home page Coder Social logo

Comments (3)

harrism avatar harrism commented on June 20, 2024

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.

gaoteng-git avatar gaoteng-git commented on June 20, 2024

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.

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.

harrism avatar harrism commented on June 20, 2024

No worries, happy to help. I think your understanding is correct.

from nvtx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.