§
    Û×jo  ã                   ó6   — d Z ddgZdadZead„ Zd„ Zd„ Zd„ Zd	S )
a™  Policy for optional kernel optimizations.
Precision: "strict" keeps kernels whose error against a high-precision reference is no larger than PyTorch's (bit identity not
required); "fast" adds kernels that trade precision for speed.
Families: the INT8 Math Kernels choice also orders the kernel families of the other fused operations. The selected family comes first;
when it has no kernel for an operation, or that kernel is unavailable or excluded by the precision, the operation behaves as with Auto
(RANKING). Auto and Disabled (PyTorch INT8 linears) use RANKING. WanGP's own Triton kernels take the WGPKernels slot of an operation
that has no WGPKernels kernel.)zPreserve PrecisionÚstrict)z Allow Faster Approximate KernelsÚfastr   )Ú
wgpkernelsÚkitchenÚtritonÚpytorchc                 ó€   ‡ — ‰ t           d d…         v r$‰ ft          ˆ fd„t           D ¦   «         ¦  «        z   nt           ad S )Né   c              3   ó(   •K  — | ]}|‰k    ¯|V — Œd S )N© )Ú.0ÚfamilyÚ	selections     €úDC:\Users\johnn\OneDrive\Documents\AI\shared\kernels\kernel_policy.pyú	<genexpr>z%configure_families.<locals>.<genexpr>   s-   øè è € Ð#XÐ#X¨vÀFÈiÒDWÐDW FÐDWÐDWÐDWÐDWÐ#XÐ#Xó    )ÚRANKINGÚtupleÚfamilies)r   s   `r   Úconfigure_familiesr      sQ   ø€ à\eÕipÐqsÐrsÐqsÔitÐ\tÐ\t�	ˆ|�eÐ#XÐ#XÐ#XÐ#X½Ð#XÑ#XÔ#XÑXÔXÑXÐXõ  {B€H€H€Hr   c                 óL   — t           D ]}|                      |¦  «        r|c S ŒdS )zUThe preferred family among candidates ({family: usable}), or None (the PyTorch path).N)r   Úget)Ú
candidatesr   s     r   Úfirstr      s8   € åð ð ˆØ�>Š>˜&Ñ!Ô!ð 	ØˆMˆMˆMð	àˆ4r   c                 ó6   — | dvrt          d| ›�¦  «        ‚| ad S )N)r   r   z#Unknown non-INT8 kernel precision: )Ú
ValueErrorÚ	precision)Úvalues    r   Ú	configurer      s.   € àÐ&Ð&Ð&ÝÐH¸uÐHÐHÑIÔIÐIØ€I€I€Ir   c                  ó   — t           dk    S )Nr   )r   r   r   r   Úallow_approximater    %   s   € Ý˜ÒÐr   N)	Ú__doc__ÚCHOICESr   r   r   r   r   r   r    r   r   r   ú<module>r#      st   ðð"ð "ð ,Ð-YÐ
Z€Ø€	Ø
8€Ø€ðBð Bð Bð
ð ð ðð ð ðð ð ð ð r   