---
# Add description/tips for each metric in this section.
# So it could be shown in hover.
Metric Description:

# Define the panel properties and properties of each metric in the panel.
Panel Config:
  id: 1200
  title: Local Data Share (LDS)
  data source:
    - metric_table:
        id: 1201
        title: Speed-of-Light
        header:
          metric: Metric
          value: Avg
          unit: Unit
          tips: Tips
        metric:
          Utilization:
            value: AVG(((100 * SQ_LDS_IDX_ACTIVE) / ($GRBM_GUI_ACTIVE_PER_XCD * $cu_per_gpu)))
            unit: Pct of Peak
            tips:
          Access Rate:
            value: AVG(((200 * SQ_ACTIVE_INST_LDS) / ($GRBM_GUI_ACTIVE_PER_XCD * $cu_per_gpu)))
            unit: Pct of Peak
            tips:
          Theoretical Bandwidth (% of Peak):
            value: AVG((((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4) * TO_INT($lds_banks_per_cu))
              / (End_Timestamp - Start_Timestamp)) / (($max_sclk * $cu_per_gpu) * 0.00128)))
            unit: Pct of Peak
            tips:
          Bank Conflict Rate:
            value: AVG((((SQ_LDS_BANK_CONFLICT * 3.125) / (SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT))
              if ((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) != 0) else None))
            unit: Pct of Peak
            tips:
        comparable: false # for now
        cli_style: simple_bar

    - metric_table:
        id: 1202
        title: LDS Stats
        header:
          metric: Metric
          avg: Avg
          min: Min
          max: Max
          unit: Unit
          tips: Tips
        metric:
          LDS Instrs:
            avg: AVG((SQ_INSTS_LDS / $denom))
            min: MIN((SQ_INSTS_LDS / $denom))
            max: MAX((SQ_INSTS_LDS / $denom))
            unit: (Instr  + $normUnit)
            tips:
          # TODO: Fix baseline comparision logic to handle non existent metrics, then 
          LDS LOAD:
            avg: None
            min: None
            max: None
            unit: (instr + $normUnit)
            tips:
          # TODO: Fix baseline comparision logic to handle non existent metrics, then 
          LDS STORE:
            avg: None
            min: None
            max: None
            unit: (instr + $normUnit)
            tips:
          # TODO: Fix baseline comparision logic to handle non existent metrics, then 
          LDS ATOMIC:
            avg: None
            min: None
            max: None
            unit: (instr + $normUnit)
            tips:
          # TODO: Fix baseline comparision logic to handle non existent metrics, then 
          LDS LOAD Bandwidth:
            avg: None
            min: None
            max: None
            units: Gbps
            tips:
          # TODO: Fix baseline comparision logic to handle non existent metrics, then 
          LDS STORE Bandwidth:
            avg: None
            min: None
            max: None
            units: Gbps
            tips:
          # TODO: Fix baseline comparision logic to handle non existent metrics, then 
          LDS ATOMIC Bandwidth:
            avg: None
            min: None
            max: None
            units: Gbps
            tips:
          Theoretical Bandwidth:
            avg: AVG(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4) * TO_INT($lds_banks_per_cu))
              / $denom))
            min: MIN(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4) * TO_INT($lds_banks_per_cu))
              / $denom))
            max: MAX(((((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) * 4) * TO_INT($lds_banks_per_cu))
              / $denom))
            unit: (Bytes  + $normUnit)
            tips:
          LDS Latency:
            avg: AVG(((SQ_ACCUM_PREV_HIRES / SQ_INSTS_LDS) if (SQ_INSTS_LDS != 0) else None))
            min: MIN(((SQ_ACCUM_PREV_HIRES / SQ_INSTS_LDS) if (SQ_INSTS_LDS != 0) else None))
            max: MAX(((SQ_ACCUM_PREV_HIRES / SQ_INSTS_LDS) if (SQ_INSTS_LDS != 0) else None))
            unit: Cycles
            coll_level: SQ_INST_LEVEL_LDS
            tips:
          Bank Conflicts/Access:
            avg: AVG(((SQ_LDS_BANK_CONFLICT / (SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT))
              if ((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) != 0) else None))
            min: MIN(((SQ_LDS_BANK_CONFLICT / (SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT))
              if ((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) != 0) else None))
            max: MAX(((SQ_LDS_BANK_CONFLICT / (SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT))
              if ((SQ_LDS_IDX_ACTIVE - SQ_LDS_BANK_CONFLICT) != 0) else None))
            unit: Conflicts/Access
            tips:
          Index Accesses:
            avg: AVG((SQ_LDS_IDX_ACTIVE / $denom))
            min: MIN((SQ_LDS_IDX_ACTIVE / $denom))
            max: MAX((SQ_LDS_IDX_ACTIVE / $denom))
            unit: (Cycles  + $normUnit)
            tips:
          Atomic Return Cycles:
            avg: AVG((SQ_LDS_ATOMIC_RETURN / $denom))
            min: MIN((SQ_LDS_ATOMIC_RETURN / $denom))
            max: MAX((SQ_LDS_ATOMIC_RETURN / $denom))
            unit: (Cycles  + $normUnit)
            tips:
          Bank Conflict:
            avg: AVG((SQ_LDS_BANK_CONFLICT / $denom))
            min: MIN((SQ_LDS_BANK_CONFLICT / $denom))
            max: MAX((SQ_LDS_BANK_CONFLICT / $denom))
            unit: (Cycles  + $normUnit)
            tips:
          Addr Conflict:
            avg: AVG((SQ_LDS_ADDR_CONFLICT / $denom))
            min: MIN((SQ_LDS_ADDR_CONFLICT / $denom))
            max: MAX((SQ_LDS_ADDR_CONFLICT / $denom))
            unit: (Cycles  + $normUnit)
            tips:
          Unaligned Stall:
            avg: AVG((SQ_LDS_UNALIGNED_STALL / $denom))
            min: MIN((SQ_LDS_UNALIGNED_STALL / $denom))
            max: MAX((SQ_LDS_UNALIGNED_STALL / $denom))
            unit: (Cycles  + $normUnit)
            tips:
          Mem Violations:
            avg: AVG((SQ_LDS_MEM_VIOLATIONS / $denom))
            min: MIN((SQ_LDS_MEM_VIOLATIONS / $denom))
            max: MAX((SQ_LDS_MEM_VIOLATIONS / $denom))
            unit: (Accesses + $normUnit)
            tips:
          # TODO: Fix baseline comparision logic to handle non existent metrics, then 
          LDS Command FIFO Full Rate:
            avg: None
            min: None
            max: None
            unit: (Cycles  + $normUnit)
            tips:
          # TODO: Fix baseline comparision logic to handle non existent metrics, then 
          LDS Data FIFO Full Rate:
            avg: None
            min: None
            max: None
            unit: (Cycles  + $normUnit)
            tips:
