From 531f23b4d092cf8df26cae963687dc8904307ae4 Mon Sep 17 00:00:00 2001 From: Laurent Mazare Date: Tue, 15 Aug 2023 10:48:57 +0100 Subject: [PATCH] Rename vec-dot to vec-ops. (#449) * Rename vec-dot to vec-ops. * Also bump the crate version. * Add a currently empty readme. --- Cargo.toml | 2 +- candle-core/Cargo.toml | 2 +- candle-core/src/cpu/kernels.rs | 14 +++++++------- candle-core/src/dtype.rs | 2 +- candle-datasets/Cargo.toml | 4 ++-- candle-datasets/README.md | 1 + candle-examples/Cargo.toml | 10 +++++----- candle-flash-attn/Cargo.toml | 6 +++--- candle-kernels/Cargo.toml | 2 +- candle-nn/Cargo.toml | 2 +- candle-pyo3/Cargo.toml | 2 +- candle-transformers/Cargo.toml | 4 ++-- candle-wasm-examples/llama2-c/Cargo.toml | 4 ++-- candle-wasm-examples/whisper/Cargo.toml | 4 ++-- 14 files changed, 30 insertions(+), 29 deletions(-) create mode 100644 candle-datasets/README.md diff --git a/Cargo.toml b/Cargo.toml index 2c11b05e..93764eeb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ exclude = [ ] [workspace.package] -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "Minimalist ML framework." repository = "https://github.com/huggingface/candle" diff --git a/candle-core/Cargo.toml b/candle-core/Cargo.toml index 090fc6d3..ca2d6651 100644 --- a/candle-core/Cargo.toml +++ b/candle-core/Cargo.toml @@ -12,7 +12,7 @@ readme = "README.md" [dependencies] accelerate-src = { workspace = true, optional = true } byteorder = { workspace = true } -candle-kernels = { path = "../candle-kernels", version = "0.1.0", optional = true } +candle-kernels = { path = "../candle-kernels", version = "0.1.1", optional = true } cudarc = { workspace = true, optional = true } gemm = { workspace = true } half = { workspace = true } diff --git a/candle-core/src/cpu/kernels.rs b/candle-core/src/cpu/kernels.rs index 517ef77b..1184f8f3 100644 --- a/candle-core/src/cpu/kernels.rs +++ b/candle-core/src/cpu/kernels.rs @@ -1,4 +1,4 @@ -pub trait VecDot: num_traits::NumAssign + Copy { +pub trait VecOps: num_traits::NumAssign + Copy { /// Dot-product of two vectors. /// /// # Safety @@ -28,7 +28,7 @@ pub trait VecDot: num_traits::NumAssign + Copy { } } -impl VecDot for f32 { +impl VecOps for f32 { #[inline(always)] unsafe fn vec_dot(lhs: *const Self, rhs: *const Self, res: *mut Self, len: usize) { super::vec_dot_f32(lhs, rhs, res, len) @@ -40,7 +40,7 @@ impl VecDot for f32 { } } -impl VecDot for half::f16 { +impl VecOps for half::f16 { #[inline(always)] unsafe fn vec_dot(lhs: *const Self, rhs: *const Self, res: *mut Self, len: usize) { let mut res_f32 = 0f32; @@ -49,10 +49,10 @@ impl VecDot for half::f16 { } } -impl VecDot for f64 {} -impl VecDot for half::bf16 {} -impl VecDot for u8 {} -impl VecDot for u32 {} +impl VecOps for f64 {} +impl VecOps for half::bf16 {} +impl VecOps for u8 {} +impl VecOps for u32 {} #[inline(always)] pub fn par_for_each(n_threads: usize, func: impl Fn(usize) + Send + Sync) { diff --git a/candle-core/src/dtype.rs b/candle-core/src/dtype.rs index 23f9ad91..7f04a653 100644 --- a/candle-core/src/dtype.rs +++ b/candle-core/src/dtype.rs @@ -62,7 +62,7 @@ pub trait WithDType: + 'static + Send + Sync - + crate::cpu::kernels::VecDot + + crate::cpu::kernels::VecOps { const DTYPE: DType; diff --git a/candle-datasets/Cargo.toml b/candle-datasets/Cargo.toml index 12169daf..25eea8ea 100644 --- a/candle-datasets/Cargo.toml +++ b/candle-datasets/Cargo.toml @@ -11,8 +11,8 @@ readme = "README.md" [dependencies] byteorder = { workspace = true } -candle = { path = "../candle-core", version = "0.1.0", package = "candle-core" } -candle-nn = { path = "../candle-nn", version = "0.1.0" } +candle = { path = "../candle-core", version = "0.1.1", package = "candle-core" } +candle-nn = { path = "../candle-nn", version = "0.1.1" } hf-hub = { workspace = true} intel-mkl-src = { workspace = true, optional = true } memmap2 = { workspace = true } diff --git a/candle-datasets/README.md b/candle-datasets/README.md new file mode 100644 index 00000000..dabcd9a3 --- /dev/null +++ b/candle-datasets/README.md @@ -0,0 +1 @@ +# candle-datasets diff --git a/candle-examples/Cargo.toml b/candle-examples/Cargo.toml index 45216a5c..e07001e4 100644 --- a/candle-examples/Cargo.toml +++ b/candle-examples/Cargo.toml @@ -11,11 +11,11 @@ readme = "README.md" [dependencies] accelerate-src = { workspace = true, optional = true } -candle = { path = "../candle-core", version = "0.1.0", package = "candle-core" } -candle-datasets = { path = "../candle-datasets", version = "0.1.0" } -candle-nn = { path = "../candle-nn", version = "0.1.0" } -candle-transformers = { path = "../candle-transformers", version = "0.1.0" } -candle-flash-attn = { path = "../candle-flash-attn", version = "0.1.0", optional = true } +candle = { path = "../candle-core", version = "0.1.1", package = "candle-core" } +candle-datasets = { path = "../candle-datasets", version = "0.1.1" } +candle-nn = { path = "../candle-nn", version = "0.1.1" } +candle-transformers = { path = "../candle-transformers", version = "0.1.1" } +candle-flash-attn = { path = "../candle-flash-attn", version = "0.1.1", optional = true } safetensors = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/candle-flash-attn/Cargo.toml b/candle-flash-attn/Cargo.toml index 8d7afa69..fc34f8fe 100644 --- a/candle-flash-attn/Cargo.toml +++ b/candle-flash-attn/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "candle-flash-attn" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "Flash attention layer for the candle ML framework." @@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0" readme = "README.md" [dependencies] -candle = { path = "../candle-core", features = ["cuda"], version = "0.1.0", package = "candle-core" } +candle = { path = "../candle-core", features = ["cuda"], version = "0.1.1", package = "candle-core" } half = { version = "2.3.1", features = ["num-traits"] } [build-dependencies] @@ -21,4 +21,4 @@ rayon = "1.7.0" [dev-dependencies] anyhow = { version = "1", features = ["backtrace"] } -candle-nn = { path = "../candle-nn", version = "0.1.0", features = ["cuda"] } +candle-nn = { path = "../candle-nn", version = "0.1.1", features = ["cuda"] } diff --git a/candle-kernels/Cargo.toml b/candle-kernels/Cargo.toml index 9978b25e..ead8c5f7 100644 --- a/candle-kernels/Cargo.toml +++ b/candle-kernels/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "candle-kernels" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "CUDA kernels for Candle" diff --git a/candle-nn/Cargo.toml b/candle-nn/Cargo.toml index 6db9ccab..35b8a9b8 100644 --- a/candle-nn/Cargo.toml +++ b/candle-nn/Cargo.toml @@ -11,7 +11,7 @@ readme = "README.md" [dependencies] accelerate-src = { workspace = true, optional = true } -candle = { path = "../candle-core", version = "0.1.0", package = "candle-core" } +candle = { path = "../candle-core", version = "0.1.1", package = "candle-core" } thiserror = { workspace = true } intel-mkl-src = { workspace = true, optional = true } safetensors = { workspace = true } diff --git a/candle-pyo3/Cargo.toml b/candle-pyo3/Cargo.toml index 89263fe0..83e1e2ba 100644 --- a/candle-pyo3/Cargo.toml +++ b/candle-pyo3/Cargo.toml @@ -15,7 +15,7 @@ crate-type = ["cdylib"] doc = false [dependencies] -candle = { path = "../candle-core", version = "0.1.0", package = "candle-core" } +candle = { path = "../candle-core", version = "0.1.1", package = "candle-core" } half = { workspace = true } pyo3 = { version = "0.19.0", features = ["extension-module"] } diff --git a/candle-transformers/Cargo.toml b/candle-transformers/Cargo.toml index 457c0776..284ef4f3 100644 --- a/candle-transformers/Cargo.toml +++ b/candle-transformers/Cargo.toml @@ -11,9 +11,9 @@ readme = "README.md" [dependencies] accelerate-src = { workspace = true, optional = true } -candle = { path = "../candle-core", version = "0.1.0", package = "candle-core" } +candle = { path = "../candle-core", version = "0.1.1", package = "candle-core" } hf-hub = { workspace = true} -candle-nn = { path = "../candle-nn", version = "0.1.0" } +candle-nn = { path = "../candle-nn", version = "0.1.1" } intel-mkl-src = { workspace = true, optional = true } tokenizers = { workspace = true, features = ["onig"] } rand = { workspace = true } diff --git a/candle-wasm-examples/llama2-c/Cargo.toml b/candle-wasm-examples/llama2-c/Cargo.toml index dab99aee..8f743088 100644 --- a/candle-wasm-examples/llama2-c/Cargo.toml +++ b/candle-wasm-examples/llama2-c/Cargo.toml @@ -9,8 +9,8 @@ categories.workspace = true license.workspace = true [dependencies] -candle = { path = "../../candle-core", version = "0.1.0", package = "candle-core" } -candle-nn = { path = "../../candle-nn", version = "0.1.0" } +candle = { path = "../../candle-core", version = "0.1.1", package = "candle-core" } +candle-nn = { path = "../../candle-nn", version = "0.1.1" } num-traits = { workspace = true } tokenizers = { workspace = true, features = ["unstable_wasm"] } diff --git a/candle-wasm-examples/whisper/Cargo.toml b/candle-wasm-examples/whisper/Cargo.toml index 86aba582..66706026 100644 --- a/candle-wasm-examples/whisper/Cargo.toml +++ b/candle-wasm-examples/whisper/Cargo.toml @@ -9,8 +9,8 @@ categories.workspace = true license.workspace = true [dependencies] -candle = { path = "../../candle-core", version = "0.1.0", package = "candle-core" } -candle-nn = { path = "../../candle-nn", version = "0.1.0" } +candle = { path = "../../candle-core", version = "0.1.1", package = "candle-core" } +candle-nn = { path = "../../candle-nn", version = "0.1.1" } num-traits = { workspace = true } tokenizers = { workspace = true, features = ["unstable_wasm"] }