
    ȅi                     h    S SK r S SKrS SKrS SKJrJrJr  S SKJrJ	r	  S\S\SS4S jr
\" S\
5        g)	    N)_register_handler_Request	_Response)_ExperimentalConfigprofilereqrespreturnc                    [        SS9n[        U R                  S5      5      n[        SUS9 n[        R
                  " U5        S S S 5        [        R                  " SSS9 nWR                  UR                  5        UR                  [        R                  " UR                  5      R                  5       S5        UR                  S	5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)
NT)profile_all_threadsduration)record_shapesexperimental_configtorch_debugz.json)prefixsuffixzapplication/json   )r   float	get_paramr   timesleeptempfileNamedTemporaryFileexport_chrome_tracenameset_contentpathlibPath
read_bytes
set_status)r   r	   r   r   proffs         [/home/james-whalen/.local/lib/python3.13/site-packages/torch/distributed/debug/_handlers.py_torch_profiler$   	   s    -  S]]:./H	t9L	MQU

8 
N 
	$	$M'	Ja  (aff-88:<NO 
K	J 
N	M 
K	Js   C"A+C'
C$'
C5torch_profile)r   r   r   torch._C._distributed_c10dr   r   r   torch.profilerr   r   r$        r#   <module>r*      s=       M M 7 	 d  /> 2r)   