
    ͑iR              	       	   S SK r S SKrS SKrS SKrS SKrSrSrSr\ R                  S:X  a  Sr\ R                  R                  \ R                  R                  \5      5      r\ R                  R                  \\ R                  -   \-   S-   \-   5      (       a  Sr \ R                  S:X  ax  \\ R                  -   S	-   \ R                  -   S
-   r\S-   \-   S-   \ R"                  S   -   \ R"                  S'   \R                  R%                  S \5        \ R&                  " \5        S rS rS rS rS rS rS r \RB                  " 5       RE                  5       S:X  a'  \" 5       u  r#r$\#S:X  a  \ " \$S5      (       a	   \" S5         SSK'J(r(  \" 5       (       a1  \(RR                  " 5       (       d  \RJ                  RM                  S5        \(RT                  \(l+        \(RT                  \(l,        \(RZ                  R\                  R^                  \(RZ                  R\                  l0        \(RZ                  R\                  Rb                  \(RZ                  R\                  l2        SS K(7  SS!K(J3r3JrJ4r4J5r5J6r6J7r7J8r8J9r9J:r:J;r;J<r<J=r=J>r>J?r?J@r@JArAJBrBJCrCJDrDJErEJFrFJGrGJHrHJIrIJJrJJKrKJLrLJMrMJNrNJOrOJPrPJQrQJRrRJSrSJTrTJUrUJVrVJWrWJXrXJYrYJZrZJ[r[J\r\  SS"K(J]r]J^r^J_r_J`r`Jara  SS#K(JbrbJcrcJdrdJereJfrfJgrgJhrhJiriJjrjJkrkJlrlJmrm  \R                  S$:w  a  SS%K(JnrnJoroJprpJqrqJrrrJsrsJtrtJuruJvrv  S* rwS+ rx\x" 5         S, ryS- rz\{" 5       \{" 5       \{" 5       S..r|S/ r}\}S0/S0/S0/S1.r~S/S/S2/S3.rS4 rS5 rS6 rS7 rS8 rS9 rSFS:\S;\4S< jjrSFS:\S;\4S= jjrSFS:\S;\4S> jjrSFS:\S;\4S? jjrSFS@ jr\" SSA9  SB/rSC rSD r\" 5         SE r\" 5         g! \ au  r\ R                  S:X  aO  \ R                  R                  \ R                  R                  \R,                  5      5      r\" S\ S\ S\ 35      e\" S\" \5      -   5      eSrCf\ a  r\eSrCff = f! \ a&  r\RJ                  RM                  S5         SrCGNSrCff = f! \ a  r\(       a4  \RJ                  RM                  S&\-   \ R                  -   S'-   \-   S(-   5        \" 5       (       d1  \(RR                  " 5       (       a  \RJ                  RM                  S)5        \eSrCff = f)G    NF	libpaddlesontpyd.T..libs;pathz$NOTE: You may need to run "set PATH=z;%PATH%"
        if you encounters "DLL load failed" errors. If you have python
        installed in other directory, replace "z<" with your own
        directory. The original error is: 
 a  NOTE: You may need to run "export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH"
        if you encounters "libmkldnn.so not found" errors. If you have python
        installed in other directory, replace "/usr/local/lib" with your own
        directory. The original error is: 
c                    ^^ [         R                  " 5       R                  5       n SnU S:X  a<   [        R                  " S5      nUR                  5       S:g  nUR                  5         U$ U S:X  a   [        R                  " S	5      nUR                  5       S:g  nUR                  5         U(       dN  SSKnUR                  SSUR                  UR                  S9nUR                  5       nUR                  S:X  a  SOSnU$ U S:X  a  SSKmTR#                  S5      mTR$                  S4UU4S jjnSnSnSn	 U" U5      u  pU
" 5       n	TR&                  R(                  R+                  TR-                  U5      TR#                  S5      T5        U	SU-  -  S:  $ [        R                  R                  SU  S35        g! [         a.  n[        R                  R                  SU S35         SnAU$ SnAff = f! [         a.  n[        R                  R                  S
U S35         SnAGNSnAff = f! [         a-  n[        R                  R                  SU S35         SnANSnAff = f)zF
Whether current system(Linux, MacOS, Windows) is supported with AVX.
Flinuxzcat /proc/cpuinfo | grep -i avx zDCan not get the AVX flag from /proc/cpuinfo.
The original error is: 
Ndarwinz)sysctl machdep.cpu.features | grep -i avxzKCan not get the AVX flag from machdep.cpu.features.
The original error is: r   z/sysctl machdep.cpu.leaf7_features | grep -i avxT)shellstdoutstderrwindows    c           
        > TR                   R                  R                  nTR                  Ul        TR                  S5      nTR                  S5      nU" S TXE5      nU(       d  [        S5      eTR                  TR                  TR                  TR                  TR                  5      " TR                  5      nU" X`[        U 5      5      S:  a  [        S5      eTR                  S5      nTR                   R                  R                  n	U	" TR                  U5      TUTR                  TR                  S5      5      5      n
U
(       d  [        S5      eTR                   R                  R                  nTR                  Ul        TR                  U" 5       5      nTR                   R                  R                  UTR                  U5      T5      n
U
(       d  [        S5      eTR                  " U/UQ76 nU" U5      nX4$ )	Nr      zFailed to VirtualAllocr   zFailed to memmove   zFailed VirtualProtectzFailed FlushInstructionCache)windllkernel32VirtualAllocc_void_prestypec_ulong	Exception	CFUNCTYPEc_size_t_memmove_addrlenVirtualProtectbyrefGetCurrentProcessFlushInstructionCache)code_strr   argtypespfnVirtualAlloc
MEM_COMMITPAGE_READWRITEaddressmemmovePAGE_EXECUTEpfnVirtualProtectrespfnGetCurrentProcess
prochandlefunctypefuncONE_PAGEctypess                  P/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/paddle/base/core.pyasm_funcavx_supported.<locals>.asm_funco   s    %mm44AAO&,ooO#/J#^^C0N%h
G  899 &&	
 ""$G w#h-81< 344 ">>$/L & 6 6 E E#(V^^A./	C  788 $*==#9#9#K#K +1?? ()=)?@J--((>>FOOG4hC  >?? '';(;HG$D=     s
         z?Failed getting the AVX flag on Windows.
The original error is:    zDo not get AVX flag on )platformsystemlowerospopenreadcloser    sysr   write
subprocessPopenPIPEcommunicate
returncoder8   r"   c_uint32r   r   VirtualFreer   )sysstrhas_avxpipeerH   _r:   r)   avx_bitretvalr6   r.   r7   r8   s               @@r9   avx_supportedrV   C   sY    __$$&FG	88=>DiikR'GJJL 	8		88GHDiikR'GJJL ##A!!	 $ D   "A"oo2dG	9	??6*'- 0	! 0	!h ?	$X.MDVFMM""..(&//!*<h !w,'1,,

26("=>O  	JJ**+B0  	  	JJ**+B0 	h  	JJ**+B0 	sH   9F= 19G8 8AH3 =
G5#G00G58
H0#H++H03
I*=#I%%I*c                     SS K nUR                  XR                  UR                  SS9R                  5       u  p#U(       a  g UR	                  S5      R                  5       $ )Nr   T)r   r   r   zutf-8)rH   rI   rJ   rK   decodestrip)cmdrH   outerrs       r9   run_shell_commandr]      sU    OOJOO4   km C zz'"((**r<   c                 D    U (       a  U(       a  [        SU  SU S35      $ g )Nzldd z|grep z|awk '{print $3}'r]   )core_sodso_names     r9   get_dso_pathrb      s,    8 7)6(+>?
 	
 r<   c                     U (       a   SSK Jn  UR                  U 5        g g !   [        R                  " SU  S35         g = f)Nr   )cdllzLoad z failed)r8   rd   LoadLibrarywarningswarn)dso_absolute_pathrd   s     r9   load_dsori      s?    	>#./	 
	>MME"3!4G<=s	   " A c                     [         (       a)  [        [        R                  -   [        -   S-   [
        -   nOS n[        X5      n[        U5        g )Nr   )has_paddle_dy_libcurrent_pathrB   sepdy_lib_namedy_lib_suffixrb   ri   )ra   r`   dso_paths      r9   pre_loadrq      s<    '+5;mKG.HXr<   c                  L    [        S5      n U b  SU 4$ [        S5      nUb  SU4$ g)Nz&ldd --version | awk '/ldd/{print $NF}'glibcz%ldd 2>&1 | awk '/Version/{print $NF}'musl)NNr_   )	ldd_glibcldd_musls     r9   get_libc_verrw      s=    !"JKI## !HIH!!r<   c                 j   ^ U b  Uc  gSS K nSS KmU4S jnUR                  U" U 5      U" U5      5      $ )NFr   c                    > TR                  SSU 5      n U R                  S5       Vs/ s H  n[        U5      PM     sn$ s  snf )Nz(\.0+)+$r   r   )subsplitint)sxres     r9   to_listless_than_ver.<locals>.to_list   s9    FF;A& !-1A---s   A )operatorr   lt)abr   r   r   s       @r9   less_than_verr      s5    yAI. ;;wqz71:..r<   r   rs   z2.23libgompz!Error: Can not preload libgomp.sor>   )r   a$  Hint: Your machine support AVX, but the installed paddlepaddle doesn't have avx core. Hence, no-avx core with worse performance will be imported.
If you like, you could reinstall paddlepaddle by 'python -m pip install --force-reinstall paddlepaddle-gpu[==version]' to get better performance.
)*)+__doc____file____name____package____unittest_throw_exception__,_append_python_callable_object_and_return_id_cleanup_create_loaded_parameter_cuda_synchronize_device_synchronize_dygraph_debug_level_get_all_register_op_kernels_get_amp_attrs_get_amp_op_list_get_current_stream_get_eager_deletion_vars_get_legacy_default_stream_get_phi_kernel_name_get_registered_phi_kernels_get_stream_from_external'_get_use_default_grad_op_desc_maker_ops	_has_grad_is_compiled_with_heterps_is_dygraph_debug_enabled_is_program_version_supported	_Profiler_ProfilerResult _promote_types_if_complex_exists_RecordEvent_Scope_set_amp_op_list_set_current_stream_set_eager_deletion_mode_set_fuse_parameter_group_size_set_fuse_parameter_memory_size_set_has_grad_set_paddle_lib_path_set_warmup_switch_tracer_test_enforce_gpu_success_xpu_device_synchronize_xpu_get_current_stream_xpu_set_current_stream)CustomDeviceEventCustomDeviceStream!_get_current_custom_device_stream!_set_current_custom_device_stream_synchronize_custom_device)__set_all_prim_enabled__set_bwd_prim_enabled__set_eager_prim_enabled__set_fwd_prim_enabled_add_skip_comp_ops_is_bwd_prim_enabled_is_eager_prim_enabled_is_fwd_prim_enabled_is_all_prim_enabled_remove_skip_comp_ops_set_bwd_prim_blacklist_set_prim_target_grad_namewin32)	_array_to_share_memory_tensor_cleanup_mmap_fds_convert_to_tensor_list_erase_process_pids_remove_tensor_list_mmap_fds(_set_max_memory_map_allocation_pool_size_set_process_pids_set_process_signal_handler_throw_error_if_process_failedz:Error: Can not import paddle core while this file exists: z
libpaddle.r   zError: Your machine doesn't support AVX, but the installed PaddlePaddle is avx core, you should reinstall paddlepaddle with no-avx core.
c                    [         R                  R                  SS 5      b  g [         R                  R	                  U 5      (       a1  [         R                  R                  U 5      [         R                  S'   g S[         R                  S'   g )NCUSTOM_DEVICE_ROOTr   )rB   environgetr   existsnormpath)lib_paths    r9   !set_paddle_custom_device_lib_pathr     s[    	zz~~*D1=	ww~~h+-77+;+;H+E

'(+-

'(r<   c            	         [         R                  " 5       n U  H  n[        R                  R                  R                  USS/5      n[        R                  R                  U5      (       d  MU  [        U5        [        [        R                  R                  R                  USSS/5      5          g    [        [         S5      (       a  [         R                  (       a  [        R                  R                  R                  [         R                  SS/5      n[        R                  R                  U5      (       aB  [        U5        [        [        R                  R                  R                  USSS/5      5        g g g g )Npaddler	   r   paddle_custom_device	USER_SITE)sitegetsitepackagesrB   r   rm   joinr   r   r   hasattrr   )	site_dirssite_dirlib_dirs      r9   set_paddle_lib_pathr     s	   $$&I''++""Hh#?@77>>'"" )-  '47M!NO   t[!!dnn''++""DNNHf#EF77>>'"" )-  '47M!NO # '5!r<   c                  h    [         R                  " S5      n U (       a  U R                  5       S;   a  gg)NFLAGS_model_return_data1trueTFrB   getenvrA   flags    r9   _model_return_datar     s'    99./D

-r<   c                  h    [         R                  " S5      n U (       a  U R                  5       S;   a  gg)NFLAGS_prim_logr   TFr   r   s    r9   _prim_return_logr     s'    99%&D

-r<   )forward_blacklistcomposite_ops_recordbackward_blacklistc                     U R                  S5      =(       a    U R                  S5      (       + =(       d    U R                  S5      nU(       a  / SQ$ S/$ )zXSome outputs of batch_norm's replaced composite rule are not needed and will be removed.is_testtrainable_statisticsuse_global_stats)ReserveSpace	SavedMeanSavedVariancer   )attr)opuse_run_stats     r9   _get_batch_norm_none_varr     sM     		DBGG,B$C C%	#	$  ==r<   XShape)
batch_normflatten_contiguous_rangesqueeze2
unsqueeze2   )zpd_op.squeezezpd_op.unsqueezezpd_op.batch_normc                  $    SSK Jn   U " S5      S   $ )Nr   	get_flagsFLAGS_prim_skip_dynamicpaddle.base.frameworkr  r  s    r9   _enable_prim_skip_dynamic_shaper
    s    /./0IJJr<   c                  $    SSK Jn   U " S5      S   $ )Nr   r  FLAGS_prim_enable_dynamicr  r  s    r9   _enable_prim_dynamic_shaper    s    /012MNNr<   c                  h    [         R                  " S5      n U (       a  U R                  5       S;   a  gg)NFLAGS_dist_prim_allr   TFr   r   s    r9   _enable_dist_prim_allr    s'    99*+D

-r<   c                      [         R                  " S5      n SSKJn  U" 5       (       a  U (       a  U R	                  5       S;   a  ggU (       a  U R	                  5       S;   a  gg)NFLAGS_enable_auto_recomputer   )in_cinn_mode)0falseFTr   )rB   r   r	  r  rA   )r   r  s     r9   _enable_auto_recomputer    sI    9923D 3~~DJJLN2

-r<   c                      U  H;  n[        U[        5      (       d  [        S5      e[        S   R	                  U5        M=     g )Nz/ops set in forward_blacklist must belong to strr   )
isinstancestr	TypeErrorprim_configadd)argsitems     r9   _set_prim_forward_blacklistr    s9    $$$MNN+,006	 r<   c                  
   [        U 5      n[        5       nU H]  n[        U[        5      (       d  [        S5      eUR	                  S5      n[
        S   R                  U5        UR                  U5        M_     [        U5        g )Nz!All items in set must be strings.zpd_op.r   )setr  r  r  removeprefixr  r  r   )r  opsnew_opsr  s       r9   _set_prim_backward_blacklistr%    so    
d)CeG$$$?@@  *()--d3D  G$r<   value
print_flagc                     [        U [        5      (       d   S[        U 5       35       e[        U 5        [	        5       (       d  U(       a  [        S[        [        5       5      5        g g )Nvalue should be bool, but got zbackward prim enabled: )r  booltyper   r   printr   r&  r'  s     r9   _set_prim_backward_enabledr.  (  sX    eT"" 
(e6" 5!Z'.B.D)EF (r<   c                     [        U [        5      (       d   S[        U 5       35       e[        U 5        [	        5       (       d  U(       a  [        S[        [        5       5      5        g g )Nr)  zforward prim enabled: )r  r*  r+  r   r   r,  r   r-  s     r9   _set_prim_forward_enabledr0  1  sX    eT"" 
(e6" 5!Z&-A-C(DE (r<   c                     [        U [        5      (       d   S[        U 5       35       e[        U 5        [	        5       (       d  U(       a  [        S[        [        5       5      5        g g )Nr)  zeager prim enabled: )r  r*  r+  r   r   r,  r   r-  s     r9   set_prim_eager_enabledr2  :  sX    eT"" 
(e6" U#Z$d+A+C&DE (r<   c                     [        U [        5      (       d   S[        U 5       35       e[        U 5        [	        5       (       d  U(       a  [        S[        [        5       5      5        g g )Nr)  zall prim enabled: )r  r*  r+  r   r   r,  r   r-  s     r9   _set_prim_all_enabledr4  C  s[    eT"" 
(e6" 5!Z %'(	
 (r<   c                    SSK Jn  [        R                  " S5      n[        R                  " S5      n[        R                  " S5      nUb  U" U5      n[	        XP5        Ub  U" U5      n[        X`5        Ub  U" U5      n[        Xp5        g g )Nr   )	strtoboolFLAGS_prim_allFLAGS_prim_forwardFLAGS_prim_backward)paddle.utils.environmentsr6  rB   r   r4  r0  r.  )r'  r6  prim_all_envprim_fwd_envprim_bwd_envprim_all_flagprim_fwd_flagprim_bwd_flags           r9    __check_and_set_prim_all_enabledrA  O  s    399-.L9912L9923L!,/m8!,/!-<!,/"==  r<   )r'  matmul_gradc                  4    [          H  n [        U 5        M     g )N)SKIPPED_PRIM_VJP_DEFAULT_OPSr   )r  s    r9    _clear_prim_vjp_skip_default_opsrE  h  s    ,d# -r<   c                      [         R                  " SS5      n U (       a!  U R                  5       S;   a  [        [        6   g[        5         g)NFLAGS_prim_vjp_skip_default_opsr   r   TF)rB   r   rA   r%  rD  rE  r   s    r9   (_check_and_set_prim_vjp_skip_default_opsrH  o  s8    996<D

-$&BC(*r<   c                      [         R                  " SS5      n U (       aB  / nU R                  S5       H"  nUR                  UR	                  5       5        M$     [        U6   g g )NFLAGS_prim_backward_blacklistr   r
   )rB   r   r{   appendrY   r%  )ops_orgr#  r  s      r9   _check_prim_vjp_opsrM  |  sM    ii7<GMM#&DJJtzz|$ '$c*	 r<   )F)rB   r?   r   rF   rf   rk   rn   ro   namer   abspathdirnamer   rl   r   rm   third_lib_pathr   insertadd_dll_directoryImportErrorrR   
executableexecutable_pathr  r    rV   r]   rb   ri   rq   rw   r   r@   rA   	libc_typelibc_verr   rG   r   r   is_compiled_with_avxDenseTensor	LoDTensorTensorVarDescVarTypeDENSE_TENSOR
LOD_TENSORDENSE_TENSOR_ARRAYLOD_TENSOR_ARRAYr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r!  r  r   ops_contain_none decomp_ops_contain_unused_outputr
  r  r  r  r  r%  r*  r.  r0  r2  r4  rA  rD  rE  rH  rM  r   r<   r9   <module>re     s   
   
  77d?Mwwrwwx8977>>,'+5;mKLL	ww$%.5>G 3/#5

68JJ 	

6 	>* 	^,.rj	+>/, ??'&.IxGh ? ?	BY
~y==??

+	
 $//I ,,I!!.. ( 	!!44 . , , , , , , , , , , , ,b    $ ||w
	
 
	
 
	
<.&   E%  +!)

*	  Ss$  KO"7	%Gd G GFT Ft FF$ FD F	
 	
4 	
>& !D 1 !. $ ) *+  o  
	ww$''//"''//#..*IJ5o5F G11@0A B../S4
 	
 0 !f	
 	
  
GN  	BJJ@AA	Bf  

Hff  	
 	
 ??y==??

D	
 GsX   BN* 9P3 FQ" *P00A0P  	P0)P++P03Q9QQ"S'(A:S""S'