From aafa24ed93b6b02c0f1dfb8e8289ab0abe8ddae8 Mon Sep 17 00:00:00 2001 From: Laurent Mazare Date: Tue, 27 Aug 2024 09:10:30 +0100 Subject: [PATCH] Update cudarc to 0.12. (#2451) * Update cudarc to 0.12. * Some cudnn tweaks. --- Cargo.toml | 2 +- candle-core/src/cuda_backend/cudnn.rs | 4 ++-- candle-core/src/cuda_backend/mod.rs | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index efd39165..54ae266d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ candle-onnx = { path = "./candle-onnx", version = "0.6.1" } candle-transformers = { path = "./candle-transformers", version = "0.6.1" } clap = { version = "4.2.4", features = ["derive"] } criterion = { version = "0.5.1", default-features=false } -cudarc = { version = "=0.11.6", features = ["std", "cublas", "cublaslt", "curand", "driver", "nvrtc", "f16", "cuda-version-from-build-system", "dynamic-linking"], default-features=false } +cudarc = { version = "0.12.0", features = ["std", "cublas", "cublaslt", "curand", "driver", "nvrtc", "f16", "cuda-version-from-build-system", "dynamic-linking"], default-features=false } fancy-regex = "0.13.0" gemm = { version = "0.17.0", features = ["wasm-simd128-enable"] } hf-hub = "0.3.0" diff --git a/candle-core/src/cuda_backend/cudnn.rs b/candle-core/src/cuda_backend/cudnn.rs index 0c149cd0..d604863d 100644 --- a/candle-core/src/cuda_backend/cudnn.rs +++ b/candle-core/src/cuda_backend/cudnn.rs @@ -1,6 +1,6 @@ use crate::WithDType; use cudarc; -use cudarc::cudnn::safe::{Conv2dForward, Cudnn}; +use cudarc::cudnn::safe::{ConvForward, Cudnn}; use cudarc::driver::{CudaSlice, CudaView, DeviceRepr, ValidAsZeroBits}; use std::cell::RefCell; use std::collections::HashMap; @@ -87,7 +87,7 @@ pub(crate) fn launch_conv2d< cudarc::cudnn::sys::cudnnTensorFormat_t::CUDNN_TENSOR_NCHW, [params.b_size as i32, params.c_out as i32, h_out, w_out], )?; - let conv2d = Conv2dForward { + let conv2d = ConvForward { conv: &conv, x: &x, w: &w, diff --git a/candle-core/src/cuda_backend/mod.rs b/candle-core/src/cuda_backend/mod.rs index 7edad3d4..07bb1785 100644 --- a/candle-core/src/cuda_backend/mod.rs +++ b/candle-core/src/cuda_backend/mod.rs @@ -174,6 +174,7 @@ impl Map1 for Im2Col1D { } } +#[allow(unused)] struct Im2Col { h_k: usize, w_k: usize, @@ -183,6 +184,7 @@ struct Im2Col { } impl Im2Col { + #[allow(unused)] fn hw_out(&self, h: usize, w: usize) -> (usize, usize) { let h_out = (h + 2 * self.padding - self.dilation * (self.h_k - 1) - 1) / self.stride + 1; let w_out = (w + 2 * self.padding - self.dilation * (self.w_k - 1) - 1) / self.stride + 1;