Skip to content

Commit 093dccb

Browse files
authored
Fix intel-mkl-src dependency and use static-linking in Dockerfile (#715)
1 parent 0adb000 commit 093dccb

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ serde_json = "1.0"
4242
thiserror = "1.0"
4343
rand = "0.9"
4444
serial_test = "2.0.0"
45-
cudarc = { version = "0.13" , features =["cuda-12020"], default-features = false}
46-
intel-mkl-src = { version = "0.8"}
45+
cudarc = { version = "0.13", features =["cuda-12020"], default-features = false }
46+
intel-mkl-src = { version = "0.8", default-features = false }
4747
candle = { version = "0.8", package = "candle-core" }
48-
candle-nn = { version = "0.8" }
48+
candle-nn = { version = "0.8" }
4949
candle-transformers = { version = "0.8" }
5050
candle-flash-attn = { version = "0.8" }
51-
candle-cublaslt= { version = "0.0.1" }
51+
candle-cublaslt = { version = "0.0.1" }
5252
candle-layer-norm = { version = "0.0.1" }
5353
candle-rotary = { version = "0.0.1" }
5454
candle-flash-attn-v1 = { version = "0.0.1" }

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ COPY --from=planner /usr/src/recipe.json recipe.json
4343

4444
RUN --mount=type=secret,id=actions_results_url,env=ACTIONS_RESULTS_URL \
4545
--mount=type=secret,id=actions_runtime_token,env=ACTIONS_RUNTIME_TOKEN \
46-
cargo chef cook --release --features ort,candle,mkl --no-default-features --recipe-path recipe.json && sccache -s
46+
cargo chef cook --release --features ort,candle,mkl,static-linking --no-default-features --recipe-path recipe.json && sccache -s
4747

4848
COPY backends backends
4949
COPY core core
@@ -55,7 +55,7 @@ FROM builder AS http-builder
5555

5656
RUN --mount=type=secret,id=actions_results_url,env=ACTIONS_RESULTS_URL \
5757
--mount=type=secret,id=actions_runtime_token,env=ACTIONS_RUNTIME_TOKEN \
58-
cargo build --release --bin text-embeddings-router --features ort,candle,mkl,http --no-default-features && sccache -s
58+
cargo build --release --bin text-embeddings-router --features ort,candle,mkl,static-linking,http --no-default-features && sccache -s
5959

6060
FROM builder AS grpc-builder
6161

@@ -69,7 +69,7 @@ COPY proto proto
6969

7070
RUN --mount=type=secret,id=actions_results_url,env=ACTIONS_RESULTS_URL \
7171
--mount=type=secret,id=actions_runtime_token,env=ACTIONS_RUNTIME_TOKEN \
72-
cargo build --release --bin text-embeddings-router --features ort,candle,mkl,grpc --no-default-features && sccache -s
72+
cargo build --release --bin text-embeddings-router --features ort,candle,mkl,static-linking,grpc --no-default-features && sccache -s
7373

7474
FROM debian:bookworm-slim AS base
7575

backends/candle/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ homepage.workspace = true
88
[dependencies]
99
anyhow = { workspace = true }
1010
accelerate-src = { version = "0.3.2", optional = true }
11-
intel-mkl-src = { workspace = true, optional = true }
11+
intel-mkl-src = { workspace = true, optional = true }
1212
candle = { workspace = true }
1313
candle-nn = { workspace = true }
1414
candle-transformers = { workspace = true }

router/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ default = ["candle", "http", "dynamic-linking"]
8383
http = ["dep:axum", "dep:axum-tracing-opentelemetry", "dep:base64", "dep:tower-http", "dep:utoipa", "dep:utoipa-swagger-ui"]
8484
grpc = ["metrics-exporter-prometheus/http-listener", "dep:prost", "dep:tonic", "dep:tonic-health", "dep:tonic-reflection", "dep:tonic-build", "dep:async-stream", "dep:tokio-stream"]
8585
metal = ["text-embeddings-backend/metal"]
86-
mkl = ["text-embeddings-backend/mkl"]
86+
mkl = ["text-embeddings-backend/mkl", "dep:intel-mkl-src"]
8787
accelerate = ["text-embeddings-backend/accelerate"]
8888
python = ["text-embeddings-backend/python"]
8989
ort = ["text-embeddings-backend/ort"]

0 commit comments

Comments
 (0)