class_docstr: Profiler that triggers start of DCGM profiler.
class_docstr_tok: ["Profiler","that","triggers","start","of","DCGM","profiler","."]
code: def create_profiling_field_group(
      self,
      fieldIdsToProfile: Optional[Tuple[int, ...]],
  ) -> Optional[DcgmFieldGroup]:
      if self.dcgmGroup is None:
          return None
  
      # Get all field ids that can be profiled.
      profilableFieldIds = self.get_profilable_fields()
  
      # Check which of the provided field ids are valid and invalid.
      if fieldIdsToProfile is None:
          validFieldIds = list(profilableFieldIds)
          invalidFieldIds = []
      else:
          validFieldIds = [
              field_id
              for field_id in fieldIdsToProfile
              if field_id in profilableFieldIds
          ]
          invalidFieldIds = [
              field_id
              for field_id in fieldIdsToProfile
              if field_id not in profilableFieldIds
          ]
  
      if not validFieldIds:
          logger.warning(
              "None of the provided field ids could be profiled.\n"
              f"  Provided: {fieldIdsToProfile}\n"
              f"  Supported: {profilableFieldIds}\n"
              "No data will be captured."
          )
          return None
  
      if invalidFieldIds:
          logger.warning(
              f"The following field ids cannot be profiled: {invalidFieldIds}. "
              f"Profiling {validFieldIds} only."
          )
      dcgmFieldGroup = DcgmFieldGroup(
          self.dcgmHandle, name="Profiling", fieldIds=validFieldIds
      )
      return dcgmFieldGroup
  
file_path: xformers/xformers/profiler/profiler_dcgm_impl.py
imports: from typing import List, Optional, Set, Tuple, Union
  import dcgm_fields
  import torch
  from dcgm_fields import DcgmFieldGetById
  from dcgm_structs import DCGM_GROUP_EMPTY, DCGM_OPERATION_MODE_AUTO
  from pydcgm import DcgmFieldGroup, DcgmGroup, DcgmHandle
  from .profiler import _Profiler, logger
label_desc: Use image node_id 4 for calling the DCGMProfiler obj's underlying member method code with example usage: obj.create_profiling_field_group(fieldIdsToProfile) and returns: dcgmFieldGroup, None, None