Inconsistent gdr read latency

Open
#243 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c
Domain
performance

Research direction

No source file or test is named. Start by reproducing the reported 3 KB, 100-read benchmark with the stated gdr mapping, page-locked host memory, alignment, and CU_POINTER_ATTRIBUTE_SYNC_MEMOPS settings; then inspect the gdr_copy_from_bar SSE4_1 implementation mentioned in the report. Done means identifying the cause of the alternating latency and documenting or correcting the behavior.

Written by the indexing model from the issue text.

Description

question

I have a memory allocator based on gdr which initially allocates a large chunk of gdr memory (e.g. 16 MB) and then allocates pieces of this chunk to the subsequent memory requests. During performance benchmarking, I noticed that the read latency of the same memory size fluctuates quite significantly and I can't understand why. For example, if I allocate 3KB memory read 100 times and do the same thing again and again, the average read time fluctuates between 4.5 us and 70 us (i.e. 4.5 -> 70 -> 4.5 -> 70 ...) even though the same piece of memory is allocated for every 100 reads.

Here are some details regarding my settings:

  • I have set CU_POINTER_ATTRIBUTE_SYNC_MEMOPS to 1 for the entire chunk using cuPointerSetAttribute.
  • The api reports "using SSE4_1 implementation of gdr_copy_from_bar" for read operation.
  • The data is read into page-locked host memory allocated using cudaMallocHost.
  • Both the gdr-mapped source pointer and the destination pointer are 128-bit aligned.
  • The write latency is quite consistent.
Dominant language
C
Stars
1.4k
Forks
198
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from NVIDIA/gdrcopy

All issues in NVIDIA/gdrcopy

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.