o
    "’×i‹†  ã                   @   sö  U d dl Z d dlZd dlmZmZmZmZmZmZm	Z	 d dl
Z
dd„ ZdZdZdZe j d¡dkZe j d	¡dkZdZe j d
¡dkZe j d¡dkZe j dd¡dkZe j deƒ r]dnd¡dkZe j deƒ rkdnd¡ZdZdZe j dd¡dkZe j d¡dkZdZdZdZe j dd¡dkZ e j dd¡Z!dZ"dZ#dZ$dZ%dZ&eee
j'j(j)gdf  e*d< dZ+eee
j'j(j)gdf  e*d< dZ,eee
j'j)gdf  e*d< dZ-eee
j'j)gdf  e*d< dZ.eee
j'j(j)gdf  e*d< dZ/dZ0dZ1dZ2dZ3i i i i i i dœZ4ee5ee5ef f e*d< i Z6ee5ee5ef f e*d< dZ7e j dd¡dkZ8dZ9dZ:ddd dd!œZ;ee5ef e*d"< dZ<dZ=g d#¢Z>d$Z?d%Z@d&ZAe j d'¡dkZBe j d(¡dkZCe j d)¡dkZDeƒ rfdne j d*¡dkZEe j d+d,¡ F¡ ZGe j d-d.¡ F¡ ZHe j d/d¡dkZId0ZJe j d1¡dkZKe j d2¡dkZLe j d3¡dkZMd4ZNd5ZOd6ZPe j d7¡dkZQe j d8¡dkZRe j d9¡dkZSeTe j d:d¡ƒZUe
jVjWsÑdndZXe j d;eX¡dkZYe j d<d¡dkZZe j d=d¡dkZ[e j d>¡dkZ\d?Z]d@Z^dAZ_dZ`dZadZbe j dB¡dkZce j dC¡dkZde j dDdE¡Zee j dFd¡dkZfd ZgdGZhdAZidAZjdZkdZldZme j dHd¡dkZndZodZpdZqdZrdZsdZtdIe
juv pOdJe
juv Zveƒ pUevZwdKdL„ Zxexƒ ZydZzd&Z{dMdNgZ|ee	edO e5f  e*dP< dZ}e~e*dQ< dRdS„ Zeƒ Z€eƒ r¯d dTlm‚Z‚ zeƒrœe‚ „e j… †eƒ ‡dUe jˆ¡dV¡¡Z‰ne‚ „dV¡Z‰W n eŠy®   dZ‰Y nw dZ‰dWZ‹e j dXd¡dkZŒe j dYeƒ rÆdnd¡dkZdZŽdZdZe~e*dZ< e j d[d¡dkZ‘dZ’dZ“dZ”dZ•e j d\dE¡Z–e–dEkZ—e–dkrødEne–Z˜e j d]d¡Z™dZše j d^d¡dkZ›e~e*d_< dZœe~e*d`< e j daeƒ r dnd¡dkZe~e*db< dZže~e*dc< dZŸe~e*dd< dZ e~e*de< G dfdg„ dgƒZ¡G dhdi„ diƒZ¢G djdk„ dkƒZ£G dldm„ dmƒZ¤G dndo„ doƒZ¥dpgZ¦g dq¢Z§erld drl¨T d dsl©mªZª eªej«e¬ ƒ dS )té    N)ÚAnyÚCallableÚDictÚListÚOptionalÚTYPE_CHECKINGÚUnionc                   C   s   t tjdƒ S )NÚgit_version)ÚhasattrÚtorchÚversion© r   r   úT/home/ubuntu/SoloSpeech/.venv/lib/python3.10/site-packages/torch/_inductor/config.pyÚ	is_fbcode	   s   r   FTÚTORCHINDUCTOR_FX_GRAPH_CACHEÚ1Ú#TORCHINDUCTOR_FX_GRAPH_REMOTE_CACHEÚ#TORCHINDUCTOR_AUTOTUNE_REMOTE_CACHEÚ"TORCHINDUCTOR_FORCE_DISABLE_CACHESÚTORCHINDUCTOR_CPP_WRAPPERÚ0ÚTORCHINDUCTOR_ABI_COMPATIBLEÚTORCHINDUCTOR_C_SHIM_VERSIONÚ2ÚTORCHINDUCTOR_SIZE_ASSERTSÚTORCHINDUCTOR_NAN_ASSERTSÚTORCHINDUCTOR_MEMORY_PLANNINGÚTORCHINDUCTOR_MEMORY_POOLÚintermediatesÚpost_grad_custom_pre_passÚpost_grad_custom_post_passÚjoint_custom_pre_passÚjoint_custom_post_passÚpre_grad_custom_pass)Úbatch_linearÚbatch_linear_lhsÚbatch_layernormÚ
batch_tanhÚ
batch_reluÚbatch_sigmoidÚpre_grad_fusion_optionsÚpost_grad_fusion_optionsÚ"TORCHINDUCTOR_DYNAMIC_SCALE_RBLOCKg-Cëâ6?é   )Úpre_gradÚ	precisionÚnum_iterationsÚrequires_optimizerÚfx_passes_numeric_check)Úreorder_compute_for_overlapÚ
sink_waitsÚraise_commsÚdefaulti,  é   ÚTORCHINDUCTOR_MAX_AUTOTUNEÚ$TORCHINDUCTOR_MAX_AUTOTUNE_POINTWISEÚTORCHINDUCTOR_MAX_AUTOTUNE_GEMMÚ"TORCHINDUCTOR_FORCE_SAME_PRECISIONÚ(TORCHINDUCTOR_MAX_AUTOTUNE_GEMM_BACKENDSzATEN,TRITON,CPPÚ,TORCHINDUCTOR_MAX_AUTOTUNE_GEMM_SEARCH_SPACEÚDEFAULTÚ'TORCHINDUCTOR_AUTOTUNE_FALLBACK_TO_ATENi    Ú#TORCHINDUCTOR_SEARCH_AUTOTUNE_CACHEÚTORCHINDUCTOR_SAVE_ARGSÚ!TORCHINDUCTOR_AUTOTUNE_IN_SUBPROCg      N@g      ð?g       @Ú#TORCHINDUCTOR_AUTOTUNE_MULTI_DEVICEÚ'TORCHINDUCTOR_COORDINATE_DESCENT_TUNINGÚ5TORCHINDUCTOR_COORDINATE_DESCENT_CHECK_ALL_DIRECTIONSÚ'TORCHINDUCTOR_COORDINATE_DESCENT_RADIUSÚ!TORCHINDUCTOR_LAYOUT_OPTIMIZATIONÚTORCHINDUCTOR_FORCE_LAYOUT_OPTÚ TORCHINDUCTOR_KEEP_OUTPUT_STRIDEÚTORCHINDUCTOR_WARN_MIX_LAYOUTé   é   é   ÚTORCHINDUCTOR_DEBUG_FUSIONÚTORCHINDUCTOR_BENCHMARK_FUSIONÚ#TORCHINDUCTOR_ENABLED_METRIC_TABLESÚ Ú'TORCHINDUCTOR_BENCHMARK_EPILOGUE_FUSIONé@   ÚTORCHINDUCTOR_BENCHMARK_KERNELÚdevÚgitc                  C   s2   t j dtƒ r	dnd¡} | dv sJ d| › ƒ‚| S )NÚTORCHINDUCTOR_WORKER_STARTÚforkÚ
subprocess)rY   rX   ÚspawnzInvalid start method: )ÚosÚenvironÚgetr   )Ústart_methodr   r   r   Údecide_worker_start_methodƒ  s   ÿ
ür_   Úfuse_ddp_with_concat_opÚschedule_comm_wait).NÚ_fuse_ddp_communication_passesÚ_micro_pipeline_tpc                  C   s^   dt jv rtt jd ƒS tjdkstƒ rdS tt dƒr"tt  d¡ƒnt  	¡ } | s*J ‚t
d| ƒS )a8  
    Here are the precedence to decide compile_threads
    1. User can override it by TORCHINDUCTOR_COMPILE_THREADS.  One may want to disable async compiling by
       setting this to 1 to make pdb happy.
    2. Set to 1 if it's win32 platform or it's a fbcode build
    3. decide by the number of CPU cores
    ÚTORCHINDUCTOR_COMPILE_THREADSÚwin32r-   Úsched_getaffinityr   é    )r[   r\   ÚintÚsysÚplatformr   r
   Úlenrf   Ú	cpu_countÚmin)rl   r   r   r   Údecide_compile_threads«  s   
