class_docstr: The SageMaker Debugger ProfilerRule class configures *profiling* rules.
  
  SageMaker Debugger profiling rules automatically analyze
  hardware system resource utilization and framework metrics of a
  training job to identify performance bottlenecks.
  
  SageMaker Debugger comes pre-packaged with built-in *profiling* rules.
  For example, the profiling rules can detect if GPUs are underutilized due to CPU bottlenecks or
  IO bottlenecks.
  For a full list of built-in rules for debugging, see
  `List of Debugger Built-in Rules <https://docs.aws.amazon.com/sagemaker/latest/dg/debugger-built-in-rules.html>`_.
  You can also write your own profiling rules using the Amazon SageMaker
  Debugger APIs.
  
  .. tip::
      Use the following ``ProfilerRule.sagemaker`` class method for built-in profiling rules
      or the ``ProfilerRule.custom`` class method for custom profiling rules.
      Do not directly use the `Rule` initialization method.
class_docstr_tok: ["The","SageMaker","Debugger","ProfilerRule","class","configures","*","profiling","*","rules",".","SageMaker","Debugger","profiling","rules","automatically","analyze","hardware","system","resource","utilization","and","framework","metrics","of","a","training","job","to","identify","performance","bottlenecks",".","SageMaker","Debugger","comes","pre-packaged","with","built-in","*","profiling","*","rules",".","For","example",",","the","profiling","rules","can","detect","if","GPUs","are","underutilized","due","to","CPU","bottlenecks","or","IO","bottlenecks",".","For","a","full","list","of","built-in","rules","for","debugging",",","see","`","List","of","Debugger","Built-in","Rules","<","https",":","\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/debugger-built-in-rules.html",">","`","_",".","You","can","also","write","your","own","profiling","rules","using","the","Amazon","SageMaker","Debugger","APIs",".","..","tip",":",":","Use","the","following","``","ProfilerRule.sagemaker","``","class","method","for","built-in","profiling","rules","or","the","``","ProfilerRule.custom","``","class","method","for","custom","profiling","rules",".","Do","not","directly","use","the","`","Rule","`","initialization","method","."]
docstr: Initialize a ``ProfilerRule`` object for a *built-in* profiling rule.
  
  The rule analyzes system and framework metrics of a given
  training job to identify performance bottlenecks.
  
  Args:
      base_config (rule_configs.ProfilerRule): The base rule configuration object
          returned from the ``rule_configs`` method.
          For example, 'rule_configs.ProfilerReport()'.
          For a full list of built-in rules for debugging, see
          `List of Debugger Built-in Rules
          <https://docs.aws.amazon.com/sagemaker/latest/dg/debugger-built-in-rules.html>`_.
  
      name (str): The name of the profiler rule. If one is not provided,
          the name of the base_config will be used.
      container_local_output_path (str): The path in the container.
      s3_output_path (str): The location in Amazon S3 to store the profiling output data.
          The default Debugger output path for profiling data is created under the
          default output path of the :class:`~sagemaker.estimator.Estimator` class.
          For example,
          s3://sagemaker-<region>-<12digit_account_id>/<training-job-name>/profiler-output/.
  
  Returns:
      :class:`~sagemaker.debugger.ProfilerRule`:
      The instance of the built-in ProfilerRule.
code: def sagemaker(
      cls,
      base_config,
      name=None,
      container_local_output_path=None,
      s3_output_path=None,
      instance_type=None,
      volume_size_in_gb=None,
  ):
      """Initialize a ``ProfilerRule`` object for a *built-in* profiling rule.
  
      The rule analyzes system and framework metrics of a given
      training job to identify performance bottlenecks.
  
      Args:
          base_config (rule_configs.ProfilerRule): The base rule configuration object
              returned from the ``rule_configs`` method.
              For example, 'rule_configs.ProfilerReport()'.
              For a full list of built-in rules for debugging, see
              `List of Debugger Built-in Rules
              <https://docs.aws.amazon.com/sagemaker/latest/dg/debugger-built-in-rules.html>`_.
  
          name (str): The name of the profiler rule. If one is not provided,
              the name of the base_config will be used.
          container_local_output_path (str): The path in the container.
          s3_output_path (str): The location in Amazon S3 to store the profiling output data.
              The default Debugger output path for profiling data is created under the
              default output path of the :class:`~sagemaker.estimator.Estimator` class.
              For example,
              s3://sagemaker-<region>-<12digit_account_id>/<training-job-name>/profiler-output/.
  
      Returns:
          :class:`~sagemaker.debugger.ProfilerRule`:
          The instance of the built-in ProfilerRule.
  
      """
      used_name = name or base_config.rule_name
      if used_name.startswith("DetailedProfilerProcessingJobConfig"):
          if volume_size_in_gb is None:
              volume_size_in_gb = (
                  DETAIL_PROF_PROCESSING_DEFAULT_VOLUME_SIZE
              )
          if instance_type is None:
              instance_type = (
                  DETAIL_PROF_PROCESSING_DEFAULT_INSTANCE_TYPE
              )
      return cls(
          name=used_name,
          image_uri="DEFAULT_RULE_EVALUATOR_IMAGE",
          instance_type=instance_type,
          container_local_output_path=container_local_output_path,
          s3_output_path=s3_output_path,
          volume_size_in_gb=volume_size_in_gb,
          rule_parameters=base_config.rule_parameters,
      )
  
imports: from __future__ import absolute_import
  from abc import ABC
  from typing import Union, Optional, List, Dict
  import attr
  import smdebug_rulesconfig
  from sagemaker import image_uris
  from sagemaker.utils import build_dict, name_from_base
  from sagemaker.workflow.entities import PipelineVariable
  from sagemaker.debugger.profiler_constants import DETAIL_PROF_PROCESSING_DEFAULT_INSTANCE_TYPE, DETAIL_PROF_PROCESSING_DEFAULT_VOLUME_SIZE
label_desc: Use image node_id 1 for calling the ProfilerRule obj's underlying member method code with example usage: obj.sagemaker(cls, base_config, name, container_local_output_path, s3_output_path, instance_type, volume_size_in_gb) and returns: cls