SIGN IN SIGN UP

opencl: port fused ssm_scan kernel (Mamba-2, d_state in {128, 256}) to GPU (#26439)

* opencl: port fused ssm_scan kernel (Mamba-2, d_state in {128, 256})

Fold the fused per-token SSM_SCAN recurrent step from opencl/gdn-qwen36-35b
onto the unified base. Previously SSM_SCAN fell back to CPU here; now scalar-A
Mamba-2 with d_state in {128,256}, all-f32, runs on GPU. Other shapes (incl.
Mamba-1 element-wise A) still fall back. test-backend-ops -o SSM_SCAN passes on
Adreno X2-90. opt-out via GGML_OPENCL_DISABLE_SSM_SCAN=1.

* opencl: cleanup

* opencl: require K == 1

---------

Co-authored-by: Li He <lih@qti.qualcomm.com>
H
Hongqiang Wang committed
b062ba735e5e15817f6a1dbdb84717ee3097f619
Parent: cd644c3
Committed by GitHub <noreply@github.com> on 8/19/2026, 8:35:17 PM