
    -`ik                     8   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mZ d dlm	Z	m
Z
mZmZmZ d dlmZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d d	lmZmZm Z m!Z! d d
l"m#Z# d dl$m%Z%m&Z& d dl'm(Z( d dl)m*Z* d dl+m,Z, d dl-m.Z. ddl/m0Z0 e	r	 d dl1m2Z2 n# e3$ r e
Z2Y nw xY w e(e4          Z5dZ6 edej7                  Z8de9e8         de9e8         fdZ:de9e8         de;fdZ<edddeege;f         dz  dee9e8         ge9e8         f         fd            Z=ede>e?e@eAe@         z  f         dz  dee9e8         ge9e8         f         fd            Z=ede>e?e@eAe@         z  f         dz  dee9e8         ge9e8         f         fd             Z=ede>e?e@eAe@         z  f         dz  de>e?e@eAe@         z  f         dz  dee9e8         ge9e8         f         fd!            Z=ede9e8         de9e8         fd"            Z=	 d4dddd# d$de9e8         dz  de>e?e@eAe@         z  f         dz  de>e?e@eAe@         z  f         dz  deege;f         dz  d%ed&         dee9e8         ge9e8         f         e9e8         z  fd'Z=d(ed)e
f         de?fd*ZBd+d,d-eddfd.ZCddd/ fde9e8         de>e?e@eAe@         z  f         de>e?e@eAe@         z  f         dz  deege;f         dz  d%ed&         de9e8         fd0ZDe jE        d-eded1         fd2            ZFe jE        ded1         fd3            ZGdS )5    N)Callable	Generator)TYPE_CHECKINGAnyLiteralTypeVaroverload)patch)version)InliningInstructionTranslator)compilation_counter)TorchCompileWithNoGuardsWrapper)CompilationMode
VllmConfigget_current_vllm_configset_current_vllm_config)DynamicShapesType)get_forward_contextis_forward_context_available)init_logger)IntermediateTensors)resolve_obj_by_qualname)is_torch_equal_or_newer   )start_monitoring_torch_compile)
SourceInfo_ignore_compile_vllm_T)boundclsreturnc                 2    t          | t          d           | S )a_  
    A decorator to ignore support_torch_compile decorator
    on the class. This is useful when a parent class has
    a support_torch_compile decorator, but we don't want to
    compile the class `cls` that inherits the parent class.
    This only ignores compiling the forward of the class the
    decorator is applied to.

    If the parent has ignore_torch_compile but the child has
    support_torch_compile, the child will still be compiled.

    If the class has one or more submodules
    that have support_torch_compile decorator applied, compile will
    not be ignored for those submodules.
    T)setattrIGNORE_COMPILE_KEYr    s    o/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/vllm/compilation/decorators.pyignore_torch_compiler'   3   s      C#T***J    c                 .    t          | t          d          S )zA
    Check if the class should be ignored for torch.compile.
    F)getattrr$   r%   s    r&   _should_ignore_torch_compiler+   G   s     3*E222r(   	enable_ifr-   c                     d S N r,   s    r&   support_torch_compiler1   N   	     &)Sr(   dynamic_arg_dimsc                     d S r/   r0   )r3   s    r&   r1   r1   U   r2   r(   mark_unbacked_dimsc                     d S r/   r0   )r5   s    r&   r1   r1   \   r2   r(   c                     d S r/   r0   )r3   r5   s     r&   r1   r1   c   s	    
 &)Sr(   c                     d S r/   r0   r%   s    r&   r1   r1   k   s    69cr(   c                      d S r/   r0   argskwargss     r&   <lambda>r=   u       D r(   )r3   r5   r-   shape_invariantsr?   ).Nc                    dt           t                   dt           t                   ffd}| "t          | t                     sJ  ||           S |S )a
  
    A decorator to add support for compiling the forward method of a class.

    Usage 1: use directly as a decorator without arguments:

    ```python
    @support_torch_compile
    class MyModel(nn.Module):
        def forward(self, x: torch.Tensor, y: Optional[torch.Tensor]): ...
    ```

    Usage 2: use as a decorator with arguments:

    ```python
    @support_torch_compile(dynamic_arg_dims={"x": 0, "y": 0})
    class MyModel(nn.Module):
        def forward(self, x: torch.Tensor, y: Optional[torch.Tensor]): ...
    ```

    `dynamic_arg_dims` is a dictionary that maps argument names to the dynamic
    dimensions of the argument. The dynamic dimensions can be either a single
    integer or a list of integers.

    if `dynamic_arg_dims` is `None`, it is inferred from the type annotation
    of the `forward` method, based on the following default rules:

    - if the argument is annotated as `torch.Tensor` or
        `Optional[torch.Tensor]`, the first dimension will be
        marked as dynamic.
    - if the argument is annotated as `IntermediateTensors`, the first
        dimension of all the tensors in the intermediate tensors
        will be marked as dynamic.

    During runtime, when we actually mark dimensions of tensors,
     it depends on the value of arguments:

    - if it is a single integer (can be negative), the corresponding dimension
        of the argument will be marked as dynamic.
    - if it is `None`, ignored.
    - if it is `IntermediateTensors`, all the tensors in the intermediate
        tensors will be marked as dynamic.
    - otherwise, it will raise an error.

    NOTE: if an argument is `None`, it should always be passed as `None` during
    the lifetime of the model, otherwise, it cannot be captured as a single
    computation graph.

    `enable_if` is a function that takes a `VllmConfig` object as input and
    returns a boolean value indicating whether to compile the model or not.
    This is useful if you want to compile the model only when certain
    conditions are met.

    `mark_unbacked_dims` is a dictionary that maps argument names with a dynamic
    dim to be decorated with `mark_unbacked`.  This is useful if we would like to
    enforce that dynamo does not specialize on 0/1 values in the case of dummy input
    such as for vision model compilation

    `shape_invariants` is a function that gets compiled right before forward.
    The function should have the torch._check calls that are needed to set
    the relationships between different input sizes. For example:
            torch._check(input_ids.size()[0] == inputs_embeds.size()[0])
    This enforces constraints on the symbolic shapes without hardcoding
    specific values. It is needed for some models to avoid data dependent
    errors.
    r    r!   c                 X   t          | d          st          d          t          j        | j                  }}|i }|j                                        D ];\  }}|j        t          j	        t          j	        d z  t          t          d z  fv rd||<   <t                              d| t          |                                                     t          |          dk    rt!          d|  d          |D ] }||j        vrt!          d| d|            !t#          | |          S )	Nforwardz-decorated class should have a forward method.r   z8Inferred dynamic dimensions for forward method of %s: %sz5No dynamic dimensions found in the forward method of z-. Please provide dynamic_arg_dims explicitly.z	Argument z$ not found in the forward method of )hasattr	TypeErrorinspect	signaturerB   
parametersitems
annotationtorchTensorr   loggerdebuglistkeyslen
ValueError_support_torch_compile)	r    siginferred_dynamic_arg_dimskvr3   r-   r5   r?   s	        r&   cls_decorator_helperz3support_torch_compile.<locals>.cls_decorator_helper   s    sI&& 	MKLLL,,$4!$,(*%,,.. 5 51<LL4'''$.	$   45-a0LLK.335566   ())Q..FF F F  
 + 	 	A&& LLLsLL   ' &%
 
 	
r(   )typer   
isinstance)r    r3   r5   r-   r?   rW   s    ```` r&   r1   r1   o   s    T)
$r( )
tBx )
 )
 )
 )
 )
 )
 )
 )
 )
V #t$$$$$##C(((r(   fn.c                    dd l }t          j                    }|                    |j                                                   |                    | j                                                   |                    t          | j        j	                                                             |
                                S )Nr   )vllmhashlibsha256update__version__encode__qualname__str__code__co_firstlineno	hexdigest)rZ   r\   sha256_hashs      r&   _model_hash_keyrh      s    KKK.""Kt'..00111r--//000s2;566==??@@@  """r(   source_infor   vllm_configc                 j   ddl m}m} i }| j        D ]V}t          j        |j                 }t          j        |          }|j	        j
                            |           |j        ||<   W ||          } |t          |                                                    }	||	k    rt          d          d S )Nr   )_compute_code_hash_compute_code_hash_with_contentzJSource code has changed since the last compilation. Recompiling the model.)cachingrl   rm   inlined_sourcessysmodulesmodulerE   getfilecompilation_configtraced_filesaddcontentsetrO   RuntimeError)
ri   rj   rl   rm   file_contentssourcerr   fileexpected_checksumactual_checksums
             r&   _verify_source_unchangedr      s     MLLLLLLLM- - -V]+v&&&377===$nd77FF((]-?-?-A-A)B)BCCOO++X
 
 	
 ,+r(   c                      d S r/   r0   r:   s     r&   r=   r=     r>   r(   c                   	 t           | j        v r| S | j        t           fz   | _        | j        	t          | t          d           ddddt
          dt          dz  dt          dt          d	df
	fd
}|| _        dt          t
                   dt          dt          dt          d	df
fddt          t
                   dt          dt          d	t          ffd}dt          t
                   d	dfd}|| _        || _        | S )zQ
    A decorator to add support for compiling the forward method of a class.
    FN )rj   prefixselfrj   r   r<   r!   c                   |t                      }t          j                  }d|j        v r||d<   d|j        v r||d<    | fi | || _        | j        j        | _        d u p
 |          }| j        j        t          j        t          j	        fv pt          | j                  p| | _        | j        rd S | _        d| _        t          xj        dz  c_        d| _        t%          j        |            d S )Nrj   r   Fr   )r   rE   rF   rG   rj   rt   moder   NONESTOCK_TORCH_COMPILEr+   	__class__do_not_compile_check_shape_invariants#was_aot_compile_fn_loaded_from_diskr   num_models_seencompiledr   __init__)	r   rj   r   r<   rS   enable_compiler-   old_initr?   s	         r&   r   z(_support_torch_compile.<locals>.__init__   s9    133K
 ))CN**$/F=!s~%%%F8     &"&"2"E"d*Dii.D.D #($o&IJK "+DN;;" "!	 	  	F'7$380++q0++ 	(066666r(   modds_typer;   c                   
 dt           j        dt          t                   dd ffd}t	          j        | j        j                  } |j        | g|R i |}|	                                 
                                D ]\  }}|j                            |          

t          |t                    r|gn|}t          
t           j                  r
fd|D             } |
|           pt          
t                    r7
j                                        D ]fd|D             } ||           t#          d| d| d	t%          
           d
          r
                                D ]\  }}|j                            |          

t          |t                    r|gn|}t          
t           j                  r
fd|D             }t'          d          rE|D ]A}	t           j        j                            
|	
                                |	                    Bt           j        j                            
|           d S d S )Nargdimsr!   c                 `   t           j        k    r|t          d          rF|D ]A}t          j        j                            | ||                                 |                    Bd S t          j        j                            | |           d S t          j                            | |           d S )N
2.10.0.devhint_override)	r   UNBACKEDr   rJ   _dynamo
decoratorsmark_unbackedsizemark_dynamic)r   r   dimr   s      r&   r   zJ_support_torch_compile.<locals>._mark_dynamic_inputs.<locals>.mark_dynamicO  s    +444*<88 F#  0>>CHHJJsO ?     
 M,::3EEEEE**355555r(   c                 4    g | ]}|d k     r