ÿý
rn   )ÚparutilÚ.zfb/cacheé
   ÚTORCHINDUCTOR_SHAPE_PADDINGÚ#TORCHINDUCTOR_COMPREHENSIVE_PADDINGÚforce_shape_padÚTORCHINDUCTOR_PERMUTE_FUSIONÚTORCHINDUCTOR_PROFILEÚTORCHINDUCTOR_PROFILE_OUTPUTÚTORCHINDUCTOR_FREEZINGÚfreezingÚfreezing_discard_parametersÚTORCHINDUCTOR_STACK_ALLOCATIONÚallow_stack_allocationÚuse_minimal_arrayref_interfaceÚdecompose_mem_bound_mmÚassume_aligned_inputsc                   @   s  e Zd ZU dZej dd¡dkZej dd¡dkZdZ	e
e ed< eej dd	¡ƒZdej d
ejdkr6dnd¡fZej dd¡dkZej dd¡dkZdZe
e ed< dZe
e ed< dZe
e ed< dZeej dd¡ƒZej dd¡dkZej dd¡dkZej dd¡dkZdS )ÚcppéÿÿÿÿÚ$TORCHINDUCTOR_CPP_NO_REDUNDANT_LOOPSr   Ú!TORCHINDUCTOR_CPP_DYNAMIC_THREADSr   NÚsimdlenÚ TORCHINDUCTOR_CPP_MIN_CHUNK_SIZEÚ4096ÚCXXÚdarwinzclang++zg++Ú'TORCHINDUCTOR_CPP_ENABLE_KERNEL_PROFILEÚ TORCHINDUCTOR_CPP_WEIGHT_PREPACKÚinject_relu_bug_TESTING_ONLYÚinject_log1p_bug_TESTING_ONLYÚ
vec_isa_okÚoriginal_atenÚ,TORCHINDUCTOR_CPP_MAX_HORIZONTAL_FUSION_SIZEÚ16Ú-TORCHINDUCTOR_CPP_FALLBACK_SCATTER_REDUCE_SUMÚ-TORCHINDUCTOR_CPP_ENABLE_UNSAFE_MATH_OPT_FLAGÚ5TORCHINDUCTOR_CPP_ENABLE_FLOATING_POINT_CONTRACT_FLAG)Ú__name__Ú
__module__Ú__qualname__Úthreadsr[   r\   r]   Úno_redundant_loopsÚdynamic_threadsr„   r   rh   Ú__annotations__Úmin_chunk_sizeri   rj   ÚcxxÚenable_kernel_profileÚweight_prepackr‹   ÚstrrŒ   r   ÚboolÚdescriptive_namesÚmax_horizontal_fusion_sizeÚfallback_scatter_reduce_sumÚenable_unsafe_math_opt_flagÚ#enable_floating_point_contract_flagr   r   r   r   r€   )  s8   
 ÿúÿÿÿÿÿÿr€   c                   @   sÆ   e Zd ZU ej d¡dk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dZdZdZdZdZej d¡dkZdZej dd¡dkZeej d	d
