Preserve image-aware sparse QSA for Qwen vision

This commit is contained in:
Georg Bauer committed 2026-10-04 14:03:12 +02:00
1 parent a8cad88100
commit dccf81971f
26 files changed
+1215 -44

No files matched your search

+4 -3
View File
@@ -1,5 +1,5 @@
//! Select, take/Gather, GatherAxis, Arange and Scan from the pinned runtime.
//! take exports BF16/F16/F32/U32 with I64 and I32 indices.
//! take exports BF16/F16/F32/I32/U32 with I64 and I32 indices.
use super::super::gpu::Buffer;
use super::array::{Array, Dtype, Layout};
use super::stream::Stream;
@@ -503,7 +503,7 @@ pub(super) fn take(table: &Array, ids: &Array, axis: i32, stream: Stream) -> Res
|| !(il.dtype() == Dtype::I64 || il.dtype() == Dtype::U32 || il.dtype() == Dtype::I32)
|| !matches!(
sl.dtype(),
Dtype::BF16 | Dtype::F16 | Dtype::F32 | Dtype::U32
Dtype::BF16 | Dtype::F16 | Dtype::F32 | Dtype::I32 | Dtype::U32
)
|| (sl.shape()[axis] == 0 && il.size() != 0)
{
@@ -551,7 +551,8 @@ fn gather_take_evaluate(
Dtype::BF16 => "bf16",
Dtype::F16 => "f16",
Dtype::F32 => "f32",
Dtype::U32 => "u32",
// Gather copies 32-bit payloads without value arithmetic.
Dtype::I32 | Dtype::U32 => "u32",
_ => unreachable!(),
};
let large = sl.size() > i32::MAX as usize