Skip to content

Fix: umbp qp per transfer default value & add logs - #384

Merged
TianDi101 merged 3 commits into
mainfrom
fix_qp_create_err
Jun 11, 2026
Merged

Fix: umbp qp per transfer default value & add logs#384
TianDi101 merged 3 commits into
mainfrom
fix_qp_create_err

Conversation

@TianDi101

Copy link
Copy Markdown
Collaborator
  • Change default qpPerTransfer = 4 to avoid AINIC resource overflow
  • Add logs for rdma transport implementation

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts RDMA configuration defaults to mitigate AINIC resource exhaustion and improves observability for RDMA (ibverbs) resource-creation failures.

Changes:

  • Switch UMBP RDMA qpPerTransfer to be env-configurable via MORI_UMBP_QP_PER_TRANSFER, with a safer default of 4 (previously 16).
  • Add error logs and replace assert(...) with logged failures + std::runtime_error throws for ibv_create_cq, ibv_create_qp, and ibv_alloc_pd failures.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/umbp/distributed/pool_client.cpp Makes qpPerTransfer configurable via env var with a reduced default to prevent RDMA resource overflow.
src/application/transport/rdma/providers/ibverbs/ibverbs.cpp Adds detailed error logs and throws on ibverbs resource creation failures (CQ/QP/PD).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +76 to +82
if (!endpoint.ibvHandle.cq) {
MORI_APP_ERROR(
"ibv_create_cq failed: errno={} ({}); dev={} max_cqe={} dev_max_cqe={} cqs_in_pool={}",
errno, strerror(errno), GetRdmaDevice()->Name(), config.maxCqeNum,
deviceAttr->orig_attr.max_cqe, cqPool.size());
throw std::runtime_error("ibv_create_cq failed: " + std::string(strerror(errno)));
}
Comment on lines +105 to +114
if (!endpoint.ibvHandle.qp) {
MORI_APP_ERROR(
"ibv_create_qp failed: errno={} ({}); dev={} port={} max_send_wr={} max_recv_wr={} "
"max_send_sge={} max_cqe={} dev_caps(max_qp_wr={} max_qp={} max_cqe={}) qps_in_pool={}",
errno, strerror(errno), GetRdmaDevice()->Name(), config.portId, qpAttr.cap.max_send_wr,
qpAttr.cap.max_recv_wr, qpAttr.cap.max_send_sge, config.maxCqeNum,
deviceAttr->orig_attr.max_qp_wr, deviceAttr->orig_attr.max_qp,
deviceAttr->orig_attr.max_cqe, qpPool.size());
throw std::runtime_error("ibv_create_qp failed: " + std::string(strerror(errno)));
}
Comment on lines 229 to +233
ibv_pd* pd = ibv_alloc_pd(defaultContext);
if (!pd) {
MORI_APP_ERROR("ibv_alloc_pd failed: errno={} ({}); dev={}", errno, strerror(errno), Name());
throw std::runtime_error("ibv_alloc_pd failed: " + std::string(strerror(errno)));
}
@TianDi101

Copy link
Copy Markdown
Collaborator Author

Leave the review solved by the next PR, we need to merge this one to main for an urgent test

@TianDi101
TianDi101 merged commit 26b40db into main Jun 11, 2026
23 of 24 checks passed
@QizhouZhang97
QizhouZhang97 deleted the fix_qp_create_err branch July 27, 2026 06:02
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