¡ƒZdZdZdZdZ ee!d< dZ"dZ#e$e% e!d< dS )ÚtritonÚTORCHINDUCTOR_CUDAGRAPHSr   TFé   Ú!TORCHINDUCTOR_UNIQUE_KERNEL_NAMESrŽ   Ú#TORCHINDUCTOR_PERSISTENT_REDUCTIONSÚTORCHINDUCTOR_MULTI_KERNELr   é   é   Úspill_thresholdNr‹   )&r”   r•   r–   r[   r\   r]   Ú
cudagraphsÚcudagraph_treesÚcudagraph_skip_dynamic_graphsÚslow_path_cudagraph_assertsÚ!cudagraph_trees_history_recordingÚ cudagraph_support_input_mutationÚforce_cudagraph_syncÚforce_cudagraphs_warmupÚfast_path_cudagraph_assertsÚskip_cudagraph_warmupÚdebug_sync_graphÚdebug_sync_kernelÚdense_indexingÚ	max_tilesÚautotune_pointwiseÚautotune_cublasLtÚ tiling_prevents_pointwise_fusionÚ tiling_prevents_reduction_fusionÚunique_kernel_namesr¡   Úpersistent_reductionsrh   Úmulti_kernelÚdivisible_by_16Úmin_split_scan_rblockÚstore_cubinr®   rš   Úuse_block_ptrr‹   r   rŸ   r   r   r   r   r¦   q  s<   
 ÿr¦   c                   @   s^   e Zd ZU dZej dd¡dkZej dd¡dkZe	e
