Skip to content

Conversation

maning00
Copy link
Contributor

Motivation

The current batch API is limited to read/write operations within a single transfer session (one source, one destination). To improve performance and reduce API call overhead, this PR extends the API to support batching multiple, independent transfers in a single call.

API Change

The BatchRead and BatchWrite functions are overloaded to accept vectors of transfer parameters. This allows each entry in the batch to have its own source/destination memory descriptors, status pointers, and transfer IDs.

Old API (Single Session)

  void IOEngine::BatchRead(const MemoryDesc& localDest, const SizeVec& localOffsets,
                 const MemoryDesc& remoteSrc, const SizeVec& remoteOffsets, const SizeVec& sizes,
                 TransferStatus* status, TransferUniqueId id);
  void IOEngine::BatchWrite(const MemoryDesc& localSrc, const SizeVec& localOffsets,
                  const MemoryDesc& remoteDest, const SizeVec& remoteOffsets, const SizeVec& sizes,
                  TransferStatus* status, TransferUniqueId id);

New API (Multi-Session)

  void IOEngine::BatchRead(const MemDescVec& localDest, const BatchSizeVec& localOffsets,
                 const MemDescVec& remoteSrc, const BatchSizeVec& remoteOffsets,
                 const BatchSizeVec& sizes, TransferStatusPtrVec& status, TransferUniqueIdVec& ids);
  void IOEngine::BatchWrite(const MemDescVec& localSrc, const BatchSizeVec& localOffsets,
                  const MemDescVec& remoteDest, const BatchSizeVec& remoteOffsets,
                  const BatchSizeVec& sizes, TransferStatusPtrVec& status,
                  TransferUniqueIdVec& ids);

@maning00 maning00 requested a review from TianDi101 September 28, 2025 07:57
@TianDi101
Copy link
Collaborator

@maning00 Thanks, could you please add some unit tests to test transferring over multiple sessions?

@maning00 maning00 force-pushed the feature_batch_multi_sess branch from 7432823 to fc3d539 Compare September 28, 2025 09:49
@maning00
Copy link
Contributor Author

@TianDi101 added

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.

2 participants