Skip to content

Upgrade candle2 #543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

- name: Initialize Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "candle-extensions/candle-flash-attn-v1/cutlass"]
path = candle-extensions/candle-flash-attn-v1/cutlass
url = https://github.com/NVIDIA/cutlass.git
74 changes: 60 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ members = [
"backends/python",
"backends/grpc-client",
"candle-extensions/candle-cublaslt",
"candle-extensions/candle-flash-attn-v1",
"candle-extensions/candle-layer-norm",
"candle-extensions/candle-rotary",
"core",
"router",
]
Expand Down Expand Up @@ -49,13 +52,7 @@ candle = { git = "https://github.com/OlivierDehaene/candle", rev = "7e02ad856104
candle-nn = { git = "https://github.com/OlivierDehaene/candle", rev = "7e02ad856104799b73a946ac1e153f0de77feaaf", package = "candle-nn" }
candle-transformers = { git = "https://github.com/OlivierDehaene/candle", rev = "7e02ad856104799b73a946ac1e153f0de77feaaf", package = "candle-transformers" }
candle-flash-attn = { git = "https://github.com/OlivierDehaene/candle", rev = "7e02ad856104799b73a946ac1e153f0de77feaaf", package = "candle-flash-attn" }


[patch.crates-io]
candle = { git = "https://github.com/OlivierDehaene/candle", rev = "7e02ad856104799b73a946ac1e153f0de77feaaf", package = "candle-core" }
candle-nn = { git = "https://github.com/OlivierDehaene/candle", rev = "7e02ad856104799b73a946ac1e153f0de77feaaf", package = "candle-nn" }
candle-transformers = { git = "https://github.com/OlivierDehaene/candle", rev = "7e02ad856104799b73a946ac1e153f0de77feaaf", package = "candle-transformers" }
candle-flash-attn = { git = "https://github.com/OlivierDehaene/candle", rev = "7e02ad856104799b73a946ac1e153f0de77feaaf", package = "candle-flash-attn" }
half = { version = "2.3.1", features = ["num-traits"] }

[profile.release]
debug = 0
Expand Down
15 changes: 7 additions & 8 deletions backends/candle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ homepage.workspace = true
anyhow = { workspace = true }
accelerate-src = { version = "0.3.2", optional = true }
intel-mkl-src = { version = "0.8.1", optional = true }
candle = { version = "*", package = "candle-core", default-features = false }
candle-nn = { version = "*" }
candle-transformers = { version = "*" }
candle-flash-attn = { version = "*", optional = true }
candle-flash-attn-v1 = { git = "https://github.com/huggingface/candle-flash-attn-v1", rev = "3f1870b0d708579904c76e41745c659c3f9fa038", optional = true }
# candle-cublaslt = { git = "https://github.com/huggingface/candle-cublaslt", rev = "cf789b7dd6d4abb19b03b9556442f94f0588b4a0", optional = true }
candle = { workspace = true }
candle-nn = { workspace = true }
candle-transformers = { workspace = true }
candle-flash-attn = { workspace = true, optional = true}
candle-flash-attn-v1 = { path = "../../candle-extensions/candle-flash-attn-v1", optional = true }
candle-cublaslt = { path = "../../candle-extensions/candle-cublaslt", optional = true }
candle-layer-norm = { git = "https://github.com/huggingface/candle-layer-norm", rev = "94c2add7d94c2d63aebde77f7534614e04dbaea1", optional = true }
candle-rotary = { git = "https://github.com/huggingface/candle-rotary", rev = "0a718a0856569a92f3112e64f10d07e4447822e8", optional = true }
candle-layer-norm = { path = "../../candle-extensions/candle-layer-norm", optional = true }
candle-rotary = { path = "../../candle-extensions/candle-rotary", optional = true }
nohash-hasher = { workspace = true }
text-embeddings-backend-core = { path = "../core" }
tracing = { workspace = true }
Expand Down
3 changes: 1 addition & 2 deletions candle-extensions/candle-cublaslt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ edition = "2021"
description = "CUBLASLt gemm for the candle ML framework."

[dependencies]
# candle = { version = "0.8", package = "candle-core", features = ["cuda"]}
candle = { workspace=true, features = ["cuda"]}
cudarc = { workspace = true, features = [ "cublaslt", "f16" ]}
half = { version = "2.3.1", features = ["num-traits"] }
half = { workspace = true}

[features]
static-linking = ["cudarc/static-linking"]
3 changes: 3 additions & 0 deletions candle-extensions/candle-flash-attn-v1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
target
Cargo.lock
3 changes: 3 additions & 0 deletions candle-extensions/candle-flash-attn-v1/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "cutlass"]
path = cutlass
url = https://github.com/NVIDIA/cutlass.git
23 changes: 23 additions & 0 deletions candle-extensions/candle-flash-attn-v1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "candle-flash-attn-v1"
version = "0.0.1"
edition = "2021"

description = "Flash attention V1 layer for the candle ML framework."
keywords = ["blas", "tensor", "machine-learning"]
categories = ["science"]
license = "MIT OR Apache-2.0"
readme = "README.md"

[dependencies]
candle = { workspace = true }
half = { workspace = true }

[build-dependencies]
anyhow = { version = "1", features = ["backtrace"] }
num_cpus = "1.15.0"
rayon = "1.7.0"

[dev-dependencies]
anyhow = { version = "1", features = ["backtrace"] }
candle-nn = { version = "0.3.0", features = ["cuda"] }
Loading
Loading