
    {Yhj              	       v	   U d 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mZ ddlmZ ddlmZmZmZ dZee         ed<   ej                            dd	          d
k    ZdZdZdZdZdZdZ dZ! ed          Z"e#ed<    ed          Z$e#ed<    ed          Z%e&ed<    ed          Z'e&ed<   dZ(dZ)dZ*ej                            dd
          d
k    Z+dZ,dZ-dZ.ed         ed<   dZ/dZ0dZ1dZ2dZ3ej                            dd	          d
k    Z4 e5            Z6e5e7e	                  ed<    e5            Z8e5e7e	                  ed<    e&ej                            d d                    Z9ej                            d!d	          d
k    Z:dZ;ej                            d"d	          d
k    Z<ej                            d#d          Z=i Z>e?e	e	f         ed$<   h d%Z@ej                            d&d          ZA e#ej                            d'd(                    ZBej                            d)          d
k    ZCd*ZDej                            d+          d
k    ZEdZFej                            d,          d
k    ZGej                            d-d	          d
k    ZHdZIdZJdZKdZLdZMee&ed.         f         ed/<   ej                            d0d	          d
k    ZNe&ed1<   dZOdZPdZQdZRdZSdZTdZUdZVdZWdZXdZYdZZdZ[ e            rdndZ\dZ]dZ^ e e e ee_                                        Z`dZad2Zbd3Zcd4ZddZedZfdZgdZhdZidZj edd56          ZkdZldZmdZndZodZpdZqdZrdZsd7 Zt et            Zuh d8ZvdZwdZxdZydZzdZ{dZ| e5            Z}e5e
e	gdf                  ed9<    e5            Z~e5e
d:e	f                  ed;<   dZg d<Zg d=Zej                            d>d
          d
k    Zej                            d?d	          d
k    ZdZdZi Ze?ee	f         ed@<   ej                            dAd	          d
k    Z edBdCdD          Ze&edE<    edF          Zee&         edG<   ej                            dHd	          d
k    Z eddIdJK          ZdZdZdZee	         edL<   erddMlT dN Z eej        e                    dS )Oaq  
Configuration module for TorchDynamo compiler and optimization settings.

This module contains various configuration flags and settings that control TorchDynamo's
behavior, including:
- Runtime behavior flags (e.g., guard settings, specialization options)
- Debugging and development options
- Performance tuning parameters
- Feature toggles for experimental features
    N)abspathdirname)AnyCallableLiteralOptionalTYPE_CHECKINGUnion)	is_fbcode)Configget_tristate_envinstall_config_modulelog_file_nameTORCHDYNAMO_VERBOSE01F   T      z$torch._dynamo.config.recompile_limit)aliascache_size_limitz0torch._dynamo.config.accumulated_recompile_limitaccumulated_cache_size_limitz?torch._dynamo.config.skip_code_recursive_on_recompile_limit_hit&skip_code_recursive_on_cache_limit_hitz0torch._dynamo.config.fail_on_recompile_limit_hitfail_on_cache_limit_hit#TORCH_COMPILE_USE_LAZY_GRAPH_MODULEdynamic)r   unbacked automatic_dynamic_shapes_mark_asTORCHDYNAMO_PREPARE_FREEZINGtraceable_tensor_subclassesnontraceable_tensor_subclassesTORCHDYNAMO_SUPPRESS_ERRORSTORCH_COMPILE_REPLAY_RECORDTORCH_COMPILE_DISABLETORCH_COMPILE_CPROFILE!skipfiles_inline_module_allowlist>   torch._refstorch._primstorch._decomptorch.testingtorch.distributionsTORCHDYNAMO_REPRO_AFTERTORCHDYNAMO_REPRO_LEVEL   TORCHDYNAMO_REPRO_FORWARD_ONLYgMbP?TORCHDYNAMO_REPRO_IGNORE_NON_FP"TORCHDYNAMO_CAPTURE_SCALAR_OUTPUTS,TORCHDYNAMO_CAPTURE_DYNAMIC_OUTPUT_SHAPE_OPS)ddp_optimizerpython_reducer'python_reducer_without_compiled_forwardno_optimizationoptimize_ddp(TORCH_DYNAMO_DO_NOT_EMIT_RUNTIME_ASSERTSdo_not_emit_runtime_assertsfloat64
complex128int64z*pytorch/compiler:inline_inbuilt_nn_modules)defaultjustknobc                     d} | t           j        v r0t           j                            t           j        |          d          S t	                      rCt           j                            t          j                    t          j                    d          S t           j                            t          j	                    d          S )NTORCH_COMPILE_DEBUG_DIRtorch_compile_debug)
osenvironpathjoinr   tempfile
gettempdirgetpassgetusergetcwd)DEBUG_DIR_VAR_NAMEs    f/var/www/tools.fuzzalab.pt/emblema-extractor/venv/lib/python3.11/site-packages/torch/_dynamo/config.pydefault_debug_dir_rootrM     s    2RZ''w||BJ'9:<QRRR	 @w||!!7?#4#46K
 
 	
 w||BIKK)>???    >   repro_afterrepro_levelconstant_functionsr&   reorderable_logging_functions.ignore_logger_methods)layoutis_negis_conj	is_pinned)stridestorage_offsetis_contiguous TORCH_FAKE_TENSOR_DISPATCH_CACHE+TORCH_FAKE_TENSOR_DISPATCH_CACHE_CROSSCHECK!compiled_autograd_kwargs_overrideTORCH_COMPILER_COLLECTIVESz7pytorch/remote_cache:enable_local_automatic_dynamic_pgo(TORCH_DYNAMO_AUTOMATIC_DYNAMIC_LOCAL_PGO)r>   env_name_forcer=   automatic_dynamic_local_pgo)TORCH_DYNAMO_AUTOMATIC_DYNAMIC_REMOTE_PGOautomatic_dynamic_remote_pgoUNSAFE_SKIP_FSDP_MODULE_GUARDSz,pytorch/compiler:enable_run_gc_after_compile!TORCH_DYNAMO_RUN_GC_AFTER_COMPILE)r=   r>   env_name_default_custom_ops_profile)*c                      d S )N )changess    rL   _make_closure_patcherrl   t  s      rN   )__doc__rH   rB   sysrF   os.pathr   r   typingr   r   r   r   r	   r
   torch._environmentr   torch.utils._config_moduler   r   r   r   str__annotations__rC   getverboseverify_correctnessminimum_call_countdead_code_eliminationrecompile_limitaccumulated_recompile_limit*skip_code_recursive_on_recompile_limit_hitfail_on_recompile_limit_hitr   intr   r   boolr   specialize_intspecialize_floatdynamic_shapesuse_lazy_graph_moduleassume_static_by_defaultautomatic_dynamic_shapesr   force_parameter_static_shapes&force_nn_module_property_static_shapesallow_ignore_mark_dynamicguard_nn_modules guard_nn_modules_using_dict_tagsprepare_freezingsetr    typer!   suppress_errorsreplay_record_enabled rewrite_assert_with_torch_assertdisablecprofiler&   dict*allowed_functions_module_string_ignorelistrO   rP   repro_forward_onlyrepro_tolerancerepro_ignore_non_fpsame_two_models_use_fp64capture_scalar_outputs capture_dynamic_output_shape_ops+prefer_deferred_runtime_asserts_over_guards'allow_complex_guards_as_runtime_asserts3force_unspec_int_unbacked_size_like_on_torchrec_kjtallow_unspec_int_on_nn_moduler7   r9   skip_torchrecdont_skip_tracingoptimize_ddp_lazy_compileskip_fsdp_guardsskip_fsdp_hooksskip_nnmodule_hook_guards,skip_no_tensor_aliasing_guards_on_parameters*skip_tensor_guards_with_matching_dict_tagsraise_on_ctx_manager_usageraise_on_unsafe_aot_autograderror_on_nested_jit_traceerror_on_nested_fx_trace	allow_rnncapture_sparse_computeerror_on_recompilereport_guard_failures__file__base_dirtrace_numpynumpy_default_floatnumpy_default_complexnumpy_default_intuse_numpy_random_streamenable_cpp_guard_manager enable_cpp_symbolic_shape_guardsenable_trace_contextlibenable_trace_unittest"enable_faithful_generator_behaviorinline_inbuilt_nn_modulesinstall_free_tensors!enable_cpp_framelocals_guard_evaluse_graph_deduplicationtrack_nodes_for_deduplicationgraph_deduplication_lintissue_3_13_0_warningallow_empty_graphs%record_compile_time_instruction_countrM   debug_dir_root_save_config_ignore%cudagraph_backend_keep_input_mutation(cudagraph_backend_support_input_mutationonly_allow_pt2_compliant_opscapture_autograd_functioncapture_func_transformslog_compilation_metricsrR   rS   +inject_BUILD_SET_unimplemented_TESTING_ONLY)_autograd_backward_strict_mode_banned_ops5_autograd_backward_strict_mode_conditional_banned_opsfake_tensor_cache_enabled$fake_tensor_cache_crosscheck_enabled"fake_tensor_disable_inference_modecompiled_autogradr]   enable_compiler_collectivesra   rc   _unsafe_skip_fsdp_module_guardsrun_gc_after_compilewrap_top_framerecord_runtime_overheadrg   torch.utils._config_typingrl   modules__name__rj   rN   rL   <module>r      sm  	 	 	  				 



  $ $ $ $ $ $ $ $ I I I I I I I I I I I I I I I I ( ( ( ( ( ( V V V V V V V V V V  $x} # # # *...
4
4
;        "  .2 * $ %KLLL # L L L$*F
<% % % c   
 06v
K0 0 0 &    !'
<! ! !     
    JNN8#>>#E        DM  '*?"@ L L L !% 
 *. & "    $(  
 :>>"@#FF#M  /2cee Sc^ 3 3 3 25 DI 6 6 6 $rz~~&CUKKLL
 
'DcJJcQ  $(   *..0#
6
6#
= :>>2E:: 57 !4S> 6 6 6. . . * jnn6== c"*..!:A>>?? Z^^$DEEL 
  jnn%FGG3N    
 (LMMQTT  JNNA3GG3N !
 /4 + +0 ' 7< 3 !& 4 	 e	 	 	 	  JNN=sCCsJ T   
    "    
 !  04 , .2 * "   %  !     	 #,)++74 
     77777778#4#4556677    $         $)       &* " #F9      %) !    !&  ! 
     ). %
@ 
@ 
@ ('))    ). % ,1 (  %  !      =@CEE s8SE4K#89 A A A 25 s8CH-. 6 6 6 /4 +- - - )9 9 9 5 JNN5s;;sB  JNN@#FF#M % &* "   57 !4S> 6 6 6 !jnn-I3OOSVV . %+FF=% % % T    0@/?/0 0 htn    JNN3S99S@  
 v;8       &* Xc] ) ) ) .,,,,---  ck(+ , , , , ,rN   