+
    &j/                         ^ RI t ^ RIt^ RIHt ^ RIt^ RIt^ RIHtHtH	t	H
t
Ht ^ RIHtHtHtHtHtHt R.t]! RRR7       ! R R4      4       tR	 tR# )
    N)
deprecated)_disable_profiler_legacy_enable_profiler_legacy
DeviceTypeProfilerConfigProfilerState)_filter_name_filter_stack_entry_rewrite_name	EventListFunctionEventMEMORY_EVENT_NAMEprofilez`torch.autograd.profiler_legacy.profile` is deprecated and will be removed in a future release. Please use `torch.profiler` instead.)categoryc                     a  ] tR t^t o RtRRRRRRRRRRRRR/R	 lltR
 tR tR tR t	R t
R tR tRR lt]P                  P                  ]n        R t]P                  P                  ]n        RV 3R lR lltRR lt]P"                  P                  ]n        R t]P$                  P                  ]n        ]R 4       tRtV tR# )r   z'DEPRECATED: use torch.profiler instead.use_cudaFrecord_shapes
with_flopsprofile_memory
with_stackwith_modulesc               
   Wn         V P                   '       g   R # W n        R V n        RV n        W0n        W@n        V ;P                  V P
                  ,          un        WPn        W`n        Wpn        V P                  '       dD   \        P                  P                  4       '       g    \        P                  ! R^R7       RV n        V P                  '       d   \        P                  V n        R # \        P"                  V n        R # )NFz/CUDA is not available, disabling CUDA profiling)
stacklevel)enabledr   function_eventsenteredr   r   r   r   r   torchcudais_availablewarningswarnr   CUDAprofiler_kindCPU)selfr   r   r   r   r   r   r   s   &&$$$$$$v/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/autograd/profiler_legacy.py__init__profile.__init__$   s     %||| #*$doo-,$(===!8!8!:!:MMA "DM===!.!3!3D!.!2!2D    c           
         \        V P                  V P                  V P                  V P                  V P
                  V P                  \        P                  P                  P                  4       4      # N)r   r#   r   r   r   r   r   r   _C	_profiler_ExperimentalConfigr%   s   &r&   configprofile.configH   sW    OOOOHH224	
 		
r)   c                    V P                   '       g   R # V P                  '       d   \        R4      hRV n        V P                  4        V # )Nz)Profiler context manager is not reentrantT)r   r   RuntimeError_start_tracer/   s   &r&   	__enter__profile.__enter__T   s;    |||<<<JKKr)   c                8    \        V P                  4       4       R # r+   )r   r0   r/   s   &r&   r4   profile._start_trace]   s    .r)   c                d   V P                   '       g   R # V P                  '       d   \        P                  P	                  4        \        4       p\        V4      p\        TV P                  '       d   RMR V P                  V P                  R7      V n
        V P                  P                  4        R# )Nr   )
use_devicer   r   F)r   r   r   r   synchronizer   _parse_legacy_recordsr   r   r   r   _build_tree)r%   exc_typeexc_valexc_tbrecordsparsed_resultss   &&&&  r&   __exit__profile.__exit__`   s}    |||===JJ""$*,.w7(!%vD..	 
 	((*r)   c                L    V P                   f   R# \        V P                   4      # )Nz$<unfinished profiler_legacy.profile>)r   reprr/   s   &r&   __repr__profile.__repr__s   s"    '9D(())r)   c                L    V P                   f   R# \        V P                   4      # )Nz,<unfinished profile.profiler_legacy.profile>)r   strr/   s   &r&   __str__profile.__str__x   s"    'A4''((r)   c                8    V P                   f   \        R4      hR # )NzProfiler didn't finish running)r   r3   r/   s   &r&   _check_finishprofile._check_finish}   s    '?@@ (r)   Nc           
         V P                  4        V P                  f   \        R4      hV P                  P                  VVVVVVVR7      # )NExpected profiling results)sort_by	row_limitmax_src_column_widthmax_name_column_widthmax_shapes_column_widthheadertop_level_events_only)rN   r   AssertionErrortable)r%   rR   rS   rT   rU   rV   rW   rX   s   &&&&&&&&r&   rZ   profile.table   s[     	' !=>>##))!5"7$;"7 * 
 	
r)   c                    V P                  4        V P                  f   \        R4      hV P                  P                  V4      # NrQ   )rN   r   rY   export_chrome_trace)r%   paths   &&r&   r^   profile.export_chrome_trace   s=    ' !=>>##77==r)   c                &   < V ^8  d   QhRS[ RS[ /# )   r_   metric)rJ   )format__classdict__s   "r&   __annotate__profile.__annotate__   s     @ @# @s @r)   c                    V P                  4        V P                  f   \        R4      hV P                  '       g   \        R4      hV P                  P	                  W4      # )NrQ   z(export_stacks() requires with_stack=True)rN   r   rY   r   export_stacks)r%   r_   rc   s   &&&r&   ri   profile.export_stacks   sR    ' !=>> !KLL##11$??r)   c                    V P                  4        V P                  f   \        R4      hV P                  P                  W4      # r]   )rN   r   rY   key_averages)r%   group_by_input_shapegroup_by_stack_ns   &&&r&   rl   profile.key_averages   s>    ' !=>>##001EXXr)   c                    V P                  4        V P                  f   \        R4      hV P                  P                  4       # r]   )rN   r   rY   total_averager/   s   &r&   rq   profile.total_average   s;    ' !=>>##1133r)   c                    V P                  4        V P                  f   \        R4      hV P                  P                  # )z;Return CPU time as the sum of self times across all events.rQ   )rN   r   rY   self_cpu_time_totalr/   s   &r&   rt   profile.self_cpu_time_total   s:     	' !=>>##777r)   )
r   r   r   r   r#   r   r   r   r   r   )T)Nd   K   7   P   NF)rt   )Fr   )__name__
__module____qualname____firstlineno____doc__r'   r0   r5   r4   rC   rG   rK   rN   rZ   r   r^   ri   rl   rq   propertyrt   __static_attributes____classdictcell__)re   s   @r&   r   r      s      2"3 	"3
 "3 "3 "3 "3 "3H

/&*
)
A
. OO++EM> #,"?"?"G"G@ @Y %1199L4 &33;;M8 8r)   c                 	   R  pRp. p\         P                  P                  V 4       F$  pVP                  4       pVe   K  VR8X  g   K"  TpK&  	  Ve   VP	                  4       '       d   \        R4      hV  EFh  p/ p/ p/ p	\        4       p
RpV EFK  pV! V4      p\        VP                  4       4      '       g   W9   d   V
P                  V4       KD  VP                  4       R8X  d   Ve   VP                  4       VP                  4       8H  ;'       dK    VP                  4       VP                  4       8H  ;'       d"    VP                  4       VP                  4       8H  pV'       d   V
P                  V4       K  WIV&   ^ W|&   ^ W&   EMPVP                  4       R8X  EdR   W9  d   \        RV R24      hW,          pW|,          pW,          pVP                  4       ;'       g"    VP                  4       VP                  4       8g  pVP	                  4       pVP                  4       p\        R'/ RVP                  4       bR	VP                  4       bR
\!        VP                  4       RR7      bR\!        VP                  4       RR7      bRVP                  4       bRVP#                  V4      bRVP#                  V4      bRVP%                  4       bRVP'                  4       bRVP)                  4        Uu. uF  p\+        V4      '       g   K  VNK  	  upbRVP-                  4       bRVP/                  4       '       d   RMRbRVbRVbRVbRVbRVP1                  4       bR\2        P4                  bRRbRVb pV'       g^   VP/                  4       '       dH   VP7                  V4      pV^ 8  d0   VP9                  VP                  4       VP;                  4       V4       VP=                  V4       W W| W MVP                  4       R 8X  d   \?        V4      p\?        V4      pVV8w  d   \        R!V R"V R#24      hV F&  pVV;;,          VPA                  4       ,          uu&   K(  	  V F&  pVV;;,          VPC                  4       ,          uu&   K(  	  V^ 8X  dG   \        ^ \D        R^ ^ ^ . VPA                  4       VPC                  4       RR$7
      pVP=                  V4       TpEKN  	  EKk  	  VPG                  R% R&7       V# u upi )(c                B    V P                  4       V P                  4       3# )zPReturn a tuple for correlating start and end records in `_parse_legacy_records`.)handlenode_id)records   &r&   _get_record_key._parse_legacy_records.<locals>._get_record_key   s    !122r)   N__start_profilez#Expected a valid local start_recordpushpopzExpected record with key z[ to exist in range_starts. This means that the pop event did not have a corresponding push.idr   nameT)r   with_wildcard
