Skip to content

Commit

Permalink
Update comments to reflect the renaming of original_value
Browse files Browse the repository at this point in the history
This updates the comments to reflect the renaming of original_value attribute of HloInstruction to origin in cl/676573775.

PiperOrigin-RevId: 681112069
  • Loading branch information
jcai19 authored and Google-ML-Automation committed Oct 1, 2024
1 parent 0a50f5a commit 326b65b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions xla/hlo/ir/hlo_computation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1432,8 +1432,8 @@ absl::StatusOr<bool> HloComputation::ReplaceInstructionWithDifferentShape(
old_instruction->frontend_attributes());
}
if (auto old_original_value = old_instruction->original_value()) {
// Fusions are handled separately. The original_value attribute of fused
// instructions is copied when they are added into the fused computation.
// Fusions are handled separately. The original value of fused instructions
// is copied when they are added into the fused computation.
if (new_instruction->opcode() != HloOpcode::kFusion) {
if (ShapeUtil::Compatible(old_instruction->shape(),
new_instruction->shape())) {
Expand Down
8 changes: 4 additions & 4 deletions xla/hlo/ir/hlo_instructions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2038,7 +2038,7 @@ HloCallableInstruction::CloneAndAppendInstructionIntoCalledComputation(
// instruction. Add it as an operand and add a corresponding called
// computation parameter instruction.

// No need to create an original_value for an added parameter as the
// No need to create an original value for an added parameter as the
// original value is saved in the corresponding argument.
called_computation_parameter = AddCallOperand(operand);
}
Expand All @@ -2047,7 +2047,7 @@ HloCallableInstruction::CloneAndAppendInstructionIntoCalledComputation(
}

if (clone != instruction_to_append) {
// Copy over original_value attribute to the clone of a fused instruction.
// Copy over the original value to the clone of a fused instruction.
if (auto original_value = instruction_to_append->original_value()) {
clone->set_original_value(original_value);
}
Expand Down Expand Up @@ -2092,7 +2092,7 @@ HloCallableInstruction::CloneAndAppendInstructionIntoCalledComputation(
HloInstruction* new_root = called_computation()->AddInstruction(
HloInstruction::CreateTuple(tuple_elements));

// No need to create an original_value for a new root with added outputs
// No need to create an original value for a new root with added outputs
// as the original value is saved in the get-tuple-element instructions
// that use it.
called_computation()->set_root_instruction(new_root,
Expand Down Expand Up @@ -2425,7 +2425,7 @@ void HloFusionInstruction::MergeFusionInstructionIntoMultiOutput(
auto cloned_instruction =
parent()->AddInstruction(fused_instruction->CloneWithNewOperands(
fused_instruction->shape(), new_operands, /*suffix=*/"clone"));
// Copy over original_value attribute to the clone of a fused instruction.
// Copy over the original value to the clone of a fused instruction.
// This is necessary as the clone will be cloned again when the clone is
// fused in FuseInstructionIntoMultiOutput(). This can be skipped if we
// improve the code to only clone once as stated in the preceding comment.
Expand Down

0 comments on commit 326b65b

Please sign in to comment.