o
    ?ß±ió  ã                   @   sL   d Z ddlZddlmZ dedeej fdd„Zdedeej fdd	„Z	dS )
z®
Imaginaire4 Attention Subpackage:
Unified implementation for all Attention implementations.

NATTEN Backend: metadata
Always safe to import (as long as torch is available.)
é    N)Úsafe_logÚarch_tagÚreturnc                 C   sF   | dk rt  d¡ g S | dv rtjtjtjtjtjgS tjtjtjgS )aM  
    Returns data type choices for forward pass according to arch tag (attention.utils.get_arch_tag).

    Parameters:
        arch_tag (int): Arch tag for the current CUDA device. Example: 80 for A100, 90 for H100.

    Returns:
        data_type_choices (list): a list of PyTorch data types. Empty if device is not supported.

    éK   úNNATTEN is not supported because compute capability is below the minimum (7.5).)éd   ég   )ÚlogÚdebugÚtorchÚfloat32Úfloat16Úbfloat16Úfloat8_e5m2Úfloat8_e4m3fn©r   © r   ú_/data/cameron/vidgen/cosmos-predict2.5/cosmos_predict2/_src/imaginaire/attention/natten/meta.pyÚget_fwd_dtypes   s   
r   c                 C   s&   | dk rt  d¡ g S tjtjtjgS )aN  
    Returns data type choices for backward pass according to arch tag (attention.utils.get_arch_tag).

    Parameters:
        arch_tag (int): Arch tag for the current CUDA device. Example: 80 for A100, 90 for H100.

    Returns:
        data_type_choices (list): a list of PyTorch data types. Empty if device is not supported.

    r   r   )r	   r
   r   r   r   r   r   r   r   r   Úget_bwd_dtypes3   s   
r   )
Ú__doc__r   Ú/cosmos_predict2._src.imaginaire.attention.utilsr   r	   ÚintÚlistÚdtyper   r   r   r   r   r   Ú<module>   s
   