code: def _get_default_tensor_parallel_degree(
      hf_model_config: dict, gpu_count: int = None
  ) -> int:
      """Placeholder docstring"""
      available_gpus = _get_available_gpus()
      if not available_gpus and not gpu_count:
          return None
  
      attention_heads = None
      for variant in ATTENTION_HEAD_NAME_VARIENTS:
          attention_heads = hf_model_config.get(variant)
          if attention_heads:
              break
  
      if not attention_heads:
          return 1
  
      tot_gpus = len(available_gpus) if available_gpus else gpu_count
      for i in (n + 1 for n in reversed(range(tot_gpus))):
          if attention_heads % i == 0:
              logger.info(
                  "Max GPU parallelism of %s is allowed. Total attention heads %s",
                  i,
                  attention_heads,
              )
              return i
  
      return 1
  
file_path: sagemaker-python-sdk/src/sagemaker/serve/model_server/djl_serving/utils.py
imports: from __future__ import absolute_import
  from urllib.error import HTTPError
  import math
  import logging
  from sagemaker.serve.utils.types import _DjlEngine
  from sagemaker.djl_inference import defaults
  from sagemaker.djl_inference.model import _get_model_config_properties_from_hf
  from sagemaker.serve.utils.local_hardware import _get_available_gpus
  from sagemaker.serve.builder.schema_builder import SchemaBuilder
label_desc: Use image node_id 2 for calling a global function with example usage: _get_default_tensor_parallel_degree(hf_model_config, gpu_count) and returns: int, None, int, i