randomkang commented on code in PR #3144:
URL: https://github.com/apache/brpc/pull/3144#discussion_r4546098190


##########
src/brpc/policy/baidu_rpc_protocol.cpp:
##########
@@ -823,8 +842,27 @@ void ProcessRpcRequest(InputMessageBase* msg_base) {
 
             butil::IOBuf req_buf;
             int body_without_attachment_size = req_size - 
meta.attachment_size();
-            msg->payload.cutn(&req_buf, body_without_attachment_size);
+#if BRPC_WITH_GDR
+            bool is_gpu_memory = msg->payload.is_gpu_memory();
+            if (is_gpu_memory) {
+                if (!FillReqBufGpu(&req_buf, msg.get(), 
body_without_attachment_size)) {

Review Comment:
   It is not recommended to use baidu master service (the proxy-forwarding 
mode) on a server with GDR enabled. master service forwards each request one 
more time, and the extra network hop plus proxy scheduling add significant 
latency. Moreover, when the downstream is a plain TCP Channel, the body must be 
copied back from GPU memory to host memory (D2H) before forwarding, which 
completely negates the zero-copy benefit of GDR. GDR targets clients directly 
connecting to GPU services (e.g. training/inference servers) so that data goes 
GPU-to-GPU; for scenarios that require proxy forwarding, use a plain TCP/RDMA 
link instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to