
    ggU                        S SK r S SKJrJrJr  \" SS5      \" SS5      /r\" SS\R                  S S	5      \" S
S\R                  S S	5      /r\" SS\R                  S S	5      \" SS\R                  S S	5      /rS r	S r
S rS rS rg)    N)MetricRequestRequestedMetricsParser
Importance*device__attribute_compute_capability_majorcc_major*device__attribute_compute_capability_minorcc_minor#profiler__pmsampler_interval_cyclesintervalFzgpc__cycles_elapsed.maxduration!profiler__pmsampler_interval_timezgpu__time_duration.sumc                      g)NPMSamplingData r       2nsight-compute-2025.1.1/sections/PMSamplingData.pyget_identifierr   +   s    r   c                      g)NzPM Sampling Datar   r   r   r   get_namer   /   s    r   c                      g)Nz/Detection of PM sampling data collection issuesr   r   r   r   get_descriptionr   3   s    <r   c                      g)N
PmSamplingr   r   r   r   get_section_identifierr   7   s    r   c                    [         R                  " U 5      nUR                  S5      R                  S5      nUR	                  5       n[        X5      R                  [        5      nUS   R                  5       S-  US   R                  5       -   nUS:  a  g US:  a!  [        X5      R                  [        5      nSnO [        X5      R                  [        5      nSnUS	   R                  5       nUS
   R                  5       n	U	(       a  U(       aw  X-  n
SnU
S:  a  SR                  U
5      nOU
S:  a  SR                  U
5      nU(       a:  X:  a
  US-  nUS-  nUR                  [         R                  R                  U5        g g g g )Nr   r   
   r	   K   P   i  i N  r   r       zpSampling interval is {:.1f}x of the workload duration, which likely results in no or very few collected samples.g?zrSampling interval is larger than 10% of the workload duration, which likely results in very few collected samples.z[ For better results, use the --pm-sampling-interval option to reduce the sampling interval.z Use --pm-sampling-buffer-size to increase the sampling buffer size for the smaller interval, or don't set a fixed buffer size and let the tool adjust it automatically.)NvRulesget_contextrange_by_idxaction_by_idxfrontendr   parserequested_metrics_basevaluerequested_metrics_timerequested_metrics_cyclesformatmessage	IFrontendMsgType_MSG_WARNING)handlectxactionfemetrics_baseccmetricsmin_intervalsampling_intervalsampling_durationratior,   s               r   applyr:   :   s   


f
%Ca ..q1F	B)&9??@VWL	j	!	'	'	)B	.j1I1O1O1Q	QB	Bw	Bw(8>>?UV(8>>?WX
+113
+113.!5A: I  P  P  QV  WGS[ K  R  R  SX  YG /xx  F  FJJw((<<gF	  /r   )r!   RequestedMetricsr   r   r   r'   OPTIONALr*   r)   r   r   r   r   r:   r   r   r   <module>r=      s   2  N N >
K>
K  7ZEXEXZ[]bc+Z9L9LaQVW  5z:CVCVXY[`a*J
8K8KQPUV 
=!Gr   