Skip to content

Commit e0e1f49

Browse files
author
Eric Buehler
committed
Handle noncontiguous v in naive_sdpa
1 parent d7577dd commit e0e1f49

File tree

1 file changed

+7
-1
lines changed
  • mistralrs-core/src/attention

1 file changed

+7
-1
lines changed

mistralrs-core/src/attention/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ impl Sdpa {
100100
let v = repeat_kv(v.clone(), sdpa_params.n_kv_groups)?;
101101

102102
if mask.is_some_and(|x| x.rank() == 2) || mistralrs_quant::distributed::use_nccl() {
103-
return naive_sdpa(q, &k, &v, mask, sdpa_params);
103+
return naive_sdpa(
104+
&q.contiguous()?,
105+
&k.contiguous()?,
106+
&v.contiguous()?,
107+
mask,
108+
sdpa_params,
109+
);
104110
}
105111

106112
// TODO: bench?

0 commit comments

Comments
 (0)