code: def test_find_best_reset_points():
      """
      Verify that the reset points are correctly computed
      """
      activations = [10, 8, 8, 9, 7, 7, 5, 4, 4]
  
      # Check boundary condition: no checkpoints
      memory, split_points = find_best_reset_points(
          activations, num_checkpoints=0
      )
      assert memory == sum(activations)
  
      # Check boundary condition: checkpoints everywhere
      memory, split_points = find_best_reset_points(
          activations, num_checkpoints=len(activations)
      )
      assert memory == max(activations)
  
      # Check one checkpoint allocation
      memory, split_points = find_best_reset_points(
          activations, num_checkpoints=1
      )
      assert memory == 35
      assert split_points == [4]
      assert sum(activations[: split_points[0]]) == 35
      assert sum(activations[split_points[0] :]) == 27
  
      # Check multiple checkpoint allocation
      memory, split_points = find_best_reset_points(
          activations, num_checkpoints=2
      )
      assert memory == 24
      delimiters = [0] + split_points + [len(activations)]
      splits_memory = [
          sum(activations[i:j])
          for i, j in zip(delimiters[:-1], delimiters[1:])
      ]
      assert max(splits_memory) == memory
  
file_path: fairscale/tests/experimental/tooling/test_layer_memory_tracker.py
imports: from typing import Tuple
  import torch
  import torch.distributed
  import torch.multiprocessing
  import torch.nn
  from torch.nn.parallel import DistributedDataParallel
  from fairscale.experimental.tooling.layer_memory_tracker import LayerwiseMemoryTracker, ProcessGroupTracker, find_best_reset_points
  from fairscale.fair_dev.testing.testing import GPT2, dist_init, skip_if_no_cuda, skip_if_single_gpu, temp_files_ctx
  from fairscale.nn import FullyShardedDataParallel
label_desc: Use image node_id 7 for calling a global function with example usage: test_find_best_reset_points() without return types