d< dZdZdZe	e
d< dZe	e
d	< d
S )Úaot_inductorrQ   ÚAOT_INDUCTOR_DEBUG_COMPILEr   r   Ú"AOT_INDUCTOR_DEBUG_DUMP_CONSTS_BINÚdebug_dump_consts_binFÚuse_runtime_constant_foldingÚforce_mmap_weightsN)r”   r•   r–   Úoutput_pathr[   r\   r]   Údebug_compilerË   r    rš   Úserialized_in_specÚserialized_out_specrÌ   rÍ   r   r   r   r   rÈ   á  s   
 
ÿrÈ   c                
   @   sÒ   e Zd ZU dZee ed< dZee ed< dZdZ	dZ
dZdZej dej ej ej ej¡d¡¡¡ZdZee ed< dZee ed	< d
Zeed< ej dd¡dkZeed< dZee ed< dZee ed< dS )ÚcudaNÚarchr   z-O1FÚTORCHINDUCTOR_CUTLASS_DIRz../third_party/cutlass/Úcutlass_max_profiling_configsÚcuda_cxxr-   Úcutlass_backend_min_gemm_sizeÚ/INDUCTOR_CUDA_BACKEND_GENERATE_TEST_RUNNER_CODEr   Úgenerate_test_runnerÚcutlass_op_allowlist_regexÚpingpongÚcutlass_op_denylist_regex)r”   r•   r–   rÓ   r   rŸ   rš   r   Úcompile_opt_levelÚenable_cuda_ltoÚenable_ptxas_infoÚenable_debug_infoÚuse_fast_mathr[   r\   r]   ÚpathÚabspathÚjoinÚdirnamer   Ú__file__Úcutlass_dirrÕ   rh   rÖ   r×   rÙ   r    rÚ   rÜ   r   r   r   r   rÒ   þ  s*   
 ÿþ

ÿrÒ   c                   @   s¶   e Zd ZU ej dd¡dkZdZee	 e
d< dZdZdZdZdZdZdZej dd¡dkZej d	d¡dkZej d
d¡Zej dd¡ZdZdZeee	gdf  e
d< dZee
d< dS )ÚtraceÚTORCH_COMPILE_DEBUGr   r   NÚ	debug_dirFTÚINDUCTOR_POST_FUSION_SVGÚINDUCTOR_ORIG_FX_SVGÚINDUCTOR_DOT_GRAPH_SHAPE_SVGÚ INDUCTOR_LOG_URL_FOR_GRAPH_XFORMÚ
upload_tarÚlog_autotuning_results)r”   r•   r–   r[   r\   r]   Úenabledrê   r   rŸ   rš   Ú	debug_logÚinfo_logÚfx_graphÚfx_graph_transformedÚir_pre_fusionÚir_post_fusionÚoutput_codeÚgraph_diagramÚdraw_orig_fx_graphÚdot_graph_shapeÚlog_url_for_graph_xformÚcompile_profilerï   r   rð   r    r   r   r   r   rè   H  s"   
 
