[XLA:CPU] Register replica-id IR
Otherwise any use of replica-id as an argument to another operation crashes. PiperOrigin-RevId: 282934610 Change-Id: Iab3957f85910fd1f453c6d1b9043c9d220ece633
This commit is contained in:
parent
d3645bd12b
commit
d393702997
tensorflow/compiler/xla
@ -1511,6 +1511,7 @@ Status IrEmitter::HandleAllReduce(HloInstruction* crs) {
|
||||
}
|
||||
|
||||
Status IrEmitter::HandleReplicaId(HloInstruction* hlo) {
|
||||
TF_RETURN_IF_ERROR(EmitTargetAddressForOp(hlo));
|
||||
llvm::Type* i8_ptr_type = llvm::Type::getInt8PtrTy(module_->getContext());
|
||||
llvm::FunctionType* replica_id_function_ty =
|
||||
llvm::FunctionType::get(b_.getVoidTy(),
|
||||
|
@ -397,7 +397,8 @@ XLA_TEST_F(CollectiveOpsTest, ReplicaId) {
|
||||
const char* const kModuleStr = R"(
|
||||
HloModule test
|
||||
ENTRY test_computation {
|
||||
ROOT id = u32[] replica-id()
|
||||
id = u32[] replica-id()
|
||||
ROOT out = u32[] copy(id)
|
||||
}
|
||||
)";
|
||||
const int64 kNumReplicas = 4;
|
||||
|
Loading…
Reference in New Issue
Block a user