---
title: minimax_h3_vsa_simd
---

<div class="python-reference">
<a id="fastvideo.mlx_runtime.minimax_h3_vsa_simd-functions"></a>
<a id="fastvideo.mlx_runtime.minimax_h3_vsa_simd"></a>
<p>SIMD-group block-sparse attention for MiniMax H3 VSA.</p>
<p>This backend supports tile sizes 64 and 128 and head dimension 128, evaluates the tile map selected by the reference router, and leaves
unsupported shapes to the reference implementation.</p>
<h2 id="fastvideo.mlx_runtime.minimax_h3_vsa_simd.simd_kernel_error"><code>fastvideo.mlx_runtime.minimax_h3_vsa_simd.simd_kernel_error</code></h2>
<pre class="doc-signature"><code>simd_kernel_error() -&gt; str | None</code></pre>

<details><summary>Source</summary><pre><code>def simd_kernel_error() -&gt; str | None:
    _simd_kernel()
    return _SIMD_KERNEL_ERROR</code></pre></details>
<h2 id="fastvideo.mlx_runtime.minimax_h3_vsa_simd.disable_simd_kernel"><code>fastvideo.mlx_runtime.minimax_h3_vsa_simd.disable_simd_kernel</code></h2>
<pre class="doc-signature"><code>disable_simd_kernel(error: Exception) -&gt; None</code></pre>
<p>Remember a failed compile or execution so subsequent blocks use reference.</p>
<details><summary>Source</summary><pre><code>def disable_simd_kernel(error: Exception) -&gt; None:
    &quot;&quot;&quot;Remember a failed compile or execution so subsequent blocks use reference.&quot;&quot;&quot;
    global _SIMD_KERNEL, _SIMD_KERNEL_ERROR
    _SIMD_KERNEL_ERROR = str(error)
    _SIMD_KERNEL = None</code></pre></details>
<h2 id="fastvideo.mlx_runtime.minimax_h3_vsa_simd.simd_kernel_available"><code>fastvideo.mlx_runtime.minimax_h3_vsa_simd.simd_kernel_available</code></h2>
<pre class="doc-signature"><code>simd_kernel_available() -&gt; bool</code></pre>

<details><summary>Source</summary><pre><code>def simd_kernel_available() -&gt; bool:
    return _simd_kernel() is not None</code></pre></details>
<h2 id="fastvideo.mlx_runtime.minimax_h3_vsa_simd.simd_block_sparse"><code>fastvideo.mlx_runtime.minimax_h3_vsa_simd.simd_block_sparse</code></h2>
<pre class="doc-signature"><code>simd_block_sparse(q_tiled, k_tiled, v_tiled, block_idx, block_num, geometry, scale: float)</code></pre>
<p>Block-sparse attention over tiled <code>[S, H, D]</code> using the reference tile map.</p>
<details><summary>Source</summary><pre><code>def simd_block_sparse(
    q_tiled,
    k_tiled,
    v_tiled,
    block_idx,
    block_num,
    geometry,
    scale: float,
):
    &quot;&quot;&quot;Block-sparse attention over tiled ``&#91;S, H, D&#93;`` using the reference tile map.&quot;&quot;&quot;

    kernel = _simd_kernel()
    if kernel is None:
        raise RuntimeError(_SIMD_KERNEL_ERROR or &quot;SIMD-group VSA kernel is unavailable&quot;)
    return _launch_simd_block_sparse(kernel, q_tiled, k_tiled, v_tiled, block_idx, block_num, geometry, scale)</code></pre></details>
</div>