j         |z   n|S r   ndim.0r   r   s     r&   
<listcomp>zH_support_torch_compile.<locals>._mark_dynamic_inputs.<locals>.<listcomp>e  s+    OOO3cAggCHsNN3OOOr(   c                 4    g | ]}|d k     r
j         |z   n|S r   r   )r   r   tensors     r&   r   zH_support_torch_compile.<locals>._mark_dynamic_inputs.<locals>.<listcomp>j  s-    VVV#S1WWc 1 1#VVVr(   zUnsupported dynamic dimensions z for argument z with type .c                 4    g | ]}|d k     r
j         |z   n|S r   r   r   s     r&   r   zH_support_torch_compile.<locals>._mark_dynamic_inputs.<locals>.<listcomp>x  s+    SSSs#''3sSSSr(   r   r   )rJ   rK   rN   intrE   rF   r   rB   bindapply_defaultsrH   	argumentsgetrY   r   tensorsvaluesrQ   rX   r   r   r   r   r   )r   r   r;   r<   r   rS   
bound_argsrU   r   r   r   r   r3   r5   s    `        @@r&   _mark_dynamic_inputsz4_support_torch_compile.<locals>._mark_dynamic_inputsL  s    
	6el 
	6$s) 
	6 
	6 
	6 
	6 
	6 
	6 
	6  566SXc3D333F33
!!###'--// 	 	GAt&**1--C!+D#!6!6@vvDc5<00 OOOO$OOOD Ld++++%899 	"%+"4"4"6"6 3 3VVVVQUVVV$VT22223
 %K K K01K K>B3iiK K K      	N-3355 N N4 *..q11?%/c%:%:DD66D!#u|44 	NSSSSdSSS2<@@ N'+ " " % 8 F F$'CHHJJsO !G !" !" !" !""
 "M4BB3MMM	N 	NN Nr(   c                      j         st          j                                        r  j        |i |S t                      r t                      j        r  j        |i |S t           dd           =t           j
                  5    j         g|R i |cd d d            S # 1 swxY w Y    j        j        j        }d }d }t          j        r	 ddlm}  | j
                  }|                    t)           j                             t+          j        t/          |                                                                                    }t4          j                            t          j        d|          } j
        j        j        }	 j
        j        j         }
t4          j                            |d|	 d|
           }t4          j                            |d          }	 tC           j
                  5  tE          |d          5 }tG           j
                   t          j        $                    | j        j%        	          }d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   tM          |'                                 j
                    j        j        j(        s|)                                 | _        d
 _*        nm# tV          $ r`}t4          j        ,                    |          r)tZ          .                    d|t/          |                     t          j/        r|Y d }~nd }~ww xY wt           dd           XtZ          0                    d|           t           j
                  5    j         g|R i |cd d d            S # 1 swxY w Y    j1        r8t          j        r j
        j        j2        dk    sJ tg          j4         g|R i |S   |g|R i | tG           j
                    5                                }tZ          6                    d|            j        j7        8                    |j9                   tt          j;        dtx          dtx          f fd}i }	 t          j=        j>        j?        }d|d<   n*# t          $ r tZ          6                    d           Y nw xY wi }|t          jB        k    rd
