Skip to content

Commit 4ea73ce

Browse files
committed
resolve comments and pylint
1 parent 07f5662 commit 4ea73ce

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/maxtext/utils/elastic_utils.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ def record_slice_state(recorder, active_slices_override: int | None = None) -> N
3737
active_slices = active_slices_override if active_slices_override is not None else len(elastic_manager.active_slice_indices)
3838
total_slices = len(elastic_manager.slice_to_devices)
3939

40-
if recorder:
41-
recorder.record_elastic_slice_counts(
42-
available_slices=available_slices,
43-
active_slices=active_slices,
44-
total_slices=total_slices
45-
)
40+
recorder.record_elastic_slice_counts(
41+
available_slices=available_slices,
42+
active_slices=active_slices,
43+
total_slices=total_slices
44+
)
4645

4746
def record_elastic_event_start(recorder, config) -> None:
4847
"""Records start of an elastic scale up event."""

tests/unit/elastic_utils_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ def test_record_slice_state(self):
108108

109109
fake_recorder = Mock()
110110
fake_recorder.record_elastic_slice_counts = Mock()
111-
111+
112112
elastic_utils.record_slice_state(fake_recorder)
113-
113+
114114
fake_recorder.record_elastic_slice_counts.assert_called_once_with(
115115
available_slices=2,
116116
active_slices=1,

0 commit comments

Comments
 (0)