o
    )ip
                     @   s|   d dl mZ d dlZddlmZmZmZmZmZ ddl	m
Z
 ddlmZ deeef fdd	Zd
d Zedkr<e  dS dS )    )DictN   )__version___cpp_lib_is_opensource_is_triton_availableops)OPERATORS_REGISTRY)DCGM_PROFILER_AVAILABLEreturnc                  C   sl   i } t D ]}| rdnd}|| |j d|j < qtj  D ]\}}|| d| < q!tt	 | d< | S )N	availableunavailable.zswiglu.Zis_triton_available)
r	   is_availableZOPERATOR_CATEGORYNAMEr   Z	swiglu_op_infoitemsstrr   )featuresopZ
status_strkv r   Y/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/xformers/info.pyget_features_status   s   r   c               	   C   s  t  } tdt  tj| d< tj r8d| d< tj }tj|}ddd |D | d< tj	|| d	< nd
| d< t
r@dnd| d< tj}|d u rVttjtjrVtjj}|d urd| d< |j| d< |j| d< |j| d< |j| d< |j D ]\}}|| d| < qwnd| d< zddd tjj D | d< W n ttfy   Y nw trd| d< nd| d< |  D ]\}}td| d| qd S )Nz	xFormers zpytorch.versionr   zpytorch.cudar   c                 s       | ]}t |V  qd S Nr   ).0verr   r   r   	<genexpr>#   s    zprint_info.<locals>.<genexpr>zgpu.compute_capabilityzgpu.nameznot availabler   Zdcgm_profilerz
build.infozbuild.cuda_versionzbuild.hip_versionzbuild.python_versionzbuild.torch_versionz
build.env.nonec                 s   r   r   r   )r   r   r   r   r   r    =   s    
zbuild.nvcc_versionzopen sourcezsource.privacyZfairinternalz	{:<50} {}:)r   printr   torchcudar   Zcurrent_deviceZget_device_capabilityjoinZget_device_namer
   r   Z_build_metadata
isinstanceZ_cpp_library_load_exceptionZxFormersInvalidLibException
build_infoZcuda_versionZhip_versionpython_versionZtorch_version	build_envr   r   ZxformersZ_nvcc_build_versionRuntimeErrorAttributeErrorr   format)r   Zdevicecapr(   r   r   namestatusr   r   r   
print_info   sP   











r1   __main__)typingr   r$    r   r   r   r   r   Z
ops.commonr	   Zprofiler.profiler_dcgmr
   r   r   r1   __name__r   r   r   r   <module>   s   1