|d<   i }t          d          r j        j        jD        |d<   t          jF        tt          d|          5  t          j=        j>        jE        di |5  t           j
                  5  t          jG        jH        jI        jE        di |5  t                      5  t          jK        j>        jE        di |5  t          j        } j
        j        j2        dk    rtZ          .                    d           d}|r`ddlLmM} | _N        | _O         | jP                  5    jQ        |i | _          j         g|R i |}d d d            n# 1 swxY w Y   ntg          j4         g|R i |}d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   d
 _1        |S )Naot_compiled_fnr   )aot_compile_hash_factorstorch_aot_compilerank__modelrb)	f_globalsTz3Cannot load aot compilation from path %s, error: %sz*Directly load AOT compilation from path %seagerzStart compiling function %sself_r!   c                 p    | j         }j        j                            |j                    |           S r/   )f_codert   ru   rv   co_filename)r   codeinline_callr   s     r&   patched_inline_callzE_support_torch_compile.<locals>.__call__.<locals>.patched_inline_call  s7    <D#044T5EFFF;u%%%r(   F enable_cpp_symbolic_shape_guardsz5enable_cpp_symbolic_shape_guards config not availablebacked_size_obliviousr   assume_32bit_indexinginline_call_z.Detected eager backend, disabling AOT compile.r   )set_on_compilation_completer0   )Rr   rJ   compileris_compilingrB   r   r   skip_compiledr*   %maybe_use_cudagraph_partition_wrapperrj   r   rt   dynamic_shapes_configrX   envsVLLM_USE_AOT_COMPILErn   r   appendrh   r]   r^   rc   ra   rf   ospathjoinVLLM_CACHE_ROOTparallel_configrankdata_parallel_indexr   openr   load_compiled_function__globals__r   ri   evaluate_guardsdisable_guard_checkr   	ExceptionexistsrL   warningVLLM_FORCE_AOT_LOADinfor   backendr   __call__original_code_objectrM   ru   rv   r   r   r   r   r   configr   AttributeErrorr   BACKED_SIZE_OBLIVIOUSr   assume_32_bit_indexingr
   objectfxexperimental_config _torch27_patch_tensor_subclasses	_inductorvllm.compilation.backendsr   _aot_compilation_path_aot_cache_dirsave_aot_compiled_functionaot_compile)r   r;   r<   r   	cache_diraot_compilation_pathr   factorshash_keyr   dp_rankf	loaded_fner   r   dynamo_config_patchesr   fx_config_patchesinductor_config_patchesuse_aot_compiler   outputr   r   s   `                      @r&   r   z(_support_torch_compile.<locals>.__call__  s     	1%."="="?"? 	14<0000
 ()) 	1.A.C.C.Q 	14<0000
 4*D11=6t7GHH C C+t+DB4BBB6BBC C C C C C C C C C C C C C C C )?D	#$ 9	G
 :99999!9!9$:J!K!KGNN?4<88999~c'll&9&9&;&;<<FFHHH$# I #38D&6JGY0H0H0Hw0H0HIII#%7<<	7#C#C +D,<== -t4489243CDDD % E ET\%= !F ! !I                              ))>)>)@)@$BRSSS.DT 411333'0$;?88   7>>"677 NNM,A  
 + G     t.55A@BV   ;4;KLL G G/4/FtFFFvFFG G G G G G G G G G G G G G G G = 	S-#6>'IIIJ 3;DR4RRR6RRR 		
 	
 	
 	
 		
 	
 	
 	't'7888#88::24HIII 	,001E1QRRR 4@	&s 	&s 	& 	& 	& 	& 	& 	& 	& !#	R$EAHM!"DEE 	R 	R 	R LLPQQQQQ	R '===9=56 #%"<00 	'=T $$;<
 L-~?R 	Y 	Y M &??)>??		Y 	Y
 2$2BCC	Y 	Y H!)/DD2CDD	Y 	Y -..	Y 	Y O"(CC+BCC	Y 	Y #7O2:gEEOPPP"' YQQQQQQ .B*&/#001PQQ I I+;4+;T+LV+L+LD(1T1$HHHHHHFI I I I I I I I I I I I I I I 9A$XXXXQWXX3	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y 	Y6 s  	B''B+.B++K ?I3A II3I 	 I3#I 	$I3'K 3I77K :I7;AK 
M#AL>>MN$$N(+N(R" "$S	S	#[?Z=!Z&5Z	Y8 A$Y!$X4(Y!4X88Y!;X8<Y!Y8!Y%%Y8(Y%)Y8,Z	8Y<<Z	?Y< Z	Z&ZZ&ZZ&Z=&Z**Z=-Z*.Z=1[=[	[[	[[[c                    | j         rt                              d           d S | j        r| j        r| j        sJ t                              d| j                   	 t          j        | j        d           | j        	                    | j                   t                              d| j                   d S # t          $ r,}t                              d| j        |           Y d }~d S d }~ww xY w)Nz:AOT compiled function was loaded from cache, skipping savez"saving AOT compiled function to %sT)exist_okz!saved AOT compiled function to %sz.unable to save AOT compiled function to %s: %s)r   rL   rM   r   r   r   r   r   makedirssave_compiled_functionr   r   )r   r   s     r&   r   z:_support_torch_compile.<locals>.save_aot_compiled_function7  s   3 	LLUVVVF  	
%)%?	
DHDW	
 	
W 	8$:TUUU		K+d;;;; 778RSSSKK;T=WXXXXX 	 	 	NN@*        	s   AB8 8
C.!C))C.)r   	__bases__r   r#   r$   r   r   rc   r   rX   r   r   r   )
r    r3   r5   r-   r?   r   r   r   r   r   s
    ````   @@r&   rR   rR   	  s    '#-77

 M%D$FFCM|HC#U+++
 *.	(7 (7 (7(7  $&(7 	(7
 (7 
(7 (7 (7 (7 (7 (7 (7 (7T CL3N"X3N 13N:=3NIL3N	3N 3N 3N 3N 3N 3N 3NjstBx s ss ss s s s s s slb d    * CL%?C"Jr(   )NNNc              #      K   ddl m  j        }|j                                        r|j        r}ddlm} ddlm	 ddl
m} t          |                                          dt          dt          f         d|d	t          f fd
}t           j        j                            |           dV  |j                                        r-|j        r(t           j        j                            d           dS dS dS )a  
    Context manager to set/unset customized cudagraph partition wrappers.

    If we're using Inductor-based graph partitioning, we currently have the
    whole `fx.Graph` before Inductor lowering and the piecewise
    splitting happens after all graph passes and fusions. Here, we add
    a custom hook for Inductor to wrap each partition with our static
    graph wrapper class to maintain more control over static graph
    capture and replay.
    r   )CUDAGraphMode)CUDAGraphWrapperMetadata)CUDAGraphOptions)current_platformr   .metadatar!   c                 ~    |j         }|j        } | j         |dk    |dk    ||dz
  k                        S )Nr   r   )debug_log_enable
gc_disableweak_ref_output)runnablerj   runtime_modecudagraph_options)partition_indexnum_partitions	PIECEWISE)r   r  partition_idr  r
  r  static_graph_wrapper_classrj   s       r&   customized_cudagraph_wrapperzKmaybe_use_cudagraph_partition_wrapper.<locals>.customized_cudagraph_wrappero  sm     $3L%4N--'*4"2"2%1Q%6+q0$0NQ4F$F# # #		 	 	 	r(   N)vllm.configr
  rt   cudagraph_modehas_piecewise_cudagraphsuse_inductor_graph_partitiontorch._inductor.utilsr  vllm.compilation.cuda_graphr  vllm.platformsr  r   get_static_graph_wrapper_clsr   r   rJ   r   utils!set_customized_partition_wrappers)rj   rt   r  r  r  r
  r  r  s   `    @@@r&   r   r   Q  s{      *)))))$7)BBDD
;
 	CBBBBB@@@@@@333333%<99;;&
 &
"	S!	-E		 	 	 	 	 	 	 	 	  	??(	
 	
 	
 
EEE 	)BBDDF;F 	??EEEEE	F F F Fr(   c               #     K   ddl m} m}m}m} dt
          dt
          dt          d         fd}t          j        d          t          j        t          j
                  cxk    rt          j        d	          k     r	n nd
V  d
S t          j        j                            d| |||g          5  t          d|          5  d
V  d
d
d
           n# 1 swxY w Y   d
d
d
           d
S # 1 swxY w Y   d
S )a  
    Add support for using tensor subclasses (ie `BasevLLMParameter`, ect) when
    using torch 2.7.0. This enables using weight_loader_v2 and the use of
    `BasevLLMParameters` without having to replace them with regular tensors
    before `torch.compile`-time.
    r   )BasevLLMParameterModelWeightParameterRowvLLMParameter_ColumnvLLMParameterr;   r<   r!   Fc                      dS )NFr0   r:   s     r&   return_falsez6_torch27_patch_tensor_subclasses.<locals>.return_false  s    ur(   z2.7z2.8Ntraceable_tensor_subclassesz9torch._dynamo.variables.torch.can_dispatch_torch_function)vllm.model_executor.parameterr'  r(  r)  r*  r   r   r   parserJ   r`   r   r   r
   )r'  r(  r)  r*  r,  s        r&   r   r     s                C 3 75>     }Uw}U->??VVVV'-PUBVBVVVVVV 	"")!$$ 		
 	
  	G	
 	
  	                                s6   -C'>CC'C	C'C	C''C+.C+r/   )H
