-
Notifications
You must be signed in to change notification settings - Fork 55
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: support NCCL multi-recv interface #348
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0eb387f
rdma: defer connect completion after sending connect message
rauteric d20ba9e
tests: set `nrecv=1` in functional tests
rauteric 9207e74
tests/ring: Post receives before sends
rauteric 8c770ce
msgbuff: support tags in preparation for multi-recv
rauteric 1278cf6
rdma: support NCCL multi-recv interface
rauteric 5fddb2e
Advertise multi-recv support to NCCL for RDMA protocol
rauteric File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,20 +74,32 @@ typedef struct nccl_net_ofi_rdma_mr_handle { | |
struct fid_mr *mr[]; | ||
} nccl_net_ofi_rdma_mr_handle_t; | ||
|
||
/* Contents of ctrl message sent from receiver to sender to advertise | ||
destination buffer */ | ||
typedef struct nccl_net_ofi_rdma_ctrl_msg { | ||
typedef struct nccl_net_ofi_rdma_ctrl_msg_entry { | ||
int multi_recv_tag; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. multirecv tag should go at the end for padding reasons. |
||
uint64_t buff_addr; | ||
uint64_t buff_len; | ||
uint64_t buff_mr_key[MAX_NUM_RAILS]; | ||
} nccl_net_ofi_rdma_ctrl_msg_entry_t; | ||
|
||
/* Contents of ctrl message sent from receiver to sender to advertise | ||
destination buffer */ | ||
typedef struct nccl_net_ofi_rdma_ctrl_msg { | ||
uint16_t msg_seq_num; | ||
uint16_t multi_recv_size; | ||
nccl_net_ofi_rdma_ctrl_msg_entry_t entries[]; | ||
} nccl_net_ofi_rdma_ctrl_msg_t; | ||
|
||
#define RDMA_CTRL_MSG_ENTRIES_MAX_SIZE (NCCL_OFI_MAX_RECVS * sizeof(nccl_net_ofi_rdma_ctrl_msg_entry_t)) | ||
#define RDMA_CTRL_MSG_MAX_SIZE (sizeof(nccl_net_ofi_rdma_ctrl_msg_t) + RDMA_CTRL_MSG_ENTRIES_MAX_SIZE) | ||
|
||
/* Structure used to store control messages in a free list */ | ||
typedef struct nccl_net_ofi_rdma_ctrl_fl_item { | ||
nccl_ofi_freelist_reginfo_t fl_reginfo; | ||
nccl_net_ofi_rdma_ctrl_msg_t ctrl_msg; | ||
} nccl_net_ofi_rdma_ctrl_fl_item_t; | ||
|
||
#define RDMA_CTRL_FL_ITEM_MAX_SIZE (sizeof(nccl_net_ofi_rdma_ctrl_fl_item_t) + RDMA_CTRL_MSG_ENTRIES_MAX_SIZE) | ||
|
||
/* For LL/LL128 protocols, bounce buffers (source of RDMA read operations) need to be 128B aligned */ | ||
#define BOUNCE_BUFFER_ALIGNMENT 128 | ||
|
||
|
@@ -152,6 +164,13 @@ typedef struct { | |
/* Total number of completions. Expect one completion for receiving the | ||
* control message and one completion for each send segment. */ | ||
int total_num_compls; | ||
|
||
/* Multi-recv information */ | ||
uint16_t multi_recv_size; | ||
uint16_t multi_recv_start; | ||
int multi_recv_tag; | ||
/* This may not match sender-side seq num with multi-recv */ | ||
uint16_t recv_side_msg_seq_num; | ||
} rdma_req_send_data_t; | ||
|
||
/* | ||
|
@@ -166,6 +185,8 @@ typedef struct { | |
nccl_net_ofi_schedule_t *ctrl_schedule; | ||
/* Pointer to recv parent request */ | ||
nccl_net_ofi_rdma_req_t *recv_req; | ||
/* Size of ctrl message */ | ||
size_t ctrl_msg_size; | ||
} rdma_req_send_ctrl_data_t; | ||
|
||
typedef struct { | ||
|
@@ -206,6 +227,12 @@ typedef struct { | |
* For eager messages, the second completion will be received | ||
* when the local read into the destination buffer is complete */ | ||
int total_num_compls; | ||
/* Multi-recv information */ | ||
uint16_t multi_recv_size; | ||
uint16_t multi_recv_start; | ||
int multi_recv_tag; | ||
/* Next req in sequence */ | ||
nccl_net_ofi_rdma_req_t *multi_recv_next; | ||
} rdma_req_recv_data_t; | ||
|
||
/* | ||
|
@@ -345,6 +372,12 @@ typedef struct nccl_net_ofi_rdma_send_comm { | |
/* Comm ID provided by remote endpoint */ | ||
uint64_t remote_comm_id; | ||
|
||
/* Request to send connect message */ | ||
nccl_net_ofi_rdma_req_t *send_conn_req; | ||
|
||
/* Indicates if connect message was delivered (and req freed) */ | ||
bool connect_msg_delivered; | ||
|
||
/* Request to receive connect response message to finalize | ||
* connection establishment */ | ||
nccl_net_ofi_rdma_req_t *conn_resp_req; | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we're going to break out the two protocols (which makes sense), then we should move these into their corresponding header files. And we really shouldn't leave something named as
NCCL_OFI_MAX_RECVS
when it's only sometimes right.