docstr: Get a local batch size by the same way that FT Gpt does.
docstr_tok: ["Get","a","local","batch","size","by","the","same","way","that","FT","Gpt","does","."]
code: def get_local_batch_size(self, batch_size):
      """Get a local batch size by the same way that FT Gpt does."""
      local_batch_size = batch_size
      pp_size = self.decoder.pipeline_para_size
      if pp_size > 1:
          if local_batch_size % pp_size == 0:
              local_batch_size //= pp_size
          while local_batch_size > 1024 and local_batch_size % 2 == 0:
              local_batch_size //= 2
      return local_batch_size
  
imports: import math
  from abc import abstractmethod
  from pathlib import Path
  from typing import List, Literal, Optional, Union
  import os
  import numpy
  from .None import comm
  from .None import profiler
  from .gpt import GptInitModelParameters
  from nebullvm.optional_modules.torch import torch
label_desc: Use image node_id 13 for calling the Gpt obj's underlying member method code with example usage: obj.get_local_batch_size(batch_size) and returns: local_batch_size