Skip to content

fix: stage inline data in ProxyCmd for PROXY_RDMA_WRITE_INLINE - #22

Merged
itej89 merged 1 commit into
feat/ep-rdma-sharingfrom
feat/ep-rdma-sharing-fix-r2-2-inline
Aug 28, 2026
Merged

fix: stage inline data in ProxyCmd for PROXY_RDMA_WRITE_INLINE#22
itej89 merged 1 commit into
feat/ep-rdma-sharingfrom
feat/ep-rdma-sharing-fix-r2-2-inline

Conversation

@itej89

@itej89 itej89 commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Summary

Addresses PR ROCm#558 round-2 review comment R2-2.

PROXY_RDMA_WRITE_INLINE set IBV_SEND_INLINE but left sge.addr pointing at GPU VRAM (cmd->src_addr). libibverbs memcpys from sge.addr at post time — a GPU pointer the CPU cannot access.

Fix: add inline_data[48] to ProxyCmd (uses existing padding, struct stays 128 bytes). GPU copies data into cmd->inline_data via byte loop on host-pinned ring. CPU points sge.addr at cmd->inline_data (host-accessible).

Changes:

  • proxy_types.hpp: add inline_data[48], PROXY_MAX_INLINE_DATA, static_assert on struct size
  • proxy_device_primitives.hpp: ProxyPostWriteInline copies src data into cmd->inline_data
  • proxy_thread.cpp: BuildWr reads from cmd->inline_data for inline ops
  • shmem_proxy_kernels.hpp: pass val pointer directly (not cast to uint64_t)

Max inline data per WQE is 12 bytes (MaxInlineDataSizePerWqe). 48-byte field has safe headroom.

Test plan

  • EP benchmark on DO AINIC: Dispatch Pass, Combine Pass
  • Dispatch avg 31.81 GB/s, Combine avg 59.79 GB/s (consistent)

🤖 Generated with Claude Code

@itej89
itej89 force-pushed the feat/ep-rdma-sharing-fix-r2-2-inline branch 3 times, most recently from b60ece5 to 7c36de0 Compare August 28, 2026 14:49
PROXY_RDMA_WRITE_INLINE set IBV_SEND_INLINE but left sge.addr as the
GPU VRAM address from cmd->src_addr. libibverbs memcpys from sge.addr
at post time — a GPU pointer the CPU cannot access.

Fix: add inline_data[48], inline_tag, and inline_len fields to ProxyCmd
(uses existing padding, struct stays 128 bytes). GPU copies data into
cmd->inline_data via 8-byte stores on host-pinned ring, sets tag to
PROXY_INLINE_IMM_WRITE and len. CPU validates tag+len before reading.

- proxy_types.hpp: add ProxyInlineTag enum, inline_data[48], inline_tag,
  inline_len fields, PROXY_MAX_INLINE_DATA constant, static_assert
- proxy_device_primitives.hpp: ProxyPostWriteInline copies src into
  cmd->inline_data, sets tag and len
- proxy_thread.cpp: BuildWr validates tag+len, reads from cmd->inline_data
- shmem_proxy_kernels.hpp: pass val pointer directly (not cast to u64)

Tagged payload design: inline_tag tells CPU what inline_data contains.
Future callers add new tags for new payload types without protocol changes.

Addresses PR ROCm#558 round-2 review comment R2-2.

Co-Authored-By: Claude <noreply@anthropic.com>
@itej89
itej89 force-pushed the feat/ep-rdma-sharing-fix-r2-2-inline branch from 7c36de0 to 4816aef Compare August 28, 2026 14:51
@itej89
itej89 merged commit ac2a6b6 into feat/ep-rdma-sharing Aug 28, 2026
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.

1 participant