o
    vij                     @   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.

cuDNN Backend: metadata
Always safe to import (as long as torch is available.)
    N)safe_logarch_tagreturnc                 C   s4   | dk rt d g S t d| d 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.

    P   zWcuDNN Attention is not supported because compute capability is below the minimum (8.0).z9cuDNN Attention only supports FP16 and BF16 for arch_tag=.)logdebugtorchfloat16bfloat16r    r   X/data/cameron/vidgen/cosmos-policy/cosmos_policy/_src/imaginaire/attention/cudnn/meta.pyget_fwd_dtypes   s
   
r   c                 C   s   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   get_bwd_dtypes3   s   r   )
__doc__r	   -cosmos_policy._src.imaginaire.attention.utilsr   r   intlistdtyper   r   r   r   r   r   <module>   s
   