* Copyright (c) 2026 Huawei Technologies Co., Ltd.
* openFuyao is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
package types
type OpenCollectiveRequest struct {
TaskID string `json:"taskID"`
SessionID string `json:"sessionID,omitempty"`
ArtifactKey string `json:"artifactKey"`
CollectiveSpec CollectiveSpec `json:"collectiveSpec"`
EnableChunkCRC bool `json:"enableChunkCRC"`
TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`
}
type OpenCollectiveResponse struct {
TaskID string `json:"taskID"`
TransportPath TransportPath `json:"transportPath"`
ListenEndpoint string `json:"listenEndpoint,omitempty"`
Message string `json:"message,omitempty"`
}
type CollectiveStepRequest struct {
TaskID string `json:"taskID"`
SessionID string `json:"sessionID,omitempty"`
Iteration int32 `json:"iteration"`
ChunkCount int32 `json:"chunkCount,omitempty"`
BarrierOnly bool `json:"barrierOnly,omitempty"`
AcknowledgeOnly bool `json:"acknowledgeOnly,omitempty"`
}
type CollectiveStepResponse struct {
TaskID string `json:"taskID"`
Iteration int32 `json:"iteration"`
Completed bool `json:"completed"`
TransportPath TransportPath `json:"transportPath,omitempty"`
BytesTransferred int64 `json:"bytesTransferred,omitempty"`
AcknowledgedIteration int32 `json:"acknowledgedIteration,omitempty"`
Message string `json:"message,omitempty"`
}
type CompleteCollectiveRequest struct {
TaskID string `json:"taskID"`
SessionID string `json:"sessionID,omitempty"`
Success bool `json:"success"`
Message string `json:"message,omitempty"`
FinalCRC bool `json:"finalCRC,omitempty"`
StagingPath string `json:"stagingPath,omitempty"`
}
type PushCollectiveChunkRequest struct {
TaskID string `json:"taskID"`
SessionID string `json:"sessionID,omitempty"`
Iteration int32 `json:"iteration"`
ExpectedChunks int32 `json:"expectedChunks,omitempty"`
Chunk TransferredChunk `json:"chunk"`
Data []byte `json:"data"`
RelayOffset int64 `json:"relayOffset,omitempty"`
RelayRDMA *RelayRDMAHint `json:"relayRDMA,omitempty"`
TransportPath TransportPath `json:"transportPath,omitempty"`
SourceNode string `json:"sourceNode,omitempty"`
}
type PushCollectiveChunkResponse struct {
TaskID string `json:"taskID"`
Iteration int32 `json:"iteration"`
Accepted bool `json:"accepted"`
TransportPath TransportPath `json:"transportPath,omitempty"`
Message string `json:"message,omitempty"`
}
type CollectiveChunkPayload struct {
Chunk TransferredChunk `json:"chunk"`
Data []byte `json:"data"`
RelayOffset int64 `json:"relayOffset,omitempty"`
RelayRDMA *RelayRDMAHint `json:"relayRDMA,omitempty"`
PublishSeq int64 `json:"publishSeq,omitempty"`
}
type PushCollectiveChunksRequest struct {
TaskID string `json:"taskID"`
SessionID string `json:"sessionID,omitempty"`
Iteration int32 `json:"iteration"`
ExpectedChunks int32 `json:"expectedChunks,omitempty"`
Chunks []CollectiveChunkPayload `json:"chunks"`
TransportPath TransportPath `json:"transportPath,omitempty"`
SourceNode string `json:"sourceNode,omitempty"`
}
type PushCollectiveChunksResponse struct {
TaskID string `json:"taskID"`
Iteration int32 `json:"iteration"`
Accepted bool `json:"accepted"`
PublishedChunks int32 `json:"publishedChunks,omitempty"`
FirstPublishSeq int64 `json:"firstPublishSeq,omitempty"`
LastPublishSeq int64 `json:"lastPublishSeq,omitempty"`
TransportPath TransportPath `json:"transportPath,omitempty"`
Message string `json:"message,omitempty"`
}
type ListCollectiveChunksRequest struct {
TaskID string `json:"taskID"`
SessionID string `json:"sessionID,omitempty"`
Iteration int32 `json:"iteration"`
RelativePath string `json:"relativePath,omitempty"`
}
type ListCollectiveChunksResponse struct {
TaskID string `json:"taskID"`
Iteration int32 `json:"iteration"`
ExpectedChunks int32 `json:"expectedChunks,omitempty"`
AcknowledgedIteration int32 `json:"acknowledgedIteration,omitempty"`
Chunks []CollectiveChunkPayload `json:"chunks"`
}
type ListCollectiveRelayChunksRequest struct {
TaskID string `json:"taskID"`
SessionID string `json:"sessionID,omitempty"`
AfterPublishSequence int64 `json:"afterPublishSequence,omitempty"`
AcknowledgePublishSequence int64 `json:"acknowledgePublishSequence,omitempty"`
MaxChunks int32 `json:"maxChunks,omitempty"`
MaxBytes int64 `json:"maxBytes,omitempty"`
RelativePath string `json:"relativePath,omitempty"`
}
type ListCollectiveRelayChunksResponse struct {
TaskID string `json:"taskID"`
AfterPublishSequence int64 `json:"afterPublishSequence,omitempty"`
PublishedSequence int64 `json:"publishedSequence,omitempty"`
AcknowledgedPublishSequence int64 `json:"acknowledgePublishSequence,omitempty"`
TransportPath TransportPath `json:"transportPath,omitempty"`
Completed bool `json:"completed,omitempty"`
Chunks []CollectiveChunkPayload `json:"chunks"`
Message string `json:"message,omitempty"`
}