rè   ztrace.upload_tar)rè   zcuda.cutlass_dirÚcompile_threads)Ú*)Úinstall_config_module)­r[   ri   Útypingr   r   r   r   r   r   r   r   r   ÚdebugÚdisable_progressÚverbose_progressr\   r]   Úfx_graph_cacheÚfx_graph_remote_cacheÚautotune_local_cacheÚautotune_remote_cacheÚforce_disable_cachesÚcpp_wrapperÚabi_compatibleÚc_shim_versionÚdceÚstatic_weight_shapesÚsize_assertsÚnan_assertsÚpick_loop_ordersÚinplace_buffersÚallow_buffer_reuseÚmemory_planningÚmemory_poolÚbenchmark_harnessÚepilogue_fusionÚepilogue_fusion_firstÚpattern_matcherr   ÚfxÚgraphÚGraphrš   r    r!   r"   r#   Úsplit_cat_fx_passesÚ efficient_conv_bn_eval_fx_passesÚis_predispatchÚgroup_fusionÚbatch_fusionr*   rŸ   r+   Úreorder_for_localityÚdynamic_scale_rblockÚforce_fuse_int_mm_with_mulÚuse_mixed_mmr2   Úforce_mixed_mmÚ reorder_for_compute_comm_overlapÚ'reorder_for_compute_comm_overlap_passesÚestimate_op_runtimeÚintra_node_bwÚinter_node_bwÚmax_autotuneÚmax_autotune_pointwiseÚmax_autotune_gemmÚforce_same_precisionÚupperÚmax_autotune_gemm_backendsÚmax_autotune_gemm_search_spaceÚautotune_fallback_to_atenÚunbacked_symint_fallbackÚsearch_autotune_cacheÚ	save_argsÚautotune_in_subprocÚ+max_autotune_subproc_result_timeout_secondsÚ-max_autotune_subproc_graceful_timeout_secondsÚ.max_autotune_subproc_terminate_timeout_secondsÚautotune_multi_deviceÚcoordinate_descent_tuningÚ'coordinate_descent_check_all_directionsrh   Ú coordinate_descent_search_radiusr   ÚhipÚlayout_opt_defaultÚlayout_optimizationÚforce_layout_optimizationÚkeep_output_strideÚwarn_mix_layoutÚrealize_reads_thresholdÚrealize_opcount_thresholdÚrealize_acc_reads_thresholdÚfallback_randomÚimplicit_fallbacksÚaggressive_fusionÚdebug_fusionÚbenchmark_fusionÚenabled_metric_tablesÚbenchmark_epilogue_fusionÚ max_epilogue_benchmarked_choicesÚmax_fusion_sizeÚmax_pointwise_cat_inputsÚunroll_reductions_thresholdÚcomment_originÚconv_1x1_as_mmÚsplit_reductionsÚbenchmark_kernelÚconstant_and_index_propagationÚalways_keep_tensor_constantsÚassert_indirect_indexingÚcompute_all_boundsÚjoint_graph_constant_foldingÚdebug_index_assertsÚ__version__Úis_nightly_or_sourceÚdeveloper_warningsr_   Úworker_start_methodÚ_fuse_ddp_communicationÚ_fuse_ddp_bucket_sizerb   rc   r    rn   rþ   Úlibfb.pyro   Ú__package__Úget_dir_pathrâ   rä   ÚreplaceÚsepÚglobal_cache_dirÚ
ValueErrorÚkernel_name_max_opsÚshape_paddingÚcomprehensive_paddingÚpad_channels_lastÚbw_outputs_user_visiblert   Úpermute_fusionÚprofiler_mark_wrapper_callÚgenerate_intermediate_hooksÚdebug_ir_tracebackÚ_raise_error_for_testingÚ_profile_varÚprofile_bandwidthÚprofile_bandwidth_regexÚprofile_bandwidth_outputÚdisable_cpp_codegenry   rz   r|   r}   r~   r   r€   r¦   rÈ   rÒ   rè   Ú_save_config_ignoreÚ_cache_config_ignore_prefixÚtorch.utils._config_typingÚtorch.utils._config_moduler   Úmodulesr”   r   r   r   r   Ú<module>   s~  
$ÿÿ   úüÿ
ÿþÿþÿÿÿÿÿÿþÿ
€ÿÿÿ
ÿHpJ?þ	