Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rdma: fix cq usage on different domains #700

Closed

Conversation

maxtmann
Copy link
Contributor

@maxtmann maxtmann commented Nov 6, 2024

When domain-per-thread feature is enabled, a domain is created for the data rail as well as for the control rail. When the control rail is initialized with it's own domain, endpoint of control rail from control domain is bound to cq of data domain.

This commit change the code such that only one domain is used for data and control rail in case domain-per-thread feature is enabled.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

When domain-per-thread feature is enabled, a domain is created for the
data rail as well as for the control rail. When the control rail is
initialized with it's own domain, endpoint of control rail from
control domain is bound to cq of data domain.

This commit change the code such that only one domain is used for
data and control rail in case domain-per-thread feature is enabled.

Signed-off-by: Michael Axtmann <[email protected]>
@maxtmann maxtmann requested a review from a team as a code owner November 6, 2024 19:15
Copy link
Contributor

@aws-nslick aws-nslick left a comment

Choose a reason for hiding this comment

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

LGTM, and I've cherried this into my tree w/o issues.

@aws-nslick aws-nslick added this to the 1.13.x milestone Nov 14, 2024
nccl_net_ofi_rdma_plugin_t *plugin = rdma_endpoint_get_plugin(ep);

if (plugin->base.domain_per_thread) {
assert(ep_rail->cq == NULL);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is cq expected to be NULL here? If ep_rail is already initialized, shouldn't ep_rail->cq be non-NULL, even in domain-per-thread mode?


/* Initialize libfabric resources of endpoint rails */
for (int rail_id = 0; rail_id != ep->num_rails; ++rail_id) {
rail_dev = rdma_device_get_rail(device, rail_id);
rail = rdma_endpoint_get_rail(ep, rail_id);

ret = ep_rail_init(ep, dev_id, rail_id, rail_dev, rail);
ret = get_domain_and_cq_for_endpoint_rail(ep, rail_dev, rail, &domain, &cq);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is confusing -- you're calling this function with rail, which is uninitialized at this point (well, it will be all zeros only because we calloc the array..)

I would prefer a solution where we don't pass an uninitialized rail here. Perhaps splitting get_domain_and_cq_for_endpoint_rail into two functions, 1) the rail has not been initialized yet, in which case we don't need to pass rail at all, and 2) rail has been initialized, which would really be just the body of the first if statement of get_domain_and_cq_for_endpoint_rail.

@maxtmann
Copy link
Contributor Author

Closing PR since issue will be resolved as soon as PR #665 gets merged.

@maxtmann maxtmann closed this Nov 14, 2024
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.

3 participants