Ë
    L²jÂ�  ã            	       ó"  — U d Z 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 ddlm	Z	m
Z
 ddlmZmZmZ ddlmZ ddlmZmZmZ dZedz  ed<   ej0                  j3                  d	d
«      dk(  ZdZej0                  j3                  dd«      Zeed<   ej0                  j3                  dd«      Zeed<   ej0                  j3                  dd«      Zeed<   dZdZ dZ!dZ"dZ#dZ$dZ%dZ& eddd¬«      Z'e(ed<   dZ) ed¬«      Z*e+ed<    ed¬«      Z,e+ed <    ed!dd¬"«      Z-e(ed#<    ed$¬«      Z.e(ed%<   dZ/dZ0dZ1ej0                  j3                  d&d«      dk(  Z2dZ3ej0                  j3                  d'd«      dk(  Z4d(Z5ed)   ed*<   dZ6dZ7dZ8dZ9dZ:dZ;dZ<ej0                  j3                  d+d
«      dk(  Z= e>«       Z?e>e@e      ed,<    e>«       ZAe>e@e      ed-<    e(ej0                  j3                  d.d«      «      ZBej0                  j3                  d/d
«      dk(  ZCdZDej0                  j3                  d0d
«      dk(  ZEej0                  j3                  d1d«      ZFej0                  j3                  d2d«      ZGe(ez  ed3<   i ZHeIeef   ed4<   	 h d5£ZJej0                  j3                  d6d«      ZK e+ej0                  j3                  d7d8«      «      ZLej0                  j3                  d9«      dk(  ZMd:ZNej0                  j3                  d;«      dk(  ZOdZPej0                  j3                  d<«      dk(  ZQej0                  j3                  d=d
«      dk(  ZRdZSdZTdZUdZVe(ed>   z  ed?<   ej0                  j3                  d@d
«      dk(  ZWe(edA<   dZXdZYdZZdZ[dZ\dZ]dZ^dZ_dZ`dZadZbdZcdZddZedZfdZgdZhdZidZj e«        ZkdZldZm e
 e
 e
 e	en«      «      «      «      ZodZpdZqdBZrdCZsdDZtdZudZvdZwdZxdZydZz eddEddF¬G«      Z{dZ|e(edH<   dZ}dZ~dZdZ€dZ�dZ‚dZƒdZ„dZ…dZ†dZ‡dZˆdZ‰dIefdJ„ZŠ eŠ«       Z‹h dK£ZŒdZ�dZŽdZ�dZ�dZ‘dZ’e(edL<   dZ“ e>«       Z”e>eegdf      edM<    e>«       Z•e>edNef      edO<    edP¬«      Z–e>edNef      edQ<   dZ—g dR¢Z˜g dS¢Z™ej0                  j3                  dTd«      dk(  Zšej0                  j3                  dUd
«      dk(  Z›dZœej0                  j3                  dVd
«      dk(  Z�ej0                  j3                  dWd
«      dk(  ZždZŸdZ dZ¡dZ¢dZ£i Z¤eIeef   edX<   	 ej0                  j3                  dYd
«      dk(  Z¥ej0                  j3                  dZd
«      dk(  Z¦ ed[d\d¬]«      Z§e(ed^<    ed_«      Z¨e(dz  ed`<   ej0                  j3                  dad
«      dk(  Z©ej0                  j3                  dbd«      Zªedz  edc<    e e�jV                  dd«      dk7  dedf¬g«      Z¬dZ­dZ®dZ¯dZ°dZ±edz  edh<   dZ²e(edi<   dZ³e(edj<   dZ´e(dz  edk<   erddllµ­ dmedIefdn„Z¶ ee�jn                  e¸   «       y)oar  
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)ÚCallable)ÚabspathÚdirname)ÚAnyÚLiteralÚTYPE_CHECKING)Ú	is_fbcode)ÚConfigÚget_tristate_envÚinstall_config_moduleÚlog_file_nameÚTORCHDYNAMO_VERBOSEÚ0Ú1FÚTORCH_COMPILE_OVERRIDE_BACKENDSÚ Údebug_backend_overrideÚ'TORCH_COMPILE_OVERRIDE_INDUCTOR_CONFIGSÚdebug_inductor_config_overrideÚ%TORCH_COMPILE_OVERRIDE_DYNAMO_CONFIGSÚdebug_dynamo_config_overrideé   TÚinfoé   é   zdoes not do anything)ÚdefaultÚ
deprecatedÚdeprecation_messageÚ*skip_code_recursive_on_recompile_limit_hitz$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)r    r   r   Ú&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Ú%TORCH_DYNAMO_AUTOMATIC_DYNAMIC_SHAPESÚ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ÚTORCH_COMPILE_DYNAMO_PROFILERÚdynamo_profilerÚ!skipfiles_inline_module_allowlist>   útorch._refsútorch._primsútorch._decompútorch.testingútorch.distributionsÚTORCHDYNAMO_REPRO_AFTERÚTORCHDYNAMO_REPRO_LEVELé   ÚTORCHDYNAMO_REPRO_FORWARD_ONLYgü©ñÒMbP?Ú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_modulesz>does not do anything, inline_inbuilt_nn_modules is always True)r   Újustknobr   r   Únested_graph_breaksÚreturnc                  óŽ  — d} | t         j                  v r1t         j                  j                  t         j                  |    d«      S t	        «       rEt         j                  j                  t        j                  «       t        j                  «       d«      S t         j                  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    úS/var/www/html/ia-enhanced/venv/lib/python3.12/site-packages/torch/_dynamo/config.pyÚdefault_debug_dir_rootr[   w  s„   € à2ÐØœRŸZ™ZÑ'Ü�w‰w�|‰|œBŸJ™JÐ'9Ñ:Ð<QÓRÐRÜ	ŒÜ�w‰w�|‰|Ü×ÑÓ!¤7§?¡?Ó#4Ð6Kó
ð 	
ô �w‰w�|‰|œBŸI™I›KÐ)>Ó?Ð?ó    >   Úrepro_afterÚrepro_levelÚconstant_functionsr3   Ú capture_profiler_record_functionÚreorderable_logging_functions.Úignore_logging_functionsz-torch._dynamo.config.ignore_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ÚTORCH_CACHING_PRECOMPILEÚTORCH_STRICT_PRECOMPILEÚ!compiled_autograd_kwargs_overrideÚTORCH_COMPILER_COLLECTIVESÚ"TORCHDYNAMO_ENABLE_P2P_COMPILATIONz7pytorch/remote_cache:enable_local_automatic_dynamic_pgoÚ(TORCH_DYNAMO_AUTOMATIC_DYNAMIC_LOCAL_PGO)rJ   Úenv_name_forcer   Úautomatic_dynamic_local_pgoÚ)TORCH_DYNAMO_AUTOMATIC_DYNAMIC_REMOTE_PGOÚautomatic_dynamic_remote_pgoÚUNSAFE_SKIP_FSDP_MODULE_GUARDSÚPT2_COMPILE_ID_PREFIXÚpt2_compile_id_prefixÚPy_GIL_DISABLEDz,pytorch/compiler:enable_run_gc_after_compileÚ!TORCH_DYNAMO_RUN_GC_AFTER_COMPILE)r   rJ   Úenv_name_defaultÚ_custom_ops_profileÚ'enable_invoke_subgraph_regional_compileÚinline_invoke_subgraphÚ#invalidate_compile_context_weakrefs)Ú*Úchangesc                   ó   — y )N© )r‚   s    rZ   Ú_make_closure_patcherr…   “  s   � r\   )¹Ú__doc__rV   rP   ÚsysÚ	sysconfigrT   Úcollections.abcr   Úos.pathr   r   Útypingr   r   r   Útorch._environmentr	   Útorch.utils._config_moduler
   r   r   r   ÚstrÚ__annotations__rQ   ÚgetÚverboseÚverify_correctnessr   r   r   Úleaf_function_validate_outputsÚ%leaf_function_check_escaped_gradientsÚminimum_call_countÚdead_code_eliminationÚreplay_side_effectsÚside_effect_replay_policyÚrecompile_limitÚaccumulated_recompile_limitr   ÚboolÚfail_on_recompile_limit_hitr!   Úintr"   r#   r$   Úspecialize_intÚspecialize_floatÚdynamic_shapesÚuse_lazy_graph_moduleÚassume_static_by_defaultÚautomatic_dynamic_shapesr)   Ú!automatic_dynamic_exclusion_guardÚlog_graph_in_out_metadataÚ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Úcprofiler2   r3   ÚdictÚ*allowed_functions_module_string_ignorelistr]   r^   Ú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Ú3force_unspec_int_unbacked_size_like_on_torchrec_kjtÚallow_unspec_int_on_nn_modulerD   rF   Úskip_torchrecÚdont_skip_tracingÚoptimize_ddp_lazy_compileÚ#use_lamba_guard_for_object_aliasingÚskip_fsdp_guardsÚskip_fsdp_hooksÚskip_nnmodule_hook_guardsÚ,skip_no_tensor_aliasing_guards_on_parametersÚ*skip_tensor_guards_with_matching_dict_tagsÚ%skip_guards_on_constant_func_defaultsÚ)assume_dunder_attributes_remain_unchangedÚ"use_recursive_dict_tags_for_guardsÚ0max_saved_pointers_for_recursive_dict_tags_checkÚraise_on_ctx_manager_usageÚraise_on_unsafe_aot_autogradÚerror_on_nested_jit_traceÚerror_on_nested_fx_traceÚforce_compile_during_fx_traceÚ	allow_rnnÚcapture_sparse_computeÚerror_on_recompileÚreport_guard_failuresÚ__file__Úbase_dirÚtrace_numpyÚtrace_autograd_opsÚ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_modulesrK   Ú3error_on_dynamo_callback_in_fullgraph_compiled_codeÚinstall_free_tensorsÚinstall_free_tensors_for_exportÚ!enable_cpp_framelocals_guard_evalÚuse_graph_deduplicationÚtrack_nodes_for_deduplicationÚgraph_deduplication_lintÚissue_3_13_0_warningÚallow_empty_graphsÚdebug_force_nested_callsÚ&debug_force_graph_break_on_leaf_returnÚdebug_disable_compile_counterÚ%record_compile_time_instruction_countr[   Ú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_transformsr`   Úlog_compilation_metricsra   rb   rc   Ú+inject_BUILD_SET_unimplemented_TESTING_ONLYÚ)_autograd_backward_strict_mode_banned_opsÚ5_autograd_backward_strict_mode_conditional_banned_opsÚfake_tensor_cache_enabledÚ$fake_tensor_cache_crosscheck_enabledÚ"fake_tensor_disable_inference_modeÚcaching_precompileÚstrict_precompileÚcompiled_autogradÚenable_dynamo_decompositionsÚgraph_break_on_nn_param_ctorÚ#inline_torch_dispatch_torch_compileÚ-skip_fwd_side_effects_in_bwd_under_checkpointro   Úenable_compiler_collectivesÚenable_p2p_compilationrt   rv   Ú_unsafe_skip_fsdp_module_guardsry   Úget_config_varÚrun_gc_after_compileÚ'constant_fold_autograd_profiler_enabledÚwrap_top_frameÚrecord_runtime_overheadÚenable_aot_compiler}   r~   r   r€   Útorch.utils._config_typingr…   ÚmodulesÚ__name__r„   r\   rZ   ú<module>r     sá  ðò
ó Û 	Û 
Û Û Ý $ß $ß .Ñ .å (ß VÑ Vð !€ˆs�T‰zÓ  ð �*‰*�.‰.Ð.°Ó
4¸Ñ
;€ð Ð ð !Ÿj™jŸn™nÐ-NÐPRÓSÐ ˜Ó Sð ')§j¡j§n¡nØ-¨ró'Ð  ó ð %'§J¡J§N¡NØ+¨Ró%Ð ˜có ð "'Ð ð ).Ð %ð Ð ð Ð ð Ð ð #Ð ð €ð "Ð á39Ø˜TÐ7Mô4Ð *¨Dó ð $Ð áÐ%KÔLÐ �#Ó LÙ$*Ø
<ô%Ð ˜có ñ 06Ø
KØØ.ô0Ð &¨ó ñ !'Ø
<ô!Ð ˜ó ð €ð
 Ð ð €ð ‡J�J‡N�NÐ8¸#Ó>À#ÑEð ð  Ð ð ‡J�J‡N�NÐ:¸CÓ@ÀCÑGð ð
 DMÐ   'Ð*?Ñ"@Ó Lð( %*Ð !ð "Ð ð !%Ð ð
 *.Ð &ð "Ð ð Ð ð $(Ð  ð
 —:‘:—>‘>Ð"@À#ÓFÈ#ÑMÐ ñ /2«eÐ ˜S  c¡™^Ó 3ñ 25³Ð   D¨¡I¡Ó 6ñ �r—z‘z—~‘~Ð&CÀUÓKÓL€ð
 Ÿ
™
Ÿ™Ð'DÀcÓJÈcÑQÐ ð $(Ð  ð �*‰*�.‰.Ð0°#Ó
6¸#Ñ
=€ð �:‰:�>‰>Ð2°EÓ:€ð !Ÿj™jŸn™nÐ-LÈeÓT€�˜‘Ó Tð 57Ð ! 4¨¨S¨¡>Ó 6ðò&.Ð *ð �j‰j�n‰nÐ6¸Ó=€ñ �"—*‘*—.‘.Ð!:¸AÓ>Ó?€ð —Z‘Z—^‘^Ð$DÓEÈÑLÐ ð
 €ð —j‘j—n‘nÐ%FÓGÈ3ÑNÐ ð  Ð ð
 Ÿ™Ÿ™Ð(LÓMÐQTÑTÐ ð ‡J�J‡N�NÐAÀ3ÓGÈ3ÑNð !ð
 /4Ð +ð 7<Ð 3ð !&Ð ð4 	ð ØØð	ññó	ð  ‡J�J‡N�NÐ=¸sÓCÀsÑJð ˜Tó ð
 €ð Ð ð "Ð ð '+Ð #ð Ð ð €ð
 !Ð ð 04Ð ,ð .2Ð *ð ).Ð %ð& -1Ð )ð &+Ð "ð 47Ð 0ð "Ð ð  %Ð ð !Ð ð  Ð ð
 !&Ð ð €	ñ '›[˜Ð ð
 Ð ð Ð ñ ‘7™7¡7¨8Ó#4Ó5Ó6Ó7€ð €ð Ð ð  Ð Ø$Ð ØÐ ð  Ð ð  Ð ð $)Ð  ð Ð ð Ð ð &*Ð "ñ #ØØ9ØØXô	Ð ð "Ð �TÓ !ð 7<Ð 3ð
 Ð ð #'Ð ð %)Ð !ð  Ð ð !&Ð ð !Ð ð
 Ð ð Ð ð !Ð ð */Ð &ð
 !&Ð ð ).Ð %ð
@ ó 
@ñ (Ó)€òÐ ð ).Ð %ð ,1Ð (ð  %Ð ð !Ð ð Ð ð */Ð   $Ó .ð Ð ñ =@»EÐ ˜s 8¨S¨E°4¨KÑ#8Ñ9Ó Añ 58³EÐ ˜#˜h s¨C xÑ0Ñ1Ó 9ñ 28Ø
9ô2Ð �s˜8 C¨ HÑ-Ñ.ó ð /4Ð +ò-Ð )ò9Ð 5ð ‡J�J‡N�NÐ5°sÓ;¸sÑBð ð ‡J�J‡N�NÐ@À#ÓFÈ#ÑMð %ð &*Ð "ð —Z‘Z—^‘^Ð$>ÀÓDÈÑKÐ à—J‘J—N‘NÐ#<¸cÓBÀcÑIÐ ð Ð ð  $Ð ð  $Ð ð '+Ð #ð 16Ð -ð 57Ð ! 4¨¨S¨¡>Ó 6ðð: !Ÿj™jŸn™nÐ-IÈ3ÓOÐSVÑVÐ ð ‡J�J‡N�NÐ7¸Ó=ÀÑDð ñ2 %+ØFØ=Øô%Ð ˜Tó ñ -=Ø/ó-Ð ˜d T™kó ð ‡J�J‡N�NÐ3°SÓ9¸SÑ@ð  ð
 %'§J¡J§N¡NÐ3JÈDÓ$QÐ �s˜T‘zÓ Qñ à$ˆI×$Ò$Ð%6Ó7¸1Ñ<Ø;Ø8ô	Ð ð +0Ð 'ð €ð Ð ð Ð ð #'Ð �S˜4‘ZÓ &ð 16Ð '¨Ó 5ð  %Ð ˜Ó $ð 48Ð # T¨D¡[Ó 7áÜ,à9¨Ð9°Ó9ñ �c—k’k (Ñ+Õ ,r\   