Skip to content

Commit 7b8becb

Browse files
committed
Two more block-manager lints
1 parent cc3b4c7 commit 7b8becb

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lib/llm/src/block_manager/block/transfer/cuda.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,10 @@ unsafe fn cuda_memcpy_d2d(
225225
"Source and destination device memory regions must not overlap for D2D copy"
226226
);
227227

228-
cuda_result::memcpy_dtod_async(dst_ptr as u64, src_ptr as u64, size, stream.cu_stream())
229-
.map_err(|e| TransferError::ExecutionError(format!("CUDA D2D memcpy failed: {}", e)))?;
228+
unsafe {
229+
cuda_result::memcpy_dtod_async(dst_ptr as u64, src_ptr as u64, size, stream.cu_stream())
230+
.map_err(|e| TransferError::ExecutionError(format!("CUDA D2D memcpy failed: {}", e)))?
231+
};
230232
Ok(())
231233
}
232234

lib/llm/src/block_manager/connector/protocol.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ impl TransferCompletionHandle for ScheduledTransferCompletionHandle {
194194
}
195195

196196
async fn mark_complete(&self, result: anyhow::Result<()>) {
197-
if let Some(completion_tx) = self.completion_tx.lock().unwrap().take() {
198-
if completion_tx.send(result).is_err() {
199-
tracing::error!(
200-
"failed to send completion status; this could lead to silent data corruption"
201-
);
202-
}
197+
if let Some(completion_tx) = self.completion_tx.lock().unwrap().take()
198+
&& completion_tx.send(result).is_err()
199+
{
200+
tracing::error!(
201+
"failed to send completion status; this could lead to silent data corruption"
202+
);
203203
}
204204
}
205205
}

0 commit comments

Comments
 (0)