Skip to content

UCT/IB: Fix RoCE LAG put bandwidth estimate - #11691

Open
shasson5 wants to merge 2 commits into
openucx:masterfrom
shasson5:fix-doris-put-get-estimation
Open

UCT/IB: Fix RoCE LAG put bandwidth estimate#11691
shasson5 wants to merge 2 commits into
openucx:masterfrom
shasson5:fix-doris-put-get-estimation

Conversation

@shasson5

Copy link
Copy Markdown
Contributor

What?

  • Keep RoCE LAG path bandwidth at full device bandwidth for PUT operations
  • Continue splitting path bandwidth by dev_num_paths for non-PUT RoCE LAG operations

Why?

PUT operations can use the full RoCE LAG bandwidth, so dividing the estimate by dev_num_paths makes the protocol selection logic underrate PUT relative to GET.

Impact

This fixes bandwidth estimation for RoCE LAG PUT operations without changing the existing GET/NDR/XDR read bandwidth limits.

@shasson5
shasson5 force-pushed the fix-doris-put-get-estimation branch from 54a47f5 to 8b04ca4 Compare July 23, 2026 12:05
@shasson5 shasson5 added the WIP-DNM Work in progress / Do not review label Jul 26, 2026
@shasson5
shasson5 force-pushed the fix-doris-put-get-estimation branch from 42b0d01 to 22a708c Compare July 26, 2026 15:29
@shasson5
shasson5 marked this pull request as ready for review July 26, 2026 15:30
@shasson5

Copy link
Copy Markdown
Contributor Author

@svc-nvidia-pr-review

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread src/uct/ib/base/ib_iface.c
Comment thread src/uct/ib/base/ib_iface.h
if (uct_ib_iface_is_roce(iface)) {
/* RoCE - number of paths is RoCE LAG level */
iface->num_paths = uct_ib_iface_roce_lag_level(iface);
if (uct_ib_iface_port_is_xdr(iface)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if (uct_ib_iface_port_active_speed(iface) > UCT_IB_SPEED_NDR)
or => UCT_IB_SPEED_XDR ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

XDR detection is different than NDR so we cannot merge them to the same function and use it here

@shasson5

Copy link
Copy Markdown
Contributor Author

@svc-nvidia-pr-review

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread src/uct/ib/base/ib_iface.h
Comment thread src/uct/ib/base/ib_iface.c
@svc-nvidia-pr-review

Copy link
Copy Markdown

Test coverage note: the changed logic (set_num_paths, estimate_path_bw, port_is_xdr) is only exercisable on real XDR/NDR hardware; test/gtest/uct/v2/test_uct_query.cc covers estimate_perf generically but not the new RoCE-XDR width path. Given the classification heuristic above, a small unit test around uct_ib_iface_port_active_width / the XDR detection (feeding known width+speed combos) would guard against regressions. Could you clarify the coverage plan here?

@shasson5
shasson5 force-pushed the fix-doris-put-get-estimation branch from 0ba6e1a to 2667a53 Compare August 4, 2026 08:37
@shasson5
shasson5 force-pushed the fix-doris-put-get-estimation branch from 2667a53 to 8d51df3 Compare August 4, 2026 08:40
@shasson5

shasson5 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@svc-nvidia-pr-review

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

@shasson5 shasson5 removed the WIP-DNM Work in progress / Do not review label Aug 4, 2026
Comment thread src/uct/ib/base/ib_iface.c
Comment thread src/uct/ib/base/ib_iface.h
@shasson5
shasson5 requested review from gleon99 and iyastreb August 4, 2026 09:22
@shasson5

shasson5 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@iyastreb can review?

@iyastreb

iyastreb commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

I'm not comfortable with this statement:

PUT operations can use the full RoCE LAG bandwidth, so dividing the estimate by dev_num_paths makes the protocol selection logic underrate PUT relative to GET.

I thought a single RoCE LAG QP/path transmits through one physical port. Full LAG bandwidth requires multiple QPs/paths. Or I miss something?

Comment thread src/uct/ib/base/ib_iface.c Outdated
/* RoCE - number of paths is RoCE LAG level */
iface->num_paths = uct_ib_iface_roce_lag_level(iface);
if (uct_ib_iface_port_is_xdr(iface)) {
iface->num_paths = UCT_IB_HIGH_SPEED_NUM_PATHS;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So here we essentially reduce the number of possible paths, but why?

@shasson5 shasson5 Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

because number of required paths for full BW is reduced on XDR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

but what if it is a LAG consisting of, say 3 devices?

if (uct_ib_iface_is_roce(iface) &&
(uct_ib_iface_roce_lag_level(iface) > 1)) {
if (uct_ep_op_is_get(op) && uct_ib_iface_port_is_xdr(iface)) {
max_path_bandwidth = UCT_IB_XDR_READ_PATH_BANDWIDTH;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But this also modifies non-RoCE code..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

actually it doesn't because it's just lines reorder (last "else" case moved to the top)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is this change needed?
imo it is harder to read now

@shasson5

shasson5 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

I'm not comfortable with this statement:

PUT operations can use the full RoCE LAG bandwidth, so dividing the estimate by dev_num_paths makes the protocol selection logic underrate PUT relative to GET.

I thought a single RoCE LAG QP/path transmits through one physical port. Full LAG bandwidth requires multiple QPs/paths. Or I miss something?

CX8 has four planes per port, and DDP allows a single QP/WQE to spray packets across all planes. RDMA WRITE payload is placed immediately, whereas RDMA READ requires responder execution and response generation.

PUT is a streaming, packet-sprayed operation; GET is a request/response operation bounded by the per-QP read-credit window. On XDR that window is 16, so four QPs recreate 64-way concurrency.

https://nvidia.atlassian.net/wiki/spaces/SW/pages/2899157185/DDP+-+Direct+Data+Placement
Running on Lyris — explicitly states that ucp_get requires at least four QPs

@shasson5
shasson5 requested a review from iyastreb August 6, 2026 09:02
@shasson5

shasson5 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@iyastreb

@brminich brminich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

did you run some basic perf tests (osu?) with XDR and NDR

/* RoCE - number of paths is RoCE LAG level */
iface->num_paths = uct_ib_iface_roce_lag_level(iface);
if (uct_ib_iface_port_is_xdr(iface)) {
iface->num_paths = UCT_IB_HIGH_SPEED_NUM_PATHS;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

but what if it is a LAG consisting of, say 3 devices?

if (uct_ib_iface_is_roce(iface) &&
(uct_ib_iface_roce_lag_level(iface) > 1)) {
if (uct_ep_op_is_get(op) && uct_ib_iface_port_is_xdr(iface)) {
max_path_bandwidth = UCT_IB_XDR_READ_PATH_BANDWIDTH;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is this change needed?
imo it is harder to read now

Comment on lines +839 to +843
uint32_t active_speed = uct_ib_iface_port_active_speed(iface);
uint8_t active_width = uct_ib_iface_is_roce(iface) ?
uct_ib_iface_port_active_width(iface) : 1;

return (active_width * active_speed) == UCT_IB_SPEED_XDR;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why?

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.

5 participants