Skip to content

CUDA: disable timer support on cuda events#576

Merged
bosilca merged 1 commit intoICLDisco:masterfrom
devreal:cuda_event_disable_timing
Oct 6, 2023
Merged

CUDA: disable timer support on cuda events#576
bosilca merged 1 commit intoICLDisco:masterfrom
devreal:cuda_event_disable_timing

Conversation

@devreal
Copy link
Copy Markdown
Contributor

@devreal devreal commented Oct 6, 2023

According to the docs, disabling timers on events can improve performance.

I wrote a small benchmark to test the difference on xsdk:

    auto now = system_now();
    for (int i = 0; i < NUM_ITER; ++i) {
        ret = cudaEventRecord(event);
        assert(cudaSuccess == ret);
	    do {
           ret = cudaEventQuery(event);
	    } while (cudaErrorNotReady == ret);
        assert(cudaSuccess == ret);
    }

    auto then = system_now();
    std::cout << "Time " << duration_in_mus(now, then) << " us, avg " << duration_in_mus(now, then) / (double)NUM_ITER << " us " << std::endl;

The difference is about an order of magnitude:

Timers enabled: 5.18817
Timers disabled: 0.46593

Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
@devreal devreal requested a review from a team as a code owner October 6, 2023 15:26
@bosilca bosilca merged commit 6e0498c into ICLDisco:master Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants