
    ͑i                       % S SK Jr  S SKrS SKrS SKrS SKJrJrJrJ	r	J
r
JrJrJr  S SKrS SKJr  S SKJrJrJrJrJr  S SKJr  S SKJr  SS	KJrJr  \(       ab  S S
KJr  S SK J!r!  S SK"J#r#J$r$  S SKJ%r%  S SK&J'r'  S SK(J)r)  S SK*J+r+  S SK,J-r-  S SK.J/r/J0r0  \	S   r1\\2\3   \4\3S4   \5\3   4   r6S\7S'    " S S\
5      r8\" SS\2S   5      r9\" SS\2S   5      r:/ SQr;SSSS.r<\Rz                  r>Sq?S r@ " S S 5      rA\A" 5       rBSAS! jrC  SB         SCS" jjrDSDS# jrESDS$ jrFSDS% jrGSDS& jrHSDS' jrISDS( jrJSDS) jrKSES* jrL      SFS+ jrM SG         SHS, jjrNSIS- jrO          SJS. jrP        SKS/ jrQSLS0 jrRSMS1 jrSSNS2 jrT\      SO             SPS3 jj5       rU " S4 S55      rV      SQS6 jrW\       SR                 SSS7 jj5       rX\       SR                 STS8 jj5       rX\       SU                 SVS9 jj5       rX   SW         SXS: jjrY      SO             SYS; jjrZ\      SZ                 SSS< jj5       r[\       SR                 STS= jj5       r[       SU                 SVS> jjr[S[S\S? jjr\S[S]S@ jjr]g)^    )annotationsN)TYPE_CHECKINGAnyCallableLiteralProtocolTypeVarUnionoverload)core)_current_expected_place_dygraph_tracerdygraph_onlyin_dynamic_or_pir_modein_pir_mode)signature_safe_contextmanager)OptimizerWithMixedPrecision   )
black_list
white_list)	Generator)AbstractContextManager)	TypeAlias	TypeGuard)Tensor)	PlaceLike)_DTypeLiteral)Layer)
_StateDict)OperatorProgramO0ODO1O2.r   _CustomListc                  P    \ rS rSr          SS jrS	S jrS
S jrSS jrSrg)_OptimizerLike<   c                    g N )selflossstartup_program
parametersno_grad_sets        T/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/paddle/amp/auto_cast.pyminimize_OptimizerLike.minimize=   s	     BE    c                    g r,   r-   r.   s    r3   step_OptimizerLike.stepE   s    r6   c                    g r,   r-   )r.   
state_dicts     r3   set_state_dict_OptimizerLike.set_state_dictG   s    r6   c                    g r,   r-   )r.   set_to_zeros     r3   
clear_grad_OptimizerLike.clear_gradI   s    r6   r-   N)
r/   r   r0   r!   r1   list[Tensor]r2   zset[Tensor]returnz2tuple[list[Operator], list[tuple[Tensor, Tensor]]]rD   None)r<   zdict[str, Tensor]rD   rF   )r@   boolrD   rF   )	__name__
__module____qualname____firstlineno__r4   r9   r=   rA   __static_attributes__r-   r6   r3   r)   r)   <   sI    	E	E %	E %		E
 %	E @	E 	$L<r6   r)   _ModelsTr   _OptimizersT)FLAGS_cudnn_exhaustive_searchFLAGS_conv_workspace_size_limit(FLAGS_cudnn_batchnorm_spatial_persistenti  c                     [         $ r,   )_g_amp_state_r-   r6   r3   	amp_staterT   `   s    r6   c                  f    \ rS rSr% S\S'   S\S'   S\S'   S\S'   S\S	'   S
\S'   SS jrSS jrSrg)AMPGlobalStatee   rC   model_parametersrG   use_master_grad$already_register_final_backward_hookalready_classify_params_meshesz9dict[paddle.distributed.ProcessMesh | None, list[Tensor]]mesh2paramsr   	amp_dtypec                X    / U l         SU l        SU l        SU l        0 U l        SU l        g )NFfloat32)rX   rY   rZ   r[   r\   r]   r8   s    r3   __init__AMPGlobalState.__init__m   s1     "$491.3+"r6   c                     X R                   U'   g r,   )__dict__)r.   namevals      r3   __setattr__AMPGlobalState.__setattr__u   s    !dr6   )r[   rZ   r]   r\   rX   rY   NrE   )rd   strre   r   rD   rF   )rH   rI   rJ   rK   __annotations__r`   rf   rL   r-   r6   r3   rV   rV   e   s0    ""*..$((JJ#"r6   rV   c                     [         $ r,   )_amp_global_stater-   r6   r3   amp_global_staterl   |   s    r6   c                   US:X  a  [        5       n[        5       nXE4$ [        R                  " [        5       U   U   5      n[        R                  " [        5       U   U   5      nU (       a   U(       a  U  H  nXa;   d  M
  [	        S5      e   U (       a0  U  H*  nXe;   a  UR                  U5        UR                  U5        M,     U(       a0  U H*  nXd;   a  UR                  U5        UR                  U5        M,     XE4$ )z>
Update black and white list according to users' custom list.
r#   z+Custom white list overlap custom black list)setcopyr   r   
ValueErrorremoveadd)custom_white_listcustom_black_listleveldtype_white_list_black_listop_names          r3   _update_listrz      s     }ee''))JL/67K))JL/67K.(G+ !NOO ) (G%""7+OOG$ ) (G%""7+OOG$ ) ##r6   c                 z    [        5       n U (       a*  U R                  [        R                  R                  :X  a  ggg)z=
Judge whether current code block is in `amp_guard` context.
TF)r   
_amp_levelr   AmpLevelr%   tracers    r3   _in_amp_guardr      s0     F 0 00r6   c                 v    [        5       n U =(       a'    U R                  [        R                  R                  :H  $ r,   )r   r|   r   r}   r&   r~   s    r3   _in_pure_fp16_guardr      s*    F;f''4==+;+;;;r6   c                     [         R                  R                  R                  5       n U S   S:  =(       d    [         R                  " 5       $ )z0
Judge whether current gpu support float16 amp.
r      )paddledevicecudaget_device_capabilityis_compiled_with_rocm)props    r3   _is_gpu_float16_supportedr      s8     ==335D7a<967799r6   c                 @   [         R                  R                  R                  5       n [         R                  R                  5       nUb'  US:w  a!  [        UR                  S5      S   5      S:  nOSnU S   S:  =(       a    U=(       d    [         R                  " 5       $ )z1
Judge whether current gpu support bfloat16 amp.
False.r      F   )r   r   r   r   versionintsplitr   )r   cuda_versioncuda_version_checks      r3   _is_gpu_bfloat16_supportedr      s     ==335D>>&&(LLG$; !3!3C!8!;<B"7a<..P&2N2N2PPr6   c                     [        5       n [        R                  " U R                  5       5      [        R                  R
                  :  $ )z_
Judge whether current xpu device support float16 amp.
Only XPU2 and XPU3 support float16 amp.
)r   r   get_xpu_device_versionget_device_id
XPUVersionXPU2places    r3   _is_xpu_float16_supportedr      s:    
 $%E##E$7$7$9:??	 r6   c                     [        5       n [        R                  " U R                  5       5      [        R                  R
                  :  $ )z