trace_nameFthreadstart_usend_us
fwd_threadinput_shapesstackscoper:   r   cpu_memory_usagedevice_memory_usageis_async	is_remotesequence_nrdevice_type	is_legacyflopsmemory_alloczBExpected CPU and CUDA memory allocation handles to match, but got z	 CPU and z CUDA)
r   r   r   r   r   r   r   r   r   r   c                 \    V P                   P                  V P                   P                  ) .# r+   )
time_rangestartend)evts   &r&   <lambda>'_parse_legacy_records.<locals>.<lambda>F  s     CNN$8$83>>;M;M:M#Nr)   )key )$	itertoolschainfrom_iterabler   r   rY   setr	   addkindr   r   	thread_idr   r   r   r   cpu_elapsed_usfwd_thread_idshapesr   r
   r   has_cudar   r   r$   cuda_elapsed_usappend_kerneldeviceappendlenr   cuda_memory_usager   sort)thread_recordsr   start_record	functionsr   r   thread_record_listcpu_memory_allocscuda_memory_allocsrange_startsfiltered_handlesprev_record
record_key	duplicater   r   r   r   is_remote_eventstart_flopsentryfedurationnum_open_handles_cpunum_open_handles_cudar   s   &                         r&   r<   r<      s   3 LI ////?{{}D,=$=!L @
 |5577BCC,5(F(0JFKKM**j.L $$Z0{{}& *#((*fkkm; F F',,.&++-?F F'//1V^^5EE 
 !(,,Z8 +1Z(01!-12".%'1(3J< @[ [ 
 %0#4#@ $6$B! >>+XX0AVEUEUEW0W"("2"2"4#kkm" }}"NN, 'EJJLM  -%**,eT	
 !??, *88? (66v>  %224 "' ,1;;=+8%<OPU<V=  ++- */)9)9vt &6  ):!" &#$ .%& !& 1 1 3'( !+)* #+, &-2  ENN$4$4$44V<H!|((u||~xP  $ ,%1&2.0'*+<'=$(+,>(?%'+@@(##7"8	BWAXX]_  0F%f-1H1H1JJ- 00F&v.&2J2J2LL. 1'1,&.#' !"  )/)@)@)B,2,D,D,F"&B $$R( KC ) -d NNNNOws   .S8S8)r   r    typing_extensionsr   r   
torch.cudatorch.autogradr   r   r   r   r   torch.autograd.profiler_utilr	   r
   r   r   r   r   __all__r   r<   r   r)   r&   <module>r      sa      (     + +
_8 _8
_8DDr)   