Skip to content

Commit

Permalink
Update cudarc to 0.12. (huggingface#2451)
Browse files Browse the repository at this point in the history
* Update cudarc to 0.12.

* Some cudnn tweaks.
  • Loading branch information
LaurentMazare authored Aug 27, 2024
1 parent fdc2622 commit aafa24e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions candle-core/src/cuda_backend/cudnn.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions candle-core/src/cuda_backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ impl Map1 for Im2Col1D {
}
}

#[allow(unused)]
struct Im2Col {
h_k: usize,
w_k: usize,
Expand All @@ -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;
Expand Down

0 comments on commit aafa24e

Please sign in to comment.