-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[XLA:CPU] Add initial thunk serialization.
PiperOrigin-RevId: 713322136
- Loading branch information
1 parent
79ffbf1
commit b68b247
Showing
56 changed files
with
1,390 additions
and
152 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* Copyright 2022 The OpenXLA Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
==============================================================================*/ | ||
|
||
syntax = "proto3"; | ||
|
||
package xla.cpu; | ||
|
||
import "xla/service/hlo.proto"; | ||
import "xla/xla_data.proto"; | ||
|
||
option cc_enable_arenas = true; | ||
|
||
message ResourceProto { | ||
enum Kind { | ||
UNKNOWN = 0; | ||
TOKEN = 1; | ||
COLLECTIVE_COMMUNICATOR = 2; | ||
} | ||
Kind kind = 1; | ||
} | ||
|
||
message BufferAllocationSliceProto { | ||
int64 offset = 1; | ||
int64 size = 2; | ||
int64 buffer_allocation_index = 3; | ||
} | ||
|
||
message ShapeBufferAllocationSliceProto { | ||
xla.ShapeProto shape = 1; | ||
BufferAllocationSliceProto slice = 2; | ||
} | ||
|
||
message OpParamsProto { | ||
int64 op_id = 1; | ||
bool has_channel_id = 2; | ||
bool use_global_device_ids = 3; // TODO(basioli) optional | ||
repeated ReplicaGroup replica_group = 4; | ||
} | ||
|
||
message OpBuffersProto { | ||
repeated ShapeBufferAllocationSliceProto source_shapes_buffer_slices = 1; | ||
repeated ShapeBufferAllocationSliceProto destination_shapes_buffer_slices = 2; | ||
} | ||
|
||
message OpResourcesProto { | ||
ResourceProto communicator_resource = 1; // TODO(basioli) optional | ||
} | ||
|
||
message AllGatherThunkProto {} // NOTE(basioli) empty for now | ||
|
||
message AllReduceThunkProto { | ||
string reduction_kind = 1; | ||
bool single_replica = 2; | ||
} | ||
|
||
message AllToAllThunkProto {} // NOTE(basioli) empty for now | ||
|
||
message ReduceScatterThunkProto { | ||
string reduction_kind = 1; | ||
} | ||
|
||
message CollectivePermuteThunkProto { | ||
message SourceTargetPairProto { | ||
int64 source = 1; | ||
int64 target = 2; | ||
} | ||
repeated SourceTargetPairProto source_target_pairs = 1; | ||
} | ||
|
||
message CollectiveThunkProto { | ||
OpParamsProto op_params = 1; | ||
OpBuffersProto op_buffers = 2; | ||
OpResourcesProto op_resources = 3; | ||
oneof impl { | ||
AllGatherThunkProto all_gather_thunk = 4; | ||
AllReduceThunkProto all_reduce_thunk = 5; | ||
AllToAllThunkProto all_to_all_thunk = 6; | ||
ReduceScatterThunkProto reduce_scatter_thunk = 7; | ||
CollectivePermuteThunkProto collective_permute_thunk = 8; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.