-
Notifications
You must be signed in to change notification settings - Fork 44
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
Adding Read Put Packet operation at Executor #441
base: main
Are you sure you want to change the base?
Conversation
This looks good to me, but I remember @Binyang2014 suggested a more general solution instead of hacking the code path. |
// Ensuring Data Is Ready | ||
size_t nPackets = size * 2 / sizeof(PacketType); | ||
for (size_t pkt_idx = threadIdx.x; pkt_idx < nPackets; pkt_idx += blockDim.x) { | ||
PacketType* pkts = (PacketType*)((char*)scratch + scratchBaseOffset + srcOffsets[ch_idx] * 2); | ||
PacketPayload<PacketType> data = pkts[pkt_idx].read(flag); | ||
} |
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.
Can you give an example for this case? It's for sending packet via intra node channel then trans via inter node channel? If so, we may need more threads for this, not just #tid < nDstChannels
size_t nPackets = size * 2 / sizeof(PacketType); | ||
for (size_t pkt_idx = threadIdx.x; pkt_idx < nPackets; pkt_idx += blockDim.x) { | ||
PacketType* pkts = (PacketType*)((char*)scratch + scratchBaseOffset + srcOffsets[ch_idx] * 2); | ||
PacketPayload<PacketType> data = pkts[pkt_idx].read(flag); |
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.
We may need to set data to back to the scratch buffer, not sure if compiler will optimize the instruction if we only read the data
No description provided.