From 491ed9e11d23debe366a45783dd805825210bfe6 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Tue, 4 Mar 2025 18:07:33 +0100 Subject: [PATCH] Patch rust release. (#3069) * Patch rust release. * Trying to remove the rust-toolchain hardcoded in action. * Upgrade rust toolchain. * Put back the toolchain ? * Fix neuron dockerfile. * Move to the proper version of Rust. * 1.85 since the GH action doesn't respect the override. * Typo. * Fixing the github action. * Fixing docker llamacpp. * Fixing the github action. * Update clippy. --- .github/workflows/tests.yaml | 9 ++------- Dockerfile | 2 +- Dockerfile_amd | 2 +- Dockerfile_gaudi | 2 +- Dockerfile_intel | 2 +- Dockerfile_llamacpp | 2 +- Dockerfile_trtllm | 2 +- router/src/lib.rs | 4 ++-- router/src/server.rs | 2 +- rust-toolchain.toml | 6 +++--- 10 files changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f9ccb8420..f8c17dc78 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -20,19 +20,14 @@ jobs: runs-on: group: aws-highmemory-32-plus-priv steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 id: python with: python-version: 3.11 - - name: Install Rust - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@1.85.0 with: - # Released on: 02 May, 2024 - # https://releases.rs/docs/1.78.0/ - toolchain: 1.84.0 - override: true components: rustfmt, clippy - name: Install Protoc uses: arduino/setup-protoc@v1 diff --git a/Dockerfile b/Dockerfile index 2d769c153..fb87968a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Rust builder -FROM lukemathwalker/cargo-chef:latest-rust-1.84.0 AS chef +FROM lukemathwalker/cargo-chef:latest-rust-1.85.0 AS chef WORKDIR /usr/src ARG CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse diff --git a/Dockerfile_amd b/Dockerfile_amd index f95f3b6d6..9d035c2df 100644 --- a/Dockerfile_amd +++ b/Dockerfile_amd @@ -1,5 +1,5 @@ # Rust builder -FROM lukemathwalker/cargo-chef:latest-rust-1.84.0 AS chef +FROM lukemathwalker/cargo-chef:latest-rust-1.85.0 AS chef WORKDIR /usr/src ARG CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse diff --git a/Dockerfile_gaudi b/Dockerfile_gaudi index 91b172ed7..6d37c6ae5 100644 --- a/Dockerfile_gaudi +++ b/Dockerfile_gaudi @@ -3,7 +3,7 @@ ARG HABANA_VERSION ARG PYTORCH_VERSION # Rust builder -FROM lukemathwalker/cargo-chef:latest-rust-1.80 AS chef +FROM lukemathwalker/cargo-chef:latest-rust-1.85.0 AS chef WORKDIR /usr/src ARG CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse diff --git a/Dockerfile_intel b/Dockerfile_intel index 134a6f661..bdff02908 100644 --- a/Dockerfile_intel +++ b/Dockerfile_intel @@ -1,6 +1,6 @@ ARG PLATFORM=xpu -FROM lukemathwalker/cargo-chef:latest-rust-1.84.0 AS chef +FROM lukemathwalker/cargo-chef:latest-rust-1.85.0 AS chef WORKDIR /usr/src ARG CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse diff --git a/Dockerfile_llamacpp b/Dockerfile_llamacpp index 2eb62a1f6..1f55cf829 100644 --- a/Dockerfile_llamacpp +++ b/Dockerfile_llamacpp @@ -36,7 +36,7 @@ RUN tar -xzf ${llamacpp_version}.tar.gz \ WORKDIR /app COPY rust-toolchain.toml rust-toolchain.toml -RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none +RUN curl -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain 1.85.0 --profile minimal -y ENV PATH="/root/.cargo/bin:$PATH" RUN cargo install cargo-chef --locked diff --git a/Dockerfile_trtllm b/Dockerfile_trtllm index 14a74c00b..d099ec875 100644 --- a/Dockerfile_trtllm +++ b/Dockerfile_trtllm @@ -71,7 +71,7 @@ ARG actions_runtime_token # Install Rust ENV PATH="/root/.cargo/bin:$PATH" -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y && \ +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.85.0 --profile minimal -y && \ chmod -R a+w /root/.rustup && \ chmod -R a+w /root/.cargo && \ cargo install sccache --locked diff --git a/router/src/lib.rs b/router/src/lib.rs index e8c875a8f..637e6c56e 100644 --- a/router/src/lib.rs +++ b/router/src/lib.rs @@ -947,7 +947,7 @@ impl ChatRequest { let stop = stop.unwrap_or_default(); // enable greedy only when temperature is 0 let (do_sample, temperature) = match temperature { - Some(temperature) if temperature == 0.0 => (false, None), + Some(0.0) => (false, None), other => (true, other), }; @@ -1010,7 +1010,7 @@ impl ChatRequest { seed, top_n_tokens: top_logprobs, grammar, - adapter_id: model.filter(|m| *m != "tgi").map(String::from), + adapter_id: model.filter(|m| *m != "tgi"), }, }, using_tools, diff --git a/router/src/server.rs b/router/src/server.rs index c566cf982..da3daa3ee 100644 --- a/router/src/server.rs +++ b/router/src/server.rs @@ -723,7 +723,7 @@ pub(crate) async fn completions( let stop = stop.unwrap_or_default(); // enable greedy only when temperature is 0 let (do_sample, temperature) = match temperature { - Some(temperature) if temperature == 0.0 => (false, None), + Some(0.0) => (false, None), other => (true, other), }; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 65f01fa52..8e51cc692 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -# Released on: June 13, 2024 -# https://releases.rs/docs/1.79.0/ -channel = "1.84.1" +# Released on: 30 January, 2025 +# https://releases.rs/docs/1.84.1/ +channel = "1.85.0" components = ["rustfmt", "clippy"]