Design a GPU RDMA Ping-Pong Performance Micro-Benchmark in Python

Quick Overview

Design a Python micro-benchmark that measures GPU-to-GPU RDMA performance between two endpoints with a ping-pong pattern across message sizes. It tests how you derive one-way latency from round trips, prepare GPU buffers for the direct network path, separate Python harness overhead from transfer time, and report trustworthy results.

Design a GPU RDMA Ping-Pong Performance Micro-Benchmark in Python

Company: NVIDIA

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

Design a performance micro-benchmark, written in Python, for GPU RDMA: transfers in which the network card reads and writes GPU memory directly instead of staging the data through host memory. The benchmark uses a ping-pong pattern. One side sends a message from a buffer in its GPU's memory; the other side receives it into its own GPU buffer and immediately sends it back; the first side times the round trip. Describe the setup, the measurement loop, what you report and how you make the numbers trustworthy, and sketch the core code in Python. ```hint What the timer brackets Python's per-call overhead and the GPU's asynchronous execution can both be as large as the transfer you are trying to time. Decide exactly what sits inside the timed region, and how you would find out how much of a result is the harness rather than the network. ``` ```hint Where the bytes live The point of the benchmark is the direct path between the network card and GPU memory. Think about what must be true of the buffers and the machines for that path to be taken, and how you would show that it was. ``` ### Constraints and Clarifications - The report gives only the one-line prompt. Not given: which Python libraries may be used, the network fabric, whether the two GPUs are in different machines, which message sizes matter, and any target numbers. Ask, or state your assumptions. ### Clarifying Questions - Are the two GPUs in different machines connected through RDMA-capable network cards, or in the same machine? - Which Python stack may the benchmark use: a CUDA-aware communication library, low-level RDMA verbs bindings, or an existing internal harness? - What should be reported: small-message latency only, or latency and bandwidth across a sweep of message sizes? - Should the benchmark exercise two-sided send and receive, one-sided RDMA writes, or both? - Should results be compared against the same test with host-memory buffers, to show what the direct GPU path gains? ### What a Strong Answer Covers - The ping-pong protocol between the two sides, and how one-way latency and bandwidth are derived from round trips - GPU buffer allocation, readiness and registration, and evidence that the direct GPU path is actually used - A timed region that excludes setup, accounts for asynchronous GPU work and quantifies the Python harness's own overhead - A message-size sweep with warm-up, enough iterations and distribution statistics, validated against a native reference - Control of the environment (device and network-card placement, CPU affinity, other traffic), data correctness checks, and failure handling ### Follow-up Questions - Your Python ping-pong reports a small-message latency well above what a native benchmark shows on the same machines. How do you find out where the difference comes from? - How would you extend the benchmark to measure streaming or bidirectional bandwidth, with many messages in flight? - How would you make the benchmark detect that traffic silently fell back to staging through host memory? - How would you run this across many machine pairs in a cluster to find a bad link or network card?

Overview: Design a Python micro-benchmark that measures GPU-to-GPU RDMA performance between two endpoints with a ping-pong pattern across message sizes. It tests how you derive one-way latency from round trips, prepare GPU buffers for the direct network path, separate Python harness overhead from transfer time, and report trustworthy results.

NVIDIA logo
NVIDIA
Oct 16, 2026
mediumSoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
0
0

Design a performance micro-benchmark, written in Python, for GPU RDMA: transfers in which the network card reads and writes GPU memory directly instead of staging the data through host memory. The benchmark uses a ping-pong pattern. One side sends a message from a buffer in its GPU's memory; the other side receives it into its own GPU buffer and immediately sends it back; the first side times the round trip. Describe the setup, the measurement loop, what you report and how you make the numbers trustworthy, and sketch the core code in Python.

Constraints and Clarifications

  • The report gives only the one-line prompt. Not given: which Python libraries may be used, the network fabric, whether the two GPUs are in different machines, which message sizes matter, and any target numbers. Ask, or state your assumptions.

Clarifying Questions Guidance

  • Are the two GPUs in different machines connected through RDMA-capable network cards, or in the same machine?
  • Which Python stack may the benchmark use: a CUDA-aware communication library, low-level RDMA verbs bindings, or an existing internal harness?
  • What should be reported: small-message latency only, or latency and bandwidth across a sweep of message sizes?
  • Should the benchmark exercise two-sided send and receive, one-sided RDMA writes, or both?
  • Should results be compared against the same test with host-memory buffers, to show what the direct GPU path gains?

What a Strong Answer Covers Guidance

  • The ping-pong protocol between the two sides, and how one-way latency and bandwidth are derived from round trips
  • GPU buffer allocation, readiness and registration, and evidence that the direct GPU path is actually used
  • A timed region that excludes setup, accounts for asynchronous GPU work and quantifies the Python harness's own overhead
  • A message-size sweep with warm-up, enough iterations and distribution statistics, validated against a native reference
  • Control of the environment (device and network-card placement, CPU affinity, other traffic), data correctness checks, and failure handling

Follow-up Questions Guidance

  • Your Python ping-pong reports a small-message latency well above what a native benchmark shows on the same machines. How do you find out where the difference comes from?
  • How would you extend the benchmark to measure streaming or bidirectional bandwidth, with many messages in flight?
  • How would you make the benchmark detect that traffic silently fell back to staging through host memory?
  • How would you run this across many machine pairs in a cluster to find a bad link or network card?