Judge whether current xpu device support bfloat16 amp.
Only XPU3 support bfloat16 amp.
Although XPU2 supports bfloat16 computing, but XPU2's bfloat16 operators haven't been widely covered.
)r   r   r   r   r   XPU3r   s    r3   _is_xpu_bfloat16_supportedr      s:     $%E##E$7$7$9:??	 r6   c                     [        5       n U R                  5       S:H  =(       dG    U R                  5       S:H  =(       d-    U R                  5       S:H  =(       d    U R                  5       S:H  $ )z;
Judge whether current custom device support bfloat16 amp.
npu	intel_hpuiluvatar_gpu	metax_gpu)r   get_device_typer   s    r3   $_is_custom_device_bfloat16_supportedr      sf     $%E5( 	2  "k1	2  "n4	2   "k1	r6   c                r   SnU R                   (       d  SnU$ [        U [        R                  R                  [        R                  R
                  [        R                  R                  [        R                  R                  [        R                  R                  45      (       a  SnU$ U R                  S:X  d{  US:X  aw  [        U [        R                  R                  [        R                  R                  [        R                  R                  [        R                  R                  45      (       a  SnU$ )NFTfloat16)_cast_to_low_precision
isinstancer   nn	BatchNormBatchNorm1DBatchNorm2DBatchNorm3DSyncBatchNorm_dtype	LayerNormInstanceNorm1DInstanceNorm2DInstanceNorm3D)layerrv   need_keep_fp32s      r3   r   r      s    N ''8 5 
IIII!!II!!II!!II##	
	
 	
    ,,)
#	)			##		((		((		((	
 
 r6   c                t   / n/ nSnUc  / nGO[        U[        R                  R                  5      (       a  U/nO[        U[        5      (       a-  [        U[        R                  R                  5      (       a  U/nO[        U[        5      (       a  U H  n[        U[        R                  R                  5      (       a  UR                  U5        M?  [        U[        R                  R                  5      (       a  UR                  U5        M{  [        U5      e   O[        U5      e[        [        U5      5       H"  nX&   R                  SS9 H
  nSUl        M     M$     [        U5      n[        [        U 5      5       H4  nX   R                  SS9 H  n[        Xs5      (       d  M  SUl        M     M6     g )Nz^excluded_layers must be either a nn.Layer instance/type or a list of nn.Layer instances/types.Tinclude_selfF)r   r   r   r   type
issubclasslistappend	TypeErrorrangelen	sublayersr   tuple)modelsexcluded_layersexcluded_layers_instancesexcluded_layers_typeserror_messageitemidxr   s           r3   set_excluded_layersr     sq    !#tM	OVYY__	5	5%4$5!	OT	*	*z0 0 "1 1	OT	*	*#D$		00)006D&))//22%,,T2.. $ &&S234.3== > 
E ,1E(
 5
 ""78S[![***=E%77/4, > "r6   c                >   U(       a#  U R                  5        H  n[        XAX#5        M     U R                  R                  5        H  u  pVUc  M
  U" Xb5      nM     U R                  R                  5        H  u  pXUc  M
  U" X5      U R                  U'   M!     X l        g r,   )children
_pir_apply_parametersitems_buffersr   )	r.   funcrv   include_sublayersr   keyparamparam_appliedbufs	            r3   r   r   :  s     ]]_EuE= % &&,,.
 .M / MM'')?!%c!1DMM# * Kr6   c                   [         R                  R                  5       n[         R                  R                  5       n[         R                  R	                  U5         UR                  5       nUR                   H  nUR                  5       S:X  d  M  UR                  5       S   U R                  :X  d  M<  UR                  S5      R                  5       n[         R                  " Xa5      nSUl        [         R                  R                  XpR                  5        UR                  U5          O   S S S 5        UR!                  U5        [         R                  R	                  U5         [         R"                  R%                  5         UR                  5       n[         R                  R'                  U R                  5      nU R(                  Ul        U R*                  Ul        U R                  Ul        U R,                  Ul        U R.                  Ul        U R0                  Ul        U R2                  Ul        U R4                  Ul        U R6                  Ul        U R9                  5       nU R;                  U5        UR                  U5        U R=                  U5        S S S 5        g ! , (       d  f       GN|= f! , (       d  f       g = f)Nzbuiltin.set_parameterparameter_namer   T)r   staticdefault_main_programdefault_startup_programprogram_guardglobal_blockopsrd   attrsoperandsourcecastpersistable_pir_opsupdate_parameter	remove_opset_parameters_frompirreset_insertion_point_to_start	parameter	trainablestop_gradientoptimize_attrregularizerdo_model_average	need_clipis_distributedis_parameterget_defining_opreplace_all_uses_withvalue_assign)trv   mainstartupblockopr   
cast_params           r3   _pir_transformr   O  s   ==--/Dmm335G		$	$W	-$$&))B	44HHJ/0AFF:

1,,.#[[6
)-
&00VVD#  
. 	W%		$	$T	*

113!!#__..qvv6
 {{
#$??
 !"
#$??
 !"
&'&8&8
# {{
$%$4$4
!"#..
 	
+	z"! 
+	* 
.	- 
+	*s&   2J$J$5A:J$'D4J6$
J36
Kc                   ^ SU4S jjn[         R                  " 5          [         R                  " S[        S9  [	        XX5        S S S 5        Xl        U $ ! , (       d  f       N= f)Nc                b   > T(       a  [         R                  " U 5      (       d  U $ [        X5      $ r,   )r   is_floating_pointr   )r   rv   floating_onlys     r3   	transform_pir_to_impl.<locals>.transformy  s&    &":":1"="=Ha''r6   ignore)category)r   r   rv   r   rD   zTensor | None)warningscatch_warningsfilterwarningsUserWarningr   r   )r.   rv   r   r  r  s      ` r3   _pir_to_implr  s  sJ    (
 
	 	 	";?4E= 
# KK 
#	"s   &A
A#c           	        [        X5        [        [        U 5      5       H  nX   R                  SS9 H  n[	        XA5      (       a  M  US:X  ah  [        U[        R                  R                  R                  [        R                  R                  R                  45      (       a  UR                  US9  M  [        5       (       a  [        UUSSS9  M  UR                  USSS9  M     M     U $ )NTr   r   )rv   F)rv   r   r  )r   r   r   r   r   r   r   incubater   FusedFeedForwardFusedMultiHeadAttention_amp_decorater   r  _to_impl)r   rv   r   r   r   s        r3   amp_initializer    s    
 0S[![***=Ee++	!jOO&&77OO&&>>' ' ##%#0}}&+"&	 5  + > "2 Mr6   c                    U  Hn  n[        U[        R                  R                  5      (       d  [	        S[        U5       S35      e[        U[        R                  5      (       d  Me  [	        S5      e   g )NzOCurrent train mode is pure fp16, models should be paddle.nn.Layer, but receive r   zFor distributed AMP training, you should first use paddle.amp.decorate() to decorate origin model, and then call paddle.DataParallel get distributed model.)r   r   r   r   RuntimeErrorr   DataParallel)r   models     r3   check_modelsr    sk    %11abfglbmannop  eV0011 n  r6   c                `    SSK JnJn  [        U [        R
                  R                  UU45      $ )Nr   DygraphShardingOptimizerDygraphShardingOptimizerV2)Upaddle.distributed.fleet.meta_optimizers.dygraph_optimizer.dygraph_sharding_optimizerr  r  r   r   	optimizer	Optimizer)r  r  r  s      r3   _is_valid_optimizerr     s3    
 &&$&	
 r6   c                f    U  H+  n[        U5      (       a  M  [        S[        U5       S35      e   g )NzzCurrent train mode is pure fp16, optimizers should be paddle.optimizer.Optimizer or DygraphShardingOptimizer, but receive r   )r   r  r   )
optimizersr  s     r3   check_optimizersr#    sS    	"9-- M  NR  S\  N]  M^  ^_  `   r6   c              #    ^#    [        5       (       d   S5       e[        5       n[        nUqUR                  5       nUS;  a  [	        S5      e[        U[        R                  R                  R                  5      (       a  UR                  nUR                  5       nU (       a  US;  a  [	        S5      eUnU[        5       l        US:X  a  [        R                  n	ODUS:X  a  [        R                   n	O-US:X  a  [        R"                  n	OUS	:X  a  [        R$                  n	['        XX45      u  p[)        5       (       a  U (       d  [        R$                  n	S
n[        R*                  " 5       nUR,                  nW	Ul        [        R.                  " 5       u  p[        R0                  " X5        UR2                  nXl        U	[        R"                  :X  a  UR4                  nX\l         Sv   UqXl        [        R0                  " X5        UUl        U	[        R"                  :X  a  WUl        gg[7        5       nU(       d  [	        S5      eU (       a  UR8                  R;                  5       (       dd  UR8                  R=                  5       (       dE  UR8                  R?                  5       (       d&  [@        RB                  " SUR8                   S35        Sn U (       Ga  UR8                  R=                  5       (       a  US:X  ak  [E        5       (       d\  [        RF                  " [I        5       RK                  5       5      n[@        RB                  " [        RL                  " U5       S35        Sn OpUS:X  aj  [O        5       (       d[  [        RF                  " [I        5       RK                  5       5      n[@        RB                  " [        RL                  " U5       S35        Sn UR8                  R?                  5       (       a-  [Q        5       (       d  US:X  a  [@        RB                  " S5        Sn UR8                  R;                  5       (       Ga8  US:X  a  [S        5       (       dw  [        RT                  RV                  RY                  5       n[@        RB                  " S[        RT                  RV                  R[                  5        SUS    SUS    S35        Sn OUS:X  a  []        5       (       d  [        RT                  RV                  RY                  5       n[        R^                  RW                  5       n[@        RB                  " S[        RT                  RV                  R[                  5        SUS    SUS    SU S3	5        Sn U (       d  [        R$                  n	S
n[        5       R`                  (       a  [        5       Rb                  (       d  S mS nU4S jn[d        Rf                  " S5      S ;   a`  [        5       Rh                   H4  n[k        US!5      (       a  M  SUl6        URo                  U" U5      5        M6     S"[d        Rp                  S'   O[        Rr                  Ru                  U5        S#[        5       l1        U(       ap  UR,                  nW	Ul        UR/                  5       u  pUR1                  X5        UR2                  nUUl        U	[        R"                  :X  a  UR4                  nUUl         Sv   U(       a?  UqWUl        UR1                  WW5        WUl        W	[        R"                  :X  a  WUl        ggg! UqXl        [        R0                  " X5        UUl        U	[        R"                  :X  a  WUl        f f = f! U(       a?  UqWUl        UR1                  WW5        WUl        W	[        R"                  :X  a  WUl        f f f = f7f)$a	  
Create a context which enables auto-mixed-precision(AMP) of operators executed in dynamic graph mode.
If enabled, the input data type (float32 or float16) of each operator is decided
by autocast algorithm for better performance.

Commonly, it is used together with `GradScaler` to achieve Auto-Mixed-Precision in
imperative mode. It is used together with `decorator` to achieve Pure fp16 in imperative mode.

Args:
    enable(bool, optional): Enable auto-mixed-precision or not. Default is True.
    custom_white_list(set|list|tuple|None, optional): The custom white_list. It's the set of ops that support
         fp16 calculation and are considered numerically-safe and performance-critical. These ops
         will be converted to fp16.
    custom_black_list(set|list|tuple|None, optional): The custom black_list. The set of ops that support fp16
         calculation and are considered numerically-dangerous and whose effects may also be
         observed in downstream ops. These ops will not be converted to fp16.
    level(str, optional): Auto mixed precision level. Accepted values are "O1" and "O2": O1 represent mixed precision, the input data type of each operator will be casted by white_list and black_list;
         O2 represent Pure fp16, all operators parameters and input data will be casted to fp16, except operators in black_list, don't support fp16 kernel and batchnorm. Default is O1(amp).
    dtype(str|core.DataType, optional): Whether to use 'float16' or 'bfloat16'. Default is 'float16'.
    use_promote(bool, optional): Whether op's dtype is 'float32', accord 'Promote to the Widest' principle, use 'float32' to calculate.
         Only active on 'AMP-02'. Default is True.

Examples:

    .. code-block:: python

        >>> # doctest: +REQUIRES(env:GPU)
        >>> import paddle

        >>> data = paddle.uniform([10, 3, 32, 32], paddle.float32, -1, 1)
        >>> conv2d = paddle.nn.Conv2D(3, 2, 3, bias_attr=False)
        >>> conv2d = paddle.amp.amp_decorate(models=conv2d, level='O2')
        >>> with paddle.amp.amp_guard():
        ...     conv = conv2d(data)
        ...     print(conv.dtype)
        >>> # doctest: +SKIP("This has diff in xdoctest env")
        paddle.float16
        >>> # doctest: -SKIP
        ...
        >>> with paddle.amp.amp_guard(enable=False):
        ...     conv = conv2d(data)
        ...     print(conv.dtype)
        >>> # doctest: +SKIP("This has diff in xdoctest env")
        paddle.float32
        >>> # doctest: -SKIP
z3We only support 'amp_guard' in dynamic or pir mode.r"   !level should be O0, OD, O1 or O2.r   bfloat16z7If enable amp, dtype should be 'float16' or 'bfloat16'.r$   r%   r&   r#   r_   N;current_tracer is None, maybe it is not in imperative mode.zXamp_guard can only be enabled on CUDAPlace, XPUPlace, and CustomPlace, current place is z, so it makes no effect.Fr   z does not support float16 amp.r'  z does not support bfloat16 amp.z%CustomPlace only support float16 amp.z`For float16, amp only support NVIDIA GPU with Compute Capability 7.0 or higher, current GPU is: z, with Compute Capability: r   r   r   zFor bfloat16, amp only support NVIDIA GPU with Compute Capability 8.0 or higher and CUDA Version 11.0 or higher, current GPU is: z, current CUDA Version is: c                   [        U R                  5      n[        U5       HN  u  pEUR                  5       (       d  M  X5R	                  5          UR                  U   -  X5R	                  5       '   MP     [
        R                  R                  5       n[
        R                  R                  U5      n[
        R                  " U UUUUS9$ )N)dimsprocess_mesh
placementsr   )
r   shape	enumerateis_shardget_dimr   	frameworkr   _get_paddle_placer   )local_tensormeshr,  global_dimsr   	placementr   s          r3   _dtensor_from_local&amp_guard.<locals>._dtensor_from_local  s    "<#5#56&/
&;NC ))++'(9(9(;<tzz#N $$5$5$78 '<
 ((@@B((::5A}} $!%) r6   c                    [        5       R                  (       d  [        5       R                   H  n U c  M  U R                  c  M  U R                  [        5       R                  ;  a$  U /[        5       R                  U R                  '   M]  [        5       R                  U R                     R                  U 5        M     S[        5       l        [        [        5       R                  5      (       aK  [        5       R                  R                  5        H$  u  p[        R                  R                  U5        M&     O1[        R                  R                  [        5       R                  5        S[        5       l        g )NTF)rl   r[   rX   r+  r\   r   r   r   r   eagerset_master_gradsrZ   )r   _paramss      r3   master_grad_hook#amp_guard.<locals>.master_grad_hook  s    ()HH!1!3!D!D ,1C1C1O % 2 2'7'9'E'E!F
 &+G !1 2 > >$)$6$6!" !1 2 > >$)$6$6!""(&- "E IM$&E')5566%5%7%C%C%I%I%K	

33F; &L JJ//(*;; KP "Gr6   c                Z   >^  [         R                  R                  5       UU 4S j5       nU$ )Nc                  > U b  U R                  5       (       a  TR                  c  [        R                  R	                  U R                  5       R                  [        R                  5      R                  5       U R                  STR                  -   S9nT" UU R                  U R                  5      Tl        O7TR                  R                  5       R                  U R                  5       5        U R                  5         g g g )Nz
main_grad@)valuer   rd   )_is_initialized	main_gradr   r:  r   _local_valuer   r   r_   rB  r   rd   r+  r,  add__clear_data)tmp_gradtmpr7  r   s     r3   
param_hook=amp_guard.<locals>._update_main_grad_hook.<locals>.param_hook  s    +0H0H0J0J ??2"&**"3"3&.&;&;&=!%fnn!5!&&.nn%1EJJ%> #4 #C /B # ( 5 5 ( 3 3/EO "OO88:?? ( 5 5 7 !,,.% 1K+r6   )r   autogradno_grad)r   rJ  r7  s   ` r3   _update_main_grad_hook)amp_guard.<locals>._update_main_grad_hook  s*    ((*/ +/* "!r6   FLAGS_enable_tensor_fusion)Truetrue1rD  0T);r   localsrS   upperrp   r   r   baser   DataTyperd   lowerrl   r]   	AMP_LEVELr$   r%   r&   r#   rz   r   _get_amp_attrsr|   _get_amp_op_list_set_amp_op_list
_amp_dtype_use_promoter   _expected_placeis_gpu_placeis_xpu_placeis_custom_placer  warnr   r   r   r   r   r   r   r   r   r   r   get_device_namer   r   rY   rZ   osgetenvrX   hasattrrD  _register_grad_hookenvironr:  _add_backward_final_hook)enablers   rt   ru   rv   use_promoterT   original_stater]   	amp_levelrw   rx   	amp_attrsoriginal_amp_leveloriginal_white_listoriginal_black_listoriginal_amp_dtypeoriginal_use_promoter   xpu_versionr   r   r>  rN  r   r7  s                            @r3   	amp_guardrw    su    n "## =# I"NM KKME,,<== %))2233

KKME//I  I#, }LL		$LL		$LL		$LL	+e K }}!I!I'')	&11(	373H3H3J0k7&11(	$#,#9#9 %0"	>*M#5 !!"5K#5I ILL()=	& )
 !"M  ""//11%%2244%%5577MMjkq  lB  lB  kC  C[  \ F%%2244Y&0I0K0K"&"="=/1??A#K MM??;788VW #Fz)3M3O3O"&"="=/1??A#K MM??;788WX #F &&6688<>>j(EF %%2244Y&0I0K0K!==--CCEDMMz  |B  |I  |I  |N  |N  |^  |^  |`  {a  a|  }A  BC  }D  |E  EF  GK  LM  GN  FO  OP  Q #Fz)3M3O3O!==--CCED#)>>#6#6#8LMM \  ]c  ]j  ]j  ]o  ]o  ]  ]  ]A  \B  B]  ^b  cd  ^e  ]f  fg  hl  mn  ho  gp  pK  LX  KY  YZ  [ #F!I!I ..$&KK$P<"2 yy56 ; 
 ./@@E"5+66*.112H2OP A <?

78

334DEFJC!'!2!2 )F 8>7N7N7P4##K= "(!2!2 )F ILL('-':':$&1#	? .$6!''')< %7!	,*>F' - O +M#5 !!"5K#5I ILL()=	& )F  .$6!''')< %7!	,*>F' - sA   G _$\> (P+_C_3^ 7A_>A^_A__c                  (    \ rS rSrSS jrSS jrSrg)StateDictHooki  c                    Xl         g r,   _save_dtype)r.   
save_dtypes     r3   r`   StateDictHook.__init__  s    %r6   c                   [         R                  R                  R                  [         R                  R                  R                  5       5         U HY  nX   n[         R                  " U5      (       d  M$  [         R                  " X0R                  5      nUR                  Ul	        XAU'   M[     S S S 5        g ! , (       d  f       g = fr,   )
r   rW  r1  _dygraph_guarddygraphTracerr  r   r|  rd   )r.   r<   r   r   r   s        r3   __call__StateDictHook.__call__  s    [[""11&++2E2E2L2L2NO!"++E22$*KK7G7G$HM).M&&3sO " POOs   #B979B99
Cr{  N)r}  rh   rD   rF   )r<   r   rD   rF   )rH   rI   rJ   rK   r`   r  rL   r-   r6   r3   ry  ry    s    &4r6   ry  c                    SSK JnJn  [        XU45      (       a  U R                  OU n [        U S5      (       a  Xl        g g )Nr   r  _multi_precision)r  r  r  r   
_inner_optrh  r  )r  multi_precisionr  r  s       r3   _set_multi_precisionr  "  sO     2LM
 
 	   y,--%4" .r6   c                    g r,   r-   r   r"  ru   rv   master_weightr}  master_gradr   s           r3   amp_decorater  5       %(r6   c                    g r,   r-   r  s           r3   r  r  D       r6   c                   US;  a  [        S5      eUS;  a  [        S5      eUS:X  a  Uc  U $ X4$ [        5       nU(       d  [        S5      eUR                  R                  5       (       dF  UR                  R	                  5       (       d'  UR                  R                  5       (       d  Uc  U $ X4$ UR                  R	                  5       (       a2  US:X  a  [        5       (       a  US:X  a  [        5       (       d  Uc  U $ X4$ UR                  R                  5       (       a  [        5       (       d  US:X  a  Uc  U $ X4$ UR                  R                  5       (       a2  US:X  a  [        5       (       a  US:X  a  [        5       (       d  Uc  U $ X4$ S	n	[        U [        R                  R                  5      (       a  S	n	U /n [        U 5        O.[        U [         5      (       a  [        U 5        S
n	O[#        S5      e[%        XUS9  Ubi  S	n
['        U5      (       a  S	n
U/n[)        U5        O.[        U[         5      (       a  [)        U5        S
n
O[#        S5      eUS	LnU H  n[+        X5        M     U(       a]  S
[-        5       l        [1        [3        U 5      5       H6  n[-        5       R4                  R7                  X   R9                  5       5        M8     Ubb  US;  a  [        SU S35      e[1        [3        U 5      5       H5  nX   R;                  S
S9 H  nUR=                  [?        U5      5        M     M7     U	(       a  Ub  W
(       a  X4$ XS   4$ U $ Ub  W
(       a  U S   U4$ U S   US   4$ U S   $ )aw  
Decorate models and optimizers for auto-mixed-precision. When level is O1(amp), the decorate will do nothing.
When level is O2(pure fp16), the decorate will cast all parameters of models to FP16, except BatchNorm, InstanceNorm and LayerNorm.

Commonly, it is used together with `amp_guard` to achieve Pure fp16 in imperative mode.

Args:
    models(Layer|list of Layer, optional): The defined models by user, models must be either a single model or a list of models. Default is None.
    optimizers(Optimizer|list of Optimizer|None, optional): The defined optimizers by user, optimizers must be either a single optimizer or a list of optimizers. Default is None.
    level(str, optional): Auto mixed precision level. Accepted values are "O1" and "O2": O1 represent mixed precision, the decorator will do nothing;
         O2 represent Pure fp16/bf16, the decorator will cast all parameters of models to FP16/BF16, except BatchNorm, InstanceNorm and LayerNorm. Default is O1(amp)
    dtype(str, optional): Whether to use 'float16' or 'bfloat16'. Default is 'float16'.
    master_weight(bool|None, optional): For level='O2', whether to use multi-precision during weight updating. If master_weight is None, in O2 level optimizer will use multi-precision. Default is None.
    save_dtype(str|None, optional): The save model parameter dtype when use `paddle.save` or `paddle.jit.save`,it should be float16, bfloat16, float32, float64 or None.
         The save_dtype will not change model parameters dtype, it just change the state_dict dtype. When save_dtype is None, the save dtype is same as model dtype. Default is None.
    master_grad(bool, optional): For level='O2', whether to use float32 weight gradients for calculations such as gradient clipping, weight decay, and weight updates. If master_grad is enabled, the weight
         gradients will be float32 dtype after the back propagation. Default is False, there is only float16 weight gradients.
    excluded_layers(Layer|list of Layer, optional): Specify the layers not to be decorated. The weights of these layers will always keep float32 when level is O2. `excluded_layers` can be specified as
         an Layer instance/type or a list of Layer instances/types. Default is None, the weights of the whole model will be casted to float16 or bfloat16.

Examples:

    .. code-block:: python

        >>> # doctest: +REQUIRES(env:GPU)
        >>> # Demo1: single model and optimizer:
        >>> import paddle
        >>> paddle.device.set_device('gpu')

        >>> model = paddle.nn.Conv2D(3, 2, 3, bias_attr=False)
        >>> optimizer = paddle.optimizer.SGD(parameters=model.parameters())

        >>> model, optimizer = paddle.amp.amp_decorate(models=model, optimizers=optimizer, level='O2')

        >>> data = paddle.rand([10, 3, 32, 32])

        >>> with paddle.amp.amp_guard(enable=True, custom_white_list=None, custom_black_list=None, level='O2'):
        ...     output = model(data)
        ...     print(output.dtype)
        paddle.float16

        >>> # Demo2: multi models and optimizers:
        >>> model2 = paddle.nn.Conv2D(3, 2, 3, bias_attr=False)
        >>> optimizer2 = paddle.optimizer.Adam(parameters=model2.parameters())

        >>> models, optimizers = paddle.amp.amp_decorate(models=[model, model2], optimizers=[optimizer, optimizer2], level='O2')

        >>> data = paddle.rand([10, 3, 32, 32])

        >>> with paddle.amp.amp_guard(enable=True, custom_white_list=None, custom_black_list=None, level='O2'):
        ...     output = models[0](data)
        ...     output2 = models[1](data)
        ...     print(output.dtype)
        ...     print(output2.dtype)
        paddle.float16
        paddle.float16

        >>> # Demo3: optimizers is None:
        >>> model3 = paddle.nn.Conv2D(3, 2, 3, bias_attr=False)
        >>> optimizer3 = paddle.optimizer.Adam(parameters=model2.parameters())

        >>> model = paddle.amp.amp_decorate(models=model3, level='O2')

        >>> data = paddle.rand([10, 3, 32, 32])

        >>> with paddle.amp.amp_guard(enable=True, custom_white_list=None, custom_black_list=None, level='O2'):
        ...     output = model(data)
        ...     print(output.dtype)
        paddle.float16
)r%   r&   zYlevel should be O1 or O2, O1 represent AMP train mode, O2 represent Pure fp16 train mode.r&  z'dtype only support float16 or bfloat16.r%   r(  r   r'  FTz9models must be either a single model or a list of models.r   rv   r   zEoptimizers must be either a single optimizer or a list of optimizers.)r   r'  r_   float64zPsave_dtype can only be float16 float32 or float64, but your input save_dtype is r   r   r   ) rp   r   r`  ra  rb  rc  r   r   r   r   r   r   r   r   r   r  r   r   r  r   r#  r  rl   rY   r   r   rX   extendr1   r   register_state_dict_hookry  )r   r"  ru   rv   r  r}  r  r   r   models_is_listoptimizers_is_listuse_multi_precisionoptr   r   s                  r3   r  r  S  s   f L g
 	
 ++BCC}M%% FI
 	
 	++--!!..00!!1133M%%**,,Y'@'B'BZ(B(D(D!)) 	..00466j M%% **,,Y'@'B'BZ(B(D(D!))N&&))//**V	FD	!	!VG
 	

 &O"z**!&$JZ(
D))Z(!%W  ,58C :  -1*V%C//66v{7M7M7OP & JJbcmbnnop  V%C..D.A..}Z/HI B & !!))!},,M!!ay*,,ay*Q-//!9r6   c                    [        X!S9$ )a  
Create a context which enables auto-mixed-precision(AMP) of operators executed in dynamic graph mode.
If enabled, the input data type (float32, float16 or bfloat16) of each operator is decided
by autocast algorithm for better performance.

Commonly, it is used together with `GradScaler` and `decorator` to achieve Auto-Mixed-Precision in
imperative mode.

Args:
    device_type(str, optional): Device type.But because the paddle does not distinguish between devices, this parameter does not work
    enable(bool, optional): Enable auto-mixed-precision or not. Default is True.
    dtype(str, optional): Whether to use 'float16' or 'bfloat16'. Default is 'float16'.
    cache_enabled(bool, optional): whether to enable cache or not. Default is True. But this parameter is not used

Note:
    paddle.cuda.amp.

Examples:

    .. code-block:: python

        >>> # doctest: +REQUIRES(env:GPU)
        >>> import paddle

        >>> conv2d = paddle.nn.Conv2D(3, 2, 3, bias_attr=False)
        >>> data = paddle.rand([10, 3, 32, 32])

        >>> with paddle.amp.auto_cast():
        ...     conv = conv2d(data)
        ...     print(conv.dtype)
        >>> # doctest: +SKIP("This has diff in xdoctest env")
        paddle.float16
        >>> # doctest: -SKIP

        >>> with paddle.amp.auto_cast(enable=False):
        ...     conv = conv2d(data)
        ...     print(conv.dtype)
        >>> # doctest: +SKIP("This has diff in xdoctest env")
        paddle.float32
        >>> # doctest: -SKIP

)rl  rv   )	auto_cast)device_typerv   enabledcache_enableds       r3   autocastr  &  s    ` G11r6   c                    [        XX#XE5      $ )a  
Create a context which enables auto-mixed-precision(AMP) of operators executed in dynamic graph mode.
If enabled, the input data type (float32, float16 or bfloat16) of each operator is decided
by autocast algorithm for better performance.

Commonly, it is used together with `GradScaler` and `decorator` to achieve Auto-Mixed-Precision in
imperative mode.

Args:
    enable(bool, optional): Enable auto-mixed-precision or not. Default is True.
    custom_white_list(set|list|tuple|None, optional): A default white list is already set. Usually there is no need to set custom white list.
         The set of ops should be considered numerically-safe and performance-critical. These ops will be converted to float16/bfloat16.
    custom_black_list(set|list|tuple|None, optional): A default black list is already set. You can set a custom black list according to the model.
         The set of ops are considered numerically-dangerous and whose effects may also be observed in downstream ops. These ops will not be
         converted to float16/bfloat16.
    level(str, optional): Auto mixed precision level. Accepted values are "O1", "O2" and "OD": At the O1 level, operators in the white list
         will use float16/bfloat16 inputs for calculations, and operators in the black list will use float32 inputs for calculations. At the O2
         level, model's parameters will be casted to float16/bfloat16 by using `decorator`, and operators that have all float16/bfloat16 inputs
         will be converted to float16/bfloat16, and that have any float32 input will be converted to float32. For the OD level, operators in
         default white list will compute in float16/bfloat16, and the others will compute in float32. Default is O1.
    dtype(str, optional): Whether to use 'float16' or 'bfloat16'. Default is 'float16'.
    use_promote(bool, optional): Whether to promotes to fp32 when op has any float32 inputs. It is only supported when amp level is O2. Default is True.

Examples:

    .. code-block:: python

        >>> # doctest: +REQUIRES(env:GPU)
        >>> import paddle

        >>> conv2d = paddle.nn.Conv2D(3, 2, 3, bias_attr=False)
        >>> data = paddle.rand([10, 3, 32, 32])

        >>> with paddle.amp.auto_cast():
        ...     conv = conv2d(data)
        ...     print(conv.dtype)
        >>> # doctest: +SKIP("This has diff in xdoctest env")
        paddle.float16
        >>> # doctest: -SKIP

        >>> with paddle.amp.auto_cast(enable=False):
        ...     conv = conv2d(data)
        ...     print(conv.dtype)
        >>> # doctest: +SKIP("This has diff in xdoctest env")
        paddle.float32
        >>> # doctest: -SKIP

        >>> with paddle.amp.auto_cast(custom_black_list={'conv2d'}):
        ...     conv = conv2d(data)
        ...     print(conv.dtype)
        >>> # doctest: +SKIP("This has diff in xdoctest env")
        paddle.float32
        >>> # doctest: -SKIP

        >>> a = paddle.rand([2, 3])
        >>> b = paddle.rand([2, 3])
        >>> with paddle.amp.auto_cast(custom_white_list={'elementwise_add'}):
        ...     c = a + b
        ...     print(c.dtype)
        >>> # doctest: +SKIP("This has diff in xdoctest env")
        paddle.float16
        >>> # doctest: -SKIP

        >>> with paddle.amp.auto_cast(custom_white_list={'elementwise_add'}, level='O2'):
        ...     d = a + b
        ...     print(d.dtype)
        >>> # doctest: +SKIP("This has diff in xdoctest env")
        paddle.float16
        >>> # doctest: -SKIP

)rw  )rl  rs   rt   ru   rv   rm  s         r3   r  r  Y  s    ^ #4U r6   c                    g r,   r-   r  s           r3   decorater    r  r6   c                    g r,   r-   r  s           r3   r  r    r  r6   c                   [         R                  R                  5       (       a  [        U [        [
        45      (       a   e[        U[        [
        45      (       a   eU[        5       l        US;   a  Uc  U $ [        USUUSSSSSSSUSS9nX4$ US:X  a7  [        U /X7S9  USLn[        X5        Uc  U $ [        USUUSSSSSSSUSS9nX4$ [        S5      e[        U UUUUUUU5      $ )	a  
Decorate models and optimizers for auto-mixed-precision. When level is O1(amp), the decorate will do nothing.
When level is O2(pure float16/bfloat16), the decorate will cast all parameters of models to float16/bfloat16, except BatchNorm, InstanceNorm and LayerNorm.

Commonly, it is used together with `auto_cast` to achieve Pure float16/bfloat16 in imperative mode.

Args:
    models(Layer|list of Layer): The defined models by user, models must be either a single model or a list of models. Default is None.
    optimizers(Optimizer|list of Optimizer|None, optional): The defined optimizers by user, optimizers must be either a single optimizer or a list of optimizers. Default is None.
    level(str, optional): Auto mixed precision level. Accepted values are 'O1' and 'O2': O1 represent mixed precision, the decorator will do nothing;
         O2 represent Pure float16/bfloat16, the decorator will cast all parameters of models to float16/bfloat16, except BatchNorm, InstanceNorm and LayerNorm. Default is O1(amp)
    dtype(str, optional): Whether to use 'float16' or 'bfloat16'. Default is 'float16'.
    master_weight(bool, optional): For level='O2', whether to use multi-precision during weight updating. If master_weight is None, in O2 level optimizer will use multi-precision. Default is None.
    save_dtype(str|None, optional): The save model parameter dtype when use `paddle.save` or `paddle.jit.save`,it should be float16, bfloat16, float32, float64 or None.
         The save_dtype will not change model parameters dtype, it just change the state_dict dtype. When save_dtype is None, the save dtype is same as model dtype. Default is None.
    master_grad(bool, optional): For level='O2', whether to use float32 weight gradients for calculations such as gradient clipping, weight decay, and weight updates. If master_grad is enabled, the weight
         gradients will be float32 dtype after the back propagation. Default is False, there is only float16 weight gradients.
    excluded_layers(Layer|list of Layer, optional): Specify the layers not to be decorated. The weights of these layers will always keep float32 when level is O2. `excluded_layers` can be specified as
         an Layer instance/type or a list of Layer instances/types. Default is None, the weights of the whole model will be casted to float16 or bfloat16.

Examples:

    .. code-block:: python

        >>> # doctest: +REQUIRES(env:GPU)
        >>> # Demo1: single model and optimizer:
        >>> import paddle
        >>> paddle.device.set_device('gpu')

        >>> model = paddle.nn.Conv2D(3, 2, 3, bias_attr=False)
        >>> optimizer = paddle.optimizer.SGD(parameters=model.parameters())

        >>> model, optimizer = paddle.amp.decorate(models=model, optimizers=optimizer, level='O2')

        >>> data = paddle.rand([10, 3, 32, 32])

        >>> with paddle.amp.auto_cast(enable=True, custom_white_list=None, custom_black_list=None, level='O2'):
        ...     output = model(data)
        ...     print(output.dtype)
        paddle.float16

        >>> # Demo2: multi models and optimizers:
        >>> model2 = paddle.nn.Conv2D(3, 2, 3, bias_attr=False)
        >>> optimizer2 = paddle.optimizer.Adam(parameters=model2.parameters())

        >>> models, optimizers = paddle.amp.decorate(models=[model, model2], optimizers=[optimizer, optimizer2], level='O2')

        >>> data = paddle.rand([10, 3, 32, 32])

        >>> with paddle.amp.auto_cast(enable=True, custom_white_list=None, custom_black_list=None, level='O2'):
        ...     output = models[0](data)
        ...     output2 = models[1](data)
        ...     print(output.dtype)
        ...     print(output2.dtype)
        paddle.float16
        paddle.float16

        >>> # Demo3: optimizers is None:
        >>> model3 = paddle.nn.Conv2D(3, 2, 3, bias_attr=False)
        >>> optimizer3 = paddle.optimizer.Adam(parameters=model3.parameters())

        >>> model = paddle.amp.decorate(models=model3, level='O2')

        >>> data = paddle.rand([10, 3, 32, 32])

        >>> with paddle.amp.auto_cast(enable=True, custom_white_list=None, custom_black_list=None, level='O2'):
        ...     output = model(data)
        ...     print(output.dtype)
        paddle.float16

)r#   r$   r%   Ng      ?F)r  	amp_listsru   rv   init_loss_scalingincr_every_n_stepsdecr_every_n_nan_or_inf
incr_ratio
decr_ratiouse_dynamic_loss_scalinguse_amp_guardrY   rm  r&   r  r%  )r   r1  r   r   r   r   rl   rY   r   r  r  rp   r  )	r   r"  ru   rv   r  r}  r  r   r  s	            r3   r  r    sG   h ##%%ftUm4444j4-8888-8*&&!8("&)'+,0##-2"&$/ $
 ))d]xu #0u"< A!8("&)'+,0##-2"&$/ $
 ))@AA	
 		
r6   c                    [        5       (       a2  [        R                  " 5       nUR                  [        R
                  :g  $ [        5       nU(       a'  UR                  [        R                  R
                  :g  $ g)a  
Check whether auto-mixed-precision is enabled in the current context.

Args:
    device_type (PlaceLike, optional): The device type to check. This argument is ignored for all devices sharing the same AMP state in paddlepaddle.

Returns:
    bool: True if auto-mixed-precision is enabled, False otherwise.

Examples:
    .. code-block:: python

        >>> # doctest: +REQUIRES(env:GPU)
        >>> # Demo1: Check if auto-mixed-precision is enabled by default
        >>> import paddle
        >>> paddle.device.set_device('gpu')
        >>> print(paddle.is_autocast_enabled())
        False

        >>> # Demo2: Enable auto-mixed-precision and check again
        >>> with paddle.amp.auto_cast():
        ...     print(paddle.is_autocast_enabled())
        True
F)r   r   r[  r|   rZ  r#   r   r}   r  rp  r   s      r3   is_autocast_enabledr  _  sW    2 }}'')	##y||33 "$$(8(888r6   c                    [        5       (       d  g[        5       (       a!  [        R                  " 5       nUR                  $ [        5       nUR                  $ )a  
Get the auto-mixed-precision dtype in the current context if autocast is enabled else default AMP dtype(float16).

Args:
    device_type (PlaceLike, optional): The device type to check. This argument is ignored for all devices sharing the same AMP state in paddlepaddle.

Returns:
    _DTypeLiteral: The current AMP dtype.

Examples:
    .. code-block:: python

        >>> # doctest: +REQUIRES(env:GPU)
        >>> # Demo1: Get default auto-mixed-precision dtype
        >>> import paddle
        >>> paddle.device.set_device('gpu')
        >>> print(paddle.get_autocast_dtype())
        float16

        >>> # Demo2: Enable auto-mixed-precision and get the dtype
        >>> with paddle.amp.auto_cast():
        ...     print(paddle.get_autocast_dtype())
        float16
r   )r  r   r   r[  r^  r   r  s      r3   get_autocast_dtyper    sE    2   }}'')	### "   r6   )rD   rV   )r%   r   )
rs   r'   rt   r'   ru   _AmpLevelLiteralrv   r   rD   ztuple[set[str], set[str]])rD   rG   )r   r   rv   rh   rD   rG   )r   list[Layer]r   /Layer | list[Layer | type[Layer]] | type[Layer]rD   rF   )T)
r.   r   r   z0Callable[[Tensor, _DTypeLiteral], Tensor | None]rv   r   r   rG   rD   rF   )r   r   rv   rh   rD   rF   )
r.   r   rv   r   r   rG   r  rG   rD   r   )r   r  rv   r   r   r  rD   r  )r   r  rD   rF   )r  r   rD   zTypeGuard[_OptimizerLike])r"  z	list[Any]rD   rF   )TNNr%   r   T)rl  rG   rs   _CustomList | Nonert   r  ru   r  rv   r   rm  rG   rD   zGenerator[None, None, None])r  r)   r  rG   rD   rF   ).......)r   rM   r"  rN   ru   r  rv   r   r  bool | Noner}  _DTypeLiteral | Noner  rG   r   6Layer | list[Layer | type[Layer]] | type[Layer] | NonerD   ztuple[_ModelsT, _OptimizersT])r   rM   r"  rF   ru   r  rv   r   r  r  r}  r  r  rG   r   r  rD   rM   )Nr%   r   NNFN)r   rM   r"  z_OptimizersT | Noneru   r  rv   r   r  r  r}  r  r  rG   r   r  rD   z(tuple[_ModelsT, _OptimizersT] | _ModelsT)r   TT)
r  z
str | Nonerv   r   r  rG   r  rG   rD   r   )rl  rG   rs   r  rt   r  ru   r  rv   r   rm  rG   rD   r   )......r,   )r  PlaceLike | NonerD   rG   )r  r  rD   r   )^
__future__r   ro   rf  r  typingr   r   r   r   r   r	   r
   r   r   paddle.baser   paddle.base.frameworkr   r   r   r   r   paddle.base.wrapped_decoratorr   paddle.static.amp.decoratorr   r  r   r   collections.abcr   
contextlibr   typing_extensionsr   r   r   paddle._typingr   paddle._typing.dtype_liker   	paddle.nnr   paddle.nn.layer.layersr   paddle.staticr    r!   r  r   rh   r   rn   r'   ri   r)   rM   rN   AMP_RELATED_FLAGSAMP_RELATED_FLAGS_SETTINGr}   rZ  rS   rT   rV   rk   rl   rz   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r   r#  rw  ry  r  r  r  r  r  r  r  r-   r6   r3   <module>r     s   #  	 	 	 	    H C -)16(71/56"49eCHos3x#GHKH= =  :wW6~'7>N9OP  &''+01  MM	
" "( #$  #$	$"$"$ $ 	$
 $@<
:
Q	

!H#5#5D#5 
#5T #	

:  	
 
*!#H
  	
 & E 	D	  ,0,0"$D?D?)D? *D? 	D?
 D? D? !D? D?N
4 455045	5& 
  #!!$'* 	((( ( 	(
 ( %( ( 	?( #( 
( 
 !!$'* 	  	
  %  	?  
  '+"$!%'+ 	OO#O O 	O
 O %O O 	?O .O Oh %	020202 02 	02
 02h ,0,0"$QQ)Q *Q 	Q
 Q Q Qh 
 "!$'* 	((( ( 	(
 ( %( ( 	?( #( 
( 
 !!$'* 	  	
  %  	?  
  '+"$!%'+ 	Q
Q
#Q
 Q
 	Q

 Q
 %Q
 Q
 	?Q
 .Q
h F !r6   