Repository navigation
[RDMA] Initialize flush requests before posting or returning - #1106
Merged
zhongjiechen merged 2 commits intoNov 3, 2026
Merged
zhongjiechen merged 2 commits into
zhongjiechen merged 2 commits into
Conversation
YangZhou1997
approved these changes
Nov 1, 2026
Member
|
cc @zhongjiechen as the code owner |
zhongjiechen
approved these changes
Nov 3, 2026
Member
|
/run-benchmark l4 |
Benchmark
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1096.
pluginIflushreturns a pooled request even when there is nothing to flush. Previously,uccl_flushleft its context unset for all flushes and returned before initializing its type and completion state for no-op flushes. Polling could therefore dereference an invalid flow or interpret stale request state. A reused completion flag could also report a newly posted flush complete before its RDMA READ finished.Initialize the request as a completed
ReqFlushwith the current flow before the early return, then clear the completion flag before posting a CUDA flush. HIP retains its immediate-completion behavior.Add
flush_test, automatically picked up by the existing Makefiles, and document its commands. The test uses a real local RDMA flush QP without a remote host or data engines. It checks empty/all-zero flushes, fresh and reused requests, and alternating posted/no-op flushes against registered host or GPU memory.Type of Change
How Has This Been Tested?
Validated on Linux x86-64 with one NVIDIA B200, an active mlx5 InfiniBand port, GCC 13.3, and CUDA 12.8. Baseline is upstream
54e216ee; the same regression test was compiled against baseline and the fix.flush_test --noopreq->type == ReqFlushflush_test(registered host memory)req.context == &receiverflush_test --gpu(registered B200 memory)req.context == &receiverEach posted-flush test checks that the request is initially incomplete, polls its real CQ to completion with a deadline, then reuses it for a no-op. The no-op-only run covers
n=0and zero-sized buffers with null data/MR arrays.Repeated all three fixed tests with AddressSanitizer and UndefinedBehaviorSanitizer: all passed without sanitizer diagnostics. Built all transport objects and the test with
-fsanitize=address,undefined -fno-omit-frame-pointer; usedASAN_OPTIONS=detect_leaks=0:protect_shadow_gap=0andUBSAN_OPTIONS=halt_on_error=1. Disabling shadow-gap protection was required for CUDA initialization on this host; leak checking was not performed.Built
flush_testandlibnccl-net-uccl.sofor both baseline and fix with the repository's pinned NCCL headers (2ea4ee94). Confirmed the fixed plugin exportsncclNetPlugin_v8. Used the existing native Makefile targets withCUDA_HOME=/usr/local/cuda-12.8; this host lacks the unused gflags/gtest libraries, so the test usedLIBS="-lz -lelf -libverbs -L/usr/local/cuda-12.8/lib64 -lcudart -lpthread"and the plugin usedLIBS_SHARED="-lz -lelf -libverbs".export UCCL_IB_HCA=mlx5_0:1 UCCL_NUM_ENGINES=1 ./collective/rdma/flush_test --noop ./collective/rdma/flush_test ./collective/rdma/flush_test --gpuChanged C++ files pass clang-format 14.0.6
--dry-run --Werror;git diff --checkpasses.Validation is limited to the local flush request lifecycle on NVIDIA/InfiniBand. ROCm, RoCE, cross-node NCCL integration, and throughput benchmarks were not run; this PR makes no performance claim.
Checklist
format.shto follow the style guidelines. (Ran clang-format 14 directly on the changed C++ files.)build.shto verify compilation. (Used native Makefile builds described above.)