mirror of
https://github.com/huggingface/candle.git
synced 2025-06-18 11:37:11 +00:00
Only support the contiguous case for cublas matmul.
This commit is contained in:
@ -275,6 +275,15 @@ impl Tensor {
|
|||||||
op: "matmul",
|
op: "matmul",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if let crate::DeviceLocation::Cuda { .. } = self.device().location() {
|
||||||
|
if !self.is_contiguous() || !rhs.is_contiguous() {
|
||||||
|
// It looks like the cublas implementation of XgemmStridedBatched only supports
|
||||||
|
// non-standard strides on the batch dimension.
|
||||||
|
return Err(Error::RequiresContiguous {
|
||||||
|
op: "matmul-cublas",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let m = a_dims[dim - 2];
|
let m = a_dims[dim - 2];
|
||||||
let k = a_dims[dim - 1];
|
let k = a_dims[dim - 1];
|
||||||
|
Reference in New Issue
Block a user