class_docstr: Contiguous memory buffer.
  Allocate a contiguous memory of type `dtype` and size `numel`. It is
  used to reduce memory fragmentation.
  
  Usage: After the allocation, the `_start` index is set tot the first
         index of the memory. A memory chunk starting from `_start` index
         can be `allocated` for an input tensor, with the elements of the
         tensor being coppied. The buffer can be reused by resetting the
         `_start` index.
class_docstr_tok: ["Contiguous","memory","buffer",".","Allocate","a","contiguous","memory","of","type","`","dtype","`","and","size","`","numel","`",".","It","is","used","to","reduce","memory","fragmentation",".","Usage",":","After","the","allocation",",","the","`","_start","`","index","is","set","tot","the","first","index","of","the","memory",".","A","memory","chunk","starting","from","`","_start","`","index","can","be","`","allocated","`","for","an","input","tensor",",","with","the","elements","of","the","tensor","being","coppied",".","The","buffer","can","be","reused","by","resetting","the","`","_start","`","index","."]
docstr: Print memory usage average over time. We would like this value
  to be as high as possible.
docstr_tok: ["Print","memory","usage","average","over","time",".","We","would","like","this","value","to","be","as","high","as","possible","."]
code: def print_average_usage(self):
      """Print memory usage average over time. We would like this value
      to be as high as possible."""
      assert self.track_usage, "You need to enable track usage."
      if torch.distributed.get_rank() == 0:
          print(
              " > usage of {} memory buffer: {:.2f} %".format(
                  self.name,
                  self.in_use_value * 100.0 / self.total_value,
              ),
              flush=True,
          )
  
file_path: megatron-lm/megatron/memory.py
imports: import torch
label_desc: Use image node_id 7 for calling the MemoryBuffer obj's underlying member method code with example usage: obj.print_average_usage() without return types