Ë
    ßGìjü  ã                  ób  — d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZ	 	 d dl
mZ d dl
mZ dZdZd	Z ej$                  e¬
«      Zej)                  ddde¬«       ej)                  dde¬«       ej)                  dde¬«       ej)                  ddd¬«       ej)                  ddde¬«       ej)                  ddde¬«       ej)                  ddde¬«       ej)                  d dd!e¬«       	 	 	 	 	 	 	 	 	 	 d'd"„Zd#„ Zd$„ Zd%„ Zed&k(  r eej9                  «       «       yy# e$ r	  ed«      ‚w xY w)(é    )ÚannotationsN)Úprofiler)Ú_pywrap_profiler_plugin)Úraw_to_tool_dataz-This script requires `xprof` to be installed.aÏ  
To profile running JAX programs, you first need to start the profiler server
in the program of interest. You can do this via
`jax.profiler.start_server(<port>)`. Once the program is running and the
profiler server has started, you can run `collect_profile` to trace the execution
for a provided duration. The trace file will be dumped into a directory
(determined by `--log_dir`) and by default, a Perfetto UI link will be generated
to view the resulting trace.
zgrpc://é   )Údescriptionz	--log_dirzJDirectory to store log files. Uses a temporary directory if none provided.)ÚdefaultÚhelpÚtypeÚportzPort to collect trace)r
   r   Úduration_in_msz)Duration to collect trace in millisecondsz--no_perfetto_linkz Disable creating a perfetto linkÚ
store_true)r
   Úactionz--hostz	127.0.0.1z,Host to collect trace. Defaults to 127.0.0.1z--host_tracer_levelé   zProfiler host tracer levelz--device_tracer_levelé   zProfiler device tracer levelz--python_tracer_levelzProfiler Python tracer levelc           	     ó.  — |||dœ}t        j                  |�|nt        j                  «       «      }	t	        j
                  t        |› d| › �t        «      t        |	«      dd|t        |«       t        d|	› �«       |	j                  «       }
|
dz  dz  }|j                  «       D �cg c]  }||z  ‘Œ	 }}t        |t        j                  j                   ¬«      }t#        |j%                  d	«      «      }t'        j(                  |gd
i «      \  }}t+        j,                  t        |dz  «      d«      5 }|j/                  |j1                  d«      «       d d d «       |s+t3        j4                  |	«      }t3        j6                  |«       y y c c}w # 1 sw Y   Œ<xY w)N)Úhost_tracer_levelÚdevice_tracer_levelÚpython_tracer_levelÚ:Ú Tz!Dumped profiling information in: ÚpluginsÚprofile)Úkeyz*.xplane.pbÚtrace_viewerzremote.trace.json.gzÚwbzutf-8)ÚpathlibÚPathÚtempfileÚmkdtempr   ÚtraceÚ_strip_addressesÚ_GRPC_PREFIXÚstrÚDEFAULT_NUM_TRACING_ATTEMPTSÚprintÚresolveÚiterdirÚmaxÚosÚpathÚgetmtimeÚnextÚglobÚconvertÚxspace_to_tool_dataÚgzipÚopenÚwriteÚencodeÚjax_profilerÚ_write_perfetto_trace_fileÚ_host_perfetto_trace_file)r   r   ÚhostÚlog_dirr   r   r   Úno_perfetto_linkÚoptionsÚlog_dir_Ú	curr_pathÚroot_trace_folderÚtrace_folderÚtrace_foldersÚlatest_folderÚxplaneÚresultÚ_Úfpr+   s                       úWC:\Users\Stabi\Downloads\virtual-tryon(1)\venv\Lib\site-packages\jax/collect_profile.pyÚcollect_profilerG   B   s�  € ð
 -Ø0Ø0ñ€'ô
 �\‰\ WÐ%8™'¼h×>NÑ>NÓ>PÓQ€(Ü×ÑÜ˜$˜˜q  Ð'¬Ó6Ü	ˆ(ƒmØØ
ØÜ"Øôô Ð
+¨H¨:Ð6Ô7ð
 ×ÑÓ €)Ø )Ñ+¨iÑ7Ðà'×/Ñ/Ô1ó3Ù1ð 9EÐ$ |Ó3Ø1ð ð 3ä�m¬¯©×)9Ñ)9Ô:€-Ü�×"Ñ" =Ó1Ó2€&Ü×)Ñ)¨6¨(°NÀBÓG�)€&ˆ!ä‡y�y”�]Ð%;Ñ;Ó<¸dÔCÀrØ‡H�HˆV�]‰]˜7Ó#Ô$÷ Dñ 
Ü×2Ñ2°8Ó<€DÜ×*Ñ*¨4Õ0ð 
ùò3÷ DÐCús   Â%FÄ/!FÆFc                óD   — | j                  |«      r| t        |«      d  S | S ©N)Ú
startswithÚlen)ÚsÚprefixs     rF   Ú_strip_prefixrN   i   s"   € ØŸL™L¨Ô0ˆŒ3ˆv‹;ˆ<ˆÐ7°aÐ7ó    c           	     ó|   — dj                  | j                  d«      D �cg c]  }t        ||«      ‘Œ c}«      S c c}w )NÚ,)ÚjoinÚsplitrN   )Ú	addressesrM   rL   s      rF   r"   r"   l   s5   € Ø	�‰°Y·_±_ÀSÔ5IÓJÑ5I°”=  FÕ+Ð5IÑJÓ	KÐKùÒJs   Ÿ9c           
     óÈ   — t        | j                  | j                  | j                  | j                  | j
                  | j                  | j                  | j                  «       y rI   )	rG   r   r   r8   r9   r   r   r   r:   )Úargss    rF   ÚmainrW   o   sG   € Ü�$—)‘)˜T×0Ñ0°$·)±)¸T¿\¹\Ø×(Ñ(¨$×*BÑ*BØ×*Ñ*¨D×,AÑ,AõCrO   Ú__main__)r   Úintr   rY   r8   r$   r9   zos.PathLike | str | Noner   rY   r   rY   r   rY   r:   Úbool)Ú
__future__r   Úargparser1   r*   r   r   Újax._srcr   r5   Úxprof.convertr   r   r/   ÚImportErrorÚ_DESCRIPTIONr#   r%   ÚArgumentParserÚparserÚadd_argumentr$   rY   rG   rN   r"   rW   Ú__name__Ú
parse_args© rO   rF   Ú<module>rg      s½  ðõ #ã Û Û 	Û Û õ .ð7Ý3Ý7ð€ð €Ø Ð Ø	 ˆ×	 Ñ	 ¨\Ô	:€Ø × Ñ �K¨ðIàð ô ð × Ñ �FÐ!8¸sÐ Ô CØ × Ñ Ð$ØDÈ3ð ô Pà × Ñ Ð(Ø;Ø'ð ô )ð × Ñ �H kØGØð ô ð × Ñ Ð)°1Ø5¸Cð ô Aà × Ñ Ð+°QØ7¸cð ô Cà × Ñ Ð+°QØ7¸cð ô Cð%1Ø5ð%1ØJMð%1à),ð%1àCFð%1ð '+ó%1òN8òLòCð
 ˆzÒÙ€v×ÑÓÕð øðq ò 7ÙØ5ó	7ð 7ð7ús   ¢D  Ä D.