Repository navigation
UCT/IB: Use per-device MR flags in dmabuf capability probe - #11826
vipulSharma18 wants to merge 2 commits into
Conversation
|
🤖 CI Triage Agent — TL;DR: The "AUTHORS file check" codestyle job failed because PR #11826's commit author (Vipul Sharma) is a new contributor who is not listed in the Full analysisSummary: Azure Pipelines stage "AUTHORS file check" failed with Root cause: Not a product/code defect. The codestyle gate runs: The script printed Implicated commit: [REDACTED:Hex High Entropy String] (Vipul Sharma, branch File: Suggested fix: In the PR branch, run the same command the CI runs and commit the result: ./contrib/authors_update.sh origin/master..HEAD
git add AUTHORS && git commit -m "AUTHORS: add Vipul Sharma"This adds
No change to Related: PR #11826 (this PR); the check script was added for this purpose in
|
uct_ib_md_check_dmabuf() probes dmabuf support by registering with a deliberately bad fd and treating any errno other than EBADF as "unsupported". The probe hardcoded UCT_IB_MEM_ACCESS_FLAGS, which includes IBV_ACCESS_REMOTE_ATOMIC. AWS EFA validates access flags before the fd and supports only LOCAL_WRITE|REMOTE_READ|REMOTE_WRITE, so efa_alloc_mr returns -EOPNOTSUPP and UCX never sets UCT_MD_FLAG_REG_DMABUF. GPUDirect RDMA stays disabled on EFA. UCX already computes the correct per-device flags in md->dev.mr_access_flags (set for EFA in ib_efa_md.c, used for real registrations in ib_md.c). Use those flags in the probe as well. No-op on mlx5/verbs, where dev->mr_access_flags equals UCT_IB_MEM_ACCESS_FLAGS. Signed-off-by: Zack Cao <silverwindcao@gmail.com>
Signed-off-by: Zack Cao <silverwindcao@gmail.com>
108f842 to
8d07744
Compare
|
🤖 Starting review — findings will be posted here when done. |
|
The fix correctly replaces the hardcoded UCT_IB_MEM_ACCESS_FLAGS with the device-specific md->dev.mr_access_flags in the dmabuf capability probe. For EFA, mr_access_flags is a subset (no REMOTE_ATOMIC, conditionally no REMOTE_READ/WRITE), so probing with the full flags could make ibv_reg_dmabuf_mr() fail with EINVAL instead of the expected EBADF, causing uct_ib_md_check_dmabuf() to wrongly conclude dmabuf is unsupported. Verified that mr_access_flags is initialized before uct_ib_md_open_common runs in all three MD open paths, and md->pd is allocated earlier during MD alloc — no lifetime or ordering issue. No test coverage is added. This is EFA-specific dmabuf detection behavior that is difficult to exercise in CI without the specific NIC. Worth noting as a coverage gap; the author should note in the PR description why a focused test is not practical for the EFA dmabuf path. |
|
have you or your organization signed the CLA https://openucx.org/license/? |
tvegas1
left a comment
There was a problem hiding this comment.
I verified advertised dmabuf support on AWS and non-AWS node.
|
Hi, thanks for the quick review and approval. Our legal team is in the process of signing the CLA. |
|
hi @vipulSharma18, gentle ping if you have signed CLA? |
|
@vipulSharma18 would you kindly have update on CLA signing process? |
|
fixed as #12032 |
Summary
Use per-device MR access flags in the UCX dmabuf capability probe so AWS EFA does not silently disable GPUDirect RDMA.
uct_ib_md_check_dmabuf()probes dmabuf support by registering with a deliberately bad fd and treating any errno other thanEBADFas "unsupported". The probe hardcodedUCT_IB_MEM_ACCESS_FLAGS, which includesIBV_ACCESS_REMOTE_ATOMIC.AWS EFA validates access flags before the fd and supports only
LOCAL_WRITE|REMOTE_READ|REMOTE_WRITE, soefa_alloc_mrreturns-EOPNOTSUPPand UCX never setsUCT_MD_FLAG_REG_DMABUF. GPUDirect RDMA stays disabled on EFA, forcing GPU→host→SRD→host→GPU copies instead of direct transfers.UCX already computes the correct per-device flags in
md->dev.mr_access_flags(set for EFA inib_efa_md.c, used for real registrations inib_md.c). Use those flags in the probe as well.Impact
No-op on mlx5/verbs, where
dev->mr_access_flags == UCT_IB_MEM_ACCESS_FLAGS. EFA is the transport where the flags differ, and it assigns them beforeuct_ib_md_open_common()calls the probe.Context
We observed this on B300 clusters running tiered-disaggregation KV transfers over EFA: dmabuf registration was never enabled, collapsing throughput.
Test plan
masterUCT_MD_FLAG_REG_DMABUFis set and GPUDirect RDMA is enabled