Adds a max_rematerialized_block_size field.
PiperOrigin-RevId: 301205071 Change-Id: I9403816bbdc1e079a634b6ada730ecf7983eba6c
This commit is contained in:
parent
e17dc08a3c
commit
09e0b6cea4
@ -1648,6 +1648,8 @@ StatusOr<bool> HloRematerialization::RematerializeComputation(
|
||||
} else {
|
||||
// Found a valid block. Reset to start looking for single instructions
|
||||
// again.
|
||||
max_rematerialized_block_size_ =
|
||||
std::max(max_rematerialized_block_size_, max_block_size);
|
||||
changed = true;
|
||||
min_block_size = 1;
|
||||
max_block_size = 1;
|
||||
|
@ -180,6 +180,10 @@ class HloRematerialization : public HloModulePass {
|
||||
// dead. Hence, no net instructions were added.
|
||||
int64 net_instructions_added_ = 0;
|
||||
|
||||
// Size of the largest block that has been rematerialized. This is actually an
|
||||
// upper bound (within a factor of 2) on the block size.
|
||||
int max_rematerialized_block_size_ = 0;
|
||||
|
||||
RematerializationMode mode_;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user