contextlibr]   rE   r   rp   collections.abcr   r   typingr   r   r   r   r	   unittest.mockr
   rJ   torch.nnnn	packagingr   torch._dynamo.symbolic_convertr   	vllm.envsr   vllm.compilation.counterr   vllm.compilation.wrapperr   r  r   r   r   r   vllm.config.compilationr   vllm.forward_contextr   r   vllm.loggerr   vllm.sequencer   vllm.utils.import_utilsr   vllm.utils.torch_utilsr   monitorr   torch._dynamo.packager   ImportError__name__rL   r$   Moduler   rX   r'   boolr+   r1   dictrc   r   rN   rh   r   rR   contextmanagerr   r   r0   r(   r&   <module>rI     s         				 



 / / / / / / / / A A A A A A A A A A A A A A                    H H H H H H       8 8 8 8 8 8 D D D D D D            6 5 5 5 5 5 R R R R R R R R # # # # # # - - - - - - ; ; ; ; ; ; : : : : : : 3 3 3 3 3 3 4444444   


 
X		+ WT###d2h 48    (3d2h 34 3 3 3 3 
 6:) ) )d*+d2) tBxj$r("#) ) ) 
) 
)3d3i/047) tBxj$r("#) ) ) 
) 
)S#S	/12T9) tBxj$r("#) ) ) 
) 
)3d3i/047) S#S	/12T9) tBxj$r("#	) ) ) 
) 
 9tBx 9DH 9 9 9 
 9  z  ;?<@59,H,Hz  z  z 	bDz  3d3i/047z  S#S	/12T9	z 
 d*+d2z  y)z  tBxj$r("#d2h.z  z  z  z z#c* #s # # # #

,6
	
 
 
 
, =A59,H,HE E	bE3d3i/0E S#S	/12T9E d*+d2	E
 y)E 
"XE E E EP
 7F7F 7F 7F 7F 7Ft #)4D*E # # # # # #s   B B%$B%