Rename vec-dot to vec-ops. (#449)
* Rename vec-dot to vec-ops. * Also bump the crate version. * Add a currently empty readme.
This commit is contained in:
parent
495e0b7580
commit
531f23b4d0
|
@ -15,7 +15,7 @@ exclude = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Minimalist ML framework."
|
description = "Minimalist ML framework."
|
||||||
repository = "https://github.com/huggingface/candle"
|
repository = "https://github.com/huggingface/candle"
|
||||||
|
|
|
@ -12,7 +12,7 @@ readme = "README.md"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
accelerate-src = { workspace = true, optional = true }
|
accelerate-src = { workspace = true, optional = true }
|
||||||
byteorder = { workspace = 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 }
|
cudarc = { workspace = true, optional = true }
|
||||||
gemm = { workspace = true }
|
gemm = { workspace = true }
|
||||||
half = { workspace = true }
|
half = { workspace = true }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
pub trait VecDot: num_traits::NumAssign + Copy {
|
pub trait VecOps: num_traits::NumAssign + Copy {
|
||||||
/// Dot-product of two vectors.
|
/// Dot-product of two vectors.
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
|
@ -28,7 +28,7 @@ pub trait VecDot: num_traits::NumAssign + Copy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl VecDot for f32 {
|
impl VecOps for f32 {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
unsafe fn vec_dot(lhs: *const Self, rhs: *const Self, res: *mut Self, len: usize) {
|
unsafe fn vec_dot(lhs: *const Self, rhs: *const Self, res: *mut Self, len: usize) {
|
||||||
super::vec_dot_f32(lhs, rhs, res, len)
|
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)]
|
#[inline(always)]
|
||||||
unsafe fn vec_dot(lhs: *const Self, rhs: *const Self, res: *mut Self, len: usize) {
|
unsafe fn vec_dot(lhs: *const Self, rhs: *const Self, res: *mut Self, len: usize) {
|
||||||
let mut res_f32 = 0f32;
|
let mut res_f32 = 0f32;
|
||||||
|
@ -49,10 +49,10 @@ impl VecDot for half::f16 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl VecDot for f64 {}
|
impl VecOps for f64 {}
|
||||||
impl VecDot for half::bf16 {}
|
impl VecOps for half::bf16 {}
|
||||||
impl VecDot for u8 {}
|
impl VecOps for u8 {}
|
||||||
impl VecDot for u32 {}
|
impl VecOps for u32 {}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn par_for_each(n_threads: usize, func: impl Fn(usize) + Send + Sync) {
|
pub fn par_for_each(n_threads: usize, func: impl Fn(usize) + Send + Sync) {
|
||||||
|
|
|
@ -62,7 +62,7 @@ pub trait WithDType:
|
||||||
+ 'static
|
+ 'static
|
||||||
+ Send
|
+ Send
|
||||||
+ Sync
|
+ Sync
|
||||||
+ crate::cpu::kernels::VecDot
|
+ crate::cpu::kernels::VecOps
|
||||||
{
|
{
|
||||||
const DTYPE: DType;
|
const DTYPE: DType;
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ readme = "README.md"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
byteorder = { workspace = true }
|
byteorder = { workspace = true }
|
||||||
candle = { path = "../candle-core", version = "0.1.0", package = "candle-core" }
|
candle = { path = "../candle-core", version = "0.1.1", package = "candle-core" }
|
||||||
candle-nn = { path = "../candle-nn", version = "0.1.0" }
|
candle-nn = { path = "../candle-nn", version = "0.1.1" }
|
||||||
hf-hub = { workspace = true}
|
hf-hub = { workspace = true}
|
||||||
intel-mkl-src = { workspace = true, optional = true }
|
intel-mkl-src = { workspace = true, optional = true }
|
||||||
memmap2 = { workspace = true }
|
memmap2 = { workspace = true }
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
# candle-datasets
|
|
@ -11,11 +11,11 @@ readme = "README.md"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
accelerate-src = { workspace = true, optional = true }
|
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" }
|
||||||
candle-datasets = { path = "../candle-datasets", version = "0.1.0" }
|
candle-datasets = { path = "../candle-datasets", version = "0.1.1" }
|
||||||
candle-nn = { path = "../candle-nn", version = "0.1.0" }
|
candle-nn = { path = "../candle-nn", version = "0.1.1" }
|
||||||
candle-transformers = { path = "../candle-transformers", version = "0.1.0" }
|
candle-transformers = { path = "../candle-transformers", version = "0.1.1" }
|
||||||
candle-flash-attn = { path = "../candle-flash-attn", version = "0.1.0", optional = true }
|
candle-flash-attn = { path = "../candle-flash-attn", version = "0.1.1", optional = true }
|
||||||
safetensors = { workspace = true }
|
safetensors = { workspace = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "candle-flash-attn"
|
name = "candle-flash-attn"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
description = "Flash attention layer for the candle ML framework."
|
description = "Flash attention layer for the candle ML framework."
|
||||||
|
@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
||||||
[dependencies]
|
[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"] }
|
half = { version = "2.3.1", features = ["num-traits"] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
@ -21,4 +21,4 @@ rayon = "1.7.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
anyhow = { version = "1", features = ["backtrace"] }
|
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"] }
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "candle-kernels"
|
name = "candle-kernels"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
description = "CUDA kernels for Candle"
|
description = "CUDA kernels for Candle"
|
||||||
|
|
|
@ -11,7 +11,7 @@ readme = "README.md"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
accelerate-src = { workspace = true, optional = true }
|
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 }
|
thiserror = { workspace = true }
|
||||||
intel-mkl-src = { workspace = true, optional = true }
|
intel-mkl-src = { workspace = true, optional = true }
|
||||||
safetensors = { workspace = true }
|
safetensors = { workspace = true }
|
||||||
|
|
|
@ -15,7 +15,7 @@ crate-type = ["cdylib"]
|
||||||
doc = false
|
doc = false
|
||||||
|
|
||||||
[dependencies]
|
[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 }
|
half = { workspace = true }
|
||||||
pyo3 = { version = "0.19.0", features = ["extension-module"] }
|
pyo3 = { version = "0.19.0", features = ["extension-module"] }
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,9 @@ readme = "README.md"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
accelerate-src = { workspace = true, optional = true }
|
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}
|
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 }
|
intel-mkl-src = { workspace = true, optional = true }
|
||||||
tokenizers = { workspace = true, features = ["onig"] }
|
tokenizers = { workspace = true, features = ["onig"] }
|
||||||
rand = { workspace = true }
|
rand = { workspace = true }
|
||||||
|
|
|
@ -9,8 +9,8 @@ categories.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
candle = { path = "../../candle-core", version = "0.1.0", package = "candle-core" }
|
candle = { path = "../../candle-core", version = "0.1.1", package = "candle-core" }
|
||||||
candle-nn = { path = "../../candle-nn", version = "0.1.0" }
|
candle-nn = { path = "../../candle-nn", version = "0.1.1" }
|
||||||
num-traits = { workspace = true }
|
num-traits = { workspace = true }
|
||||||
tokenizers = { workspace = true, features = ["unstable_wasm"] }
|
tokenizers = { workspace = true, features = ["unstable_wasm"] }
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ categories.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
candle = { path = "../../candle-core", version = "0.1.0", package = "candle-core" }
|
candle = { path = "../../candle-core", version = "0.1.1", package = "candle-core" }
|
||||||
candle-nn = { path = "../../candle-nn", version = "0.1.0" }
|
candle-nn = { path = "../../candle-nn", version = "0.1.1" }
|
||||||
num-traits = { workspace = true }
|
num-traits = { workspace = true }
|
||||||
tokenizers = { workspace = true, features = ["unstable_wasm"] }
|
tokenizers = { workspace = true, features = ["unstable_wasm"] }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue