[Feat] Asu: build and send ASU SQE requests #998
Open
yuanzhg078 wants to merge 2 commits into
Open
Conversation
Introduce ASU sub-batch task state, IO scheduling limits, response status mapping, and completion finalization primitives. Add focused tests for scheduler splitting, CQE/result status conversion, buffer release, and terminal task state handling.
Add request builders and attr validation for batch store, batch retrieve, delete, exist, and keep-alive SQEs. Add submit-flow logic for sub-batch request creation, send-buffer preparation, configured send execution, and per-entry failure propagation.
pyxyzc
reviewed
Jun 5, 2026
| const auto& status = sendStatuses[index]; | ||
| if (status.ok()) { continue; } | ||
|
|
||
| SetSubBatchSendFailed(subBatchContext, status); |
Contributor
There was a problem hiding this comment.
Does this implementation guarantee that the buffer slot can be reused and the channel inflight will be zeroed out after a send failure?
Contributor
Author
There was a problem hiding this comment.
Already add release in the end of the Completetask.
|
|
||
| inline bool IsEntryBatchOp(TransportOpType opType) | ||
| { | ||
| return opType == TransportOpType::BATCH_LOAD || opType == TransportOpType::BATCH_STORE; |
Contributor
There was a problem hiding this comment.
Ensure that the opType passed in from the upper layer is consistent with the one defined here :)
Infinite666
reviewed
Jun 5, 2026
|
|
||
| std::uint64_t GetResponseBufferAddr(const ScatterGatherEntry& flagBuffer) | ||
| { | ||
| return flagBuffer.addr; |
Contributor
There was a problem hiding this comment.
Why don't we just call flagBuffer.addr?
Infinite666
reviewed
Jun 5, 2026
| return flagBuffer.addr; | ||
| } | ||
|
|
||
| std::uint32_t GetResponseMrKey(const ScatterGatherEntry& flagBuffer) { return flagBuffer.lkey; } |
Contributor
There was a problem hiding this comment.
Same as above, we can just call flagBuffer.lkey.
Infinite666
reviewed
Jun 5, 2026
|
|
||
| } // namespace | ||
|
|
||
| Status SubmitTaskRequests(const TransportTaskContext& ctx, const IoScheduler& ioScheduler, |
Contributor
There was a problem hiding this comment.
Can we make functions like this inside asu transport class instead of passing so many atttributes?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
Implement ASU SQE request construction and submit-flow handling for creating sub-batch requests, preparing send buffers, sending through configured ASU connections, and propagating send failures.
Modifications
Add SQE request builders for BatchStore, BatchRetrieve, Delete, Exist, and KeepAlive operations.
Add transport attr validation for kv_ns_id, dtype, dspec, lr, sc, kernel_count, and quiet_count before request submission.
Allocate response flag buffers and populate response buffer address/MR key fields for SQE requests.
Pack SQE requests through ProtocolManager and store send SGE/flag buffer metadata in TransportSubBatchContext.
Add submit-flow logic to create sub-batch requests from scheduled IO/key batches.
Add send-buffer preparation and Send invocation using configured kernel_count and quiet_count attrs.
Propagate request-build and send failures to sub-batch status and per-entry status.
Test
Added SqeRequestTest and AsuSubmitFlowTest for request validation, SQE construction, sub-batch submission, send-buffer preparation, send attr handling, and failure propagation.