summaryrefslogtreecommitdiff
path: root/candle-metal-kernels
diff options
context:
space:
mode:
authorFL33TW00D <chris@fleetwood.dev>2024-01-19 09:35:42 +0000
committerFL33TW00D <chris@fleetwood.dev>2024-01-19 09:35:42 +0000
commit73d79e609226cbe5def96726f8a1896cf4b3dc5d (patch)
treece6386fe8e85c14b817e985b79adedb8ffd143be /candle-metal-kernels
parentb1879f17f6b9d13e101a4d3ff5b6b4ff2e1a7a24 (diff)
downloadcandle-73d79e609226cbe5def96726f8a1896cf4b3dc5d.tar.gz
candle-73d79e609226cbe5def96726f8a1896cf4b3dc5d.tar.bz2
candle-73d79e609226cbe5def96726f8a1896cf4b3dc5d.zip
chore: actual fix
Diffstat (limited to 'candle-metal-kernels')
-rw-r--r--candle-metal-kernels/src/lib.rs5
-rw-r--r--candle-metal-kernels/src/libMetalFlashAttention.metallibbin102760 -> 116168 bytes
2 files changed, 3 insertions, 2 deletions
diff --git a/candle-metal-kernels/src/lib.rs b/candle-metal-kernels/src/lib.rs
index 8cb3c16a..4c0f9223 100644
--- a/candle-metal-kernels/src/lib.rs
+++ b/candle-metal-kernels/src/lib.rs
@@ -1369,11 +1369,12 @@ pub fn call_gemm(
}
let matrix_offsets = device.new_buffer_with_data(
- buffer.as_ptr() as *const NSUInteger as *const c_void,
+ buffer.as_ptr() as *const c_void,
(buffer.len() * core::mem::size_of::<u64>()) as NSUInteger,
- MTLResourceOptions::StorageModePrivate,
+ MTLResourceOptions::StorageModeManaged,
);
encoder.set_buffer(10, Some(&matrix_offsets), 0);
+ encoder.use_resource(&matrix_offsets, metal::MTLResourceUsage::Read);
}
let grid_size = MTLSize {
diff --git a/candle-metal-kernels/src/libMetalFlashAttention.metallib b/candle-metal-kernels/src/libMetalFlashAttention.metallib
index f5116ca6..5ed9d033 100644
--- a/candle-metal-kernels/src/libMetalFlashAttention.metallib
+++ b/candle-metal-kernels/src/libMetalFlashAttention.metallib
Binary files differ