code: def _get_gpu_info(instance_type: str, session: Session) -> int:
      """Get GPU info for the provided instance"""
      ec2_client = session.boto_session.client("ec2")
  
      split_instance = instance_type.split(".")
      split_instance.pop(0)
  
      ec2_instance = ".".join(split_instance)
  
      instance_info = ec2_client.describe_instance_types(
          InstanceTypes=[ec2_instance]
      )
  
      gpus_info = instance_info.get("InstanceTypes")[0].get("GpuInfo")
  
      if gpus_info:
          return gpus_info.get("Gpus")[0].get("Count")
      raise ValueError("Provided instance_type is not GPU enabled.")
  
file_path: sagemaker-python-sdk/src/sagemaker/serve/utils/local_hardware.py
imports: from __future__ import absolute_import
  import subprocess
  import multiprocessing
  import logging
  import shutil
  from math import ceil, floor
  from platform import system
  from pathlib import Path
  import psutil
  from sagemaker import Session
label_desc: Use image node_id 6 for calling a global function with example usage: _get_gpu_info(instance_type, session) and returns: gpus_info