Skip to content

Commit 73a25ea

Browse files
fhoushmandGoogle-ML-Automation
authored andcommitted
[XLA:MSA] Remove reference to internal names.
PiperOrigin-RevId: 730535804
1 parent 1f7514f commit 73a25ea

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

xla/service/memory_space_assignment/memory_space_assignment_test.cc

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7998,31 +7998,32 @@ ENTRY entry {
79987998
EXPECT_TRUE(repacker_ran);
79997999
}
80008000

8001-
TEST_F(MemorySpaceAssignmentTest, ReduceReservedScopedVmemIfOperandInVmem) {
8002-
// This test is designed to test UpdateReservedScopedVmemSize() in MSA, which
8003-
// will invoke reserved_scoped_memory_fn to update scoped allocation
8004-
// size. UpdateReservedScopedVmemSize() should iterate through all scheduled
8005-
// instruction and check if either their operands or outputs has been assigned
8006-
// in alternate memory. If so, corresponding operand/output will be passed to
8007-
// reserved_scoped_memory_fn. We isolate UpdateReservedScopedVmemSize() by
8008-
// constructing a dummy reserved_scoped_memory_fn that return +1 when operand
8009-
// set is empty, and return +2 when output set is empty, because if either set
8010-
// of an instruction is empty, it is gureented that some scoped allocation is
8011-
// required. We use +1/+2 to distinguish the correctness of each set.
8012-
// Therefore, after MSA pass, for each instruction, there are a few possible
8013-
// outcomes:
8001+
TEST_F(MemorySpaceAssignmentTest,
8002+
ReduceReservedScopedAllocationIfOperandInAlternateMemory) {
8003+
// This test is designed to test UpdateReservedScopedAllocationSize() in MSA,
8004+
// which will invoke reserved_scoped_memory_fn to update scoped allocation
8005+
// size. UpdateReservedScopedAllocationSize() should iterate through all
8006+
// scheduled instruction and check if either their operands or outputs has
8007+
// been assigned in alternate memory. If so, corresponding operand/output will
8008+
// be passed to reserved_scoped_memory_fn. We isolate
8009+
// UpdateReservedScopedAllocationSize() by constructing a dummy
8010+
// reserved_scoped_memory_fn that return +1 when operand set is empty, and
8011+
// return +2 when output set is empty, because if either set of an instruction
8012+
// is empty, it is gureented that some scoped allocation is required. We use
8013+
// +1/+2 to distinguish the correctness of each set. Therefore, after MSA
8014+
// pass, for each instruction, there are a few possible outcomes:
80148015
// 1. If both operand set and output set are not empty, scoped allocation
80158016
// size should be 0, since reserved_scoped_memory_fn will return 0.
80168017
// 2. If only operand set is empty, scoped allocation size should be 2, since
80178018
// reserved_scoped_memory_fn will return 2.
80188019
// 3. If only output set is empty, scoped allocation size should be 1, since
80198020
// reserved_scoped_memory_fn will return 1.
80208021
// 4. If both sets are empty, scoped allocation size should be 3.
8021-
// Initially, UpdateReservedScopedVmemSize() will only be invoked after each
8022-
// MSA repacking, we use a similar test HLO module as used in "Repack" test.
8023-
// This test is capable of testing if UpdateReservedScopedVmemSize() can
8024-
// correctly pass operand/output set of all instructions to
8025-
// reserved_scoped_memory_fn.
8022+
// Initially, UpdateReservedScopedAllocationSize() will only be invoked after
8023+
// each MSA repacking, we use a similar test HLO module as used in "Repack"
8024+
// test. This test is capable of testing if
8025+
// UpdateReservedScopedAllocationSize() can correctly pass operand/output set
8026+
// of all instructions to reserved_scoped_memory_fn.
80268027
absl::string_view hlo_string = R"(
80278028
HloModule bug, is_scheduled=true
80288029

@@ -8059,11 +8060,13 @@ TEST_F(MemorySpaceAssignmentTest, ReduceReservedScopedVmemIfOperandInVmem) {
80598060
int64_t scoped_memory_size = 0;
80608061
if (operands_in_alternate_memory.empty()) {
80618062
scoped_memory_size += 1;
8062-
LOG(INFO) << instruction->name() << " has no operand in vmem";
8063+
LOG(INFO) << instruction->name()
8064+
<< " has no operand in alternate memory";
80638065
}
80648066
if (outputs_in_alternate_memory.empty()) {
80658067
scoped_memory_size += 2;
8066-
LOG(INFO) << instruction->name() << " has no output in vmem";
8068+
LOG(INFO) << instruction->name()
8069+
<< " has no output in alternate memory";
80678070
}
80688071
return scoped_memory_size;
80698072
};
@@ -8196,7 +8199,7 @@ TEST_F(MemorySpaceAssignmentTest, ScopedAllocationWithDifferentOffset) {
81968199
}
81978200

81988201
TEST_F(MemorySpaceAssignmentTest,
8199-
ReduceReservedScopedVmemUpdatesPeakMemoryUsage) {
8202+
ReduceReservedScopedAllocationUpdatesPeakMemoryUsage) {
82008203
// This test is designed to test that the peak_memory_usage_ is updated
82018204
// correctly after scoped memory allocation is updated. The test HLO module
82028205
// has two HLO values: a and b. The size of a is 64, and the size of b is 128.

0 commit comments

Comments
 (0)