a
    hj                     @   s  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dZ"e#ed< eddZ$e#ed< eddZ%e&ed< ed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Z4e5 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ZAe#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 rdndZ\dZ]dZ^eeeee_Z`dZad2Zbd3Zcd4ZddZedZfdZgdZhdZidZjedd5d6ZkdZldZmdZndZodZpdZqdZrdZsd7d8 Ztet Zuh d9ZvdZwdZxdZydZzdZ{dZ|e5 Z}e5e
e	gdf  ed:< 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dA< ejdBd	d
kZedCdDddEZe&edF< edGZee& edH< ejdId	d
kZeddJdKdLZdZdZdZee	 edM< erddNlT dOdP Zeeje  dS )Qaq  
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_nameZ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_hitZ#TORCH_COMPILE_USE_LAZY_GRAPH_MODULEdynamic)r   Zunbacked automatic_dynamic_shapes_mark_asZTORCHDYNAMO_PREPARE_FREEZINGtraceable_tensor_subclassesnontraceable_tensor_subclassesZTORCHDYNAMO_SUPPRESS_ERRORSZTORCH_COMPILE_REPLAY_RECORDZTORCH_COMPILE_DISABLEZTORCH_COMPILE_CPROFILE!skipfiles_inline_module_allowlist>   ztorch._refsztorch.testingztorch._primsztorch._decompztorch.distributionsZTORCHDYNAMO_REPRO_AFTERZTORCHDYNAMO_REPRO_LEVEL   ZTORCHDYNAMO_REPRO_FORWARD_ONLYgMbP?ZTORCHDYNAMO_REPRO_IGNORE_NON_FPZ"TORCHDYNAMO_CAPTURE_SCALAR_OUTPUTSZ,TORCHDYNAMO_CAPTURE_DYNAMIC_OUTPUT_SHAPE_OPS)Zddp_optimizerZpython_reducerZ'python_reducer_without_compiled_forwardZno_optimizationoptimize_ddpZ(TORCH_DYNAMO_DO_NOT_EMIT_RUNTIME_ASSERTSdo_not_emit_runtime_assertsfloat64Z
complex128int64z*pytorch/compiler:inline_inbuilt_nn_modules)defaultjustknobc                  C   sV   d} | t jv r"t jt j|  dS t r@t jt t dS t jt 	 dS d S )NZTORCH_COMPILE_DEBUG_DIRZtorch_compile_debug)
osenvironpathjoinr
   tempfile
gettempdirgetpassgetusergetcwd)ZDEBUG_DIR_VAR_NAME r.   B/var/www/auris/lib/python3.9/site-packages/torch/_dynamo/config.pydefault_debug_dir_root  s    
r0   >   repro_levelr   Zconstant_functionsrepro_afterreorderable_logging_functions.ignore_logger_methods)ZlayoutZis_negZis_conj	is_pinned)ZstrideZstorage_offsetZis_contiguousZ TORCH_FAKE_TENSOR_DISPATCH_CACHEZ+TORCH_FAKE_TENSOR_DISPATCH_CACHE_CROSSCHECK!compiled_autograd_kwargs_overrideZTORCH_COMPILER_COLLECTIVESz7pytorch/remote_cache:enable_local_automatic_dynamic_pgoZ(TORCH_DYNAMO_AUTOMATIC_DYNAMIC_LOCAL_PGO)r$   Zenv_name_forcer#   automatic_dynamic_local_pgoZ)TORCH_DYNAMO_AUTOMATIC_DYNAMIC_REMOTE_PGOautomatic_dynamic_remote_pgoZUNSAFE_SKIP_FSDP_MODULE_GUARDSz,pytorch/compiler:enable_run_gc_after_compileZ!TORCH_DYNAMO_RUN_GC_AFTER_COMPILE)r#   r$   Zenv_name_default_custom_ops_profile)*c                  K   s   d S )Nr.   )changesr.   r.   r/   _make_closure_patchert      r<   )__doc__r+   r%   sysr)   os.pathr   r   typingr   r   r   r   r   r	   Ztorch._environmentr
   Ztorch.utils._config_moduler   r   r   r   str__annotations__r&   getverboseZverify_correctnessZminimum_call_countZdead_code_eliminationZrecompile_limitZaccumulated_recompile_limitZ*skip_code_recursive_on_recompile_limit_hitZfail_on_recompile_limit_hitr   intr   r   boolr   Zspecialize_intZspecialize_floatZdynamic_shapesZuse_lazy_graph_moduleZassume_static_by_defaultZautomatic_dynamic_shapesr   Zforce_parameter_static_shapesZ&force_nn_module_property_static_shapesZallow_ignore_mark_dynamicZguard_nn_modulesZ guard_nn_modules_using_dict_tagsZprepare_freezingsetr   typer   Zsuppress_errorsZreplay_record_enabledZ rewrite_assert_with_torch_assertdisableZcprofiler   dictZ*allowed_functions_module_string_ignorelistr2   r1   Zrepro_forward_onlyZrepro_toleranceZrepro_ignore_non_fpZsame_two_models_use_fp64Zcapture_scalar_outputsZ capture_dynamic_output_shape_opsZ+prefer_deferred_runtime_asserts_over_guardsZ'allow_complex_guards_as_runtime_assertsZ3force_unspec_int_unbacked_size_like_on_torchrec_kjtZallow_unspec_int_on_nn_moduler   r    Zskip_torchrecZdont_skip_tracingZoptimize_ddp_lazy_compileZskip_fsdp_guardsZskip_fsdp_hooksZskip_nnmodule_hook_guardsZ,skip_no_tensor_aliasing_guards_on_parametersZ*skip_tensor_guards_with_matching_dict_tagsZraise_on_ctx_manager_usageZraise_on_unsafe_aot_autogradZerror_on_nested_jit_traceZerror_on_nested_fx_traceZ	allow_rnnZcapture_sparse_computeZerror_on_recompileZreport_guard_failures__file__base_dirZtrace_numpyZnumpy_default_floatZnumpy_default_complexZnumpy_default_intZuse_numpy_random_streamZenable_cpp_guard_managerZ enable_cpp_symbolic_shape_guardsZenable_trace_contextlibZenable_trace_unittestZ"enable_faithful_generator_behaviorZinline_inbuilt_nn_modulesZinstall_free_tensorsZ!enable_cpp_framelocals_guard_evalZuse_graph_deduplicationZtrack_nodes_for_deduplicationZgraph_deduplication_lintZissue_3_13_0_warningZallow_empty_graphsZ%record_compile_time_instruction_countr0   Zdebug_dir_rootZ_save_config_ignoreZ%cudagraph_backend_keep_input_mutationZ(cudagraph_backend_support_input_mutationZonly_allow_pt2_compliant_opsZcapture_autograd_functionZcapture_func_transformsZlog_compilation_metricsr3   r4   Z+inject_BUILD_SET_unimplemented_TESTING_ONLYZ)_autograd_backward_strict_mode_banned_opsZ5_autograd_backward_strict_mode_conditional_banned_opsZfake_tensor_cache_enabledZ$fake_tensor_cache_crosscheck_enabledZ"fake_tensor_disable_inference_modeZcompiled_autogradr6   Zenable_compiler_collectivesr7   r8   Z_unsafe_skip_fsdp_module_guardsZrun_gc_after_compileZwrap_top_frameZrecord_runtime_overheadr9   Ztorch.utils._config_typingr<   modules__name__r.   r.   r.   r/   <module>   s8   	

