2024年2月21日 星期三

 build rustformers dockerfile

step 1: git clone https://github.com/rustformers/llm.git && git submodule update --init

step 2: cd llm && mv utils/Dockerfile .

step 3: modify dockerfile as shown below

 # Start with a rust alpine image

FROM rust:alpine3.19 as builder

# This is important, see https://github.com/rust-lang/docker-rust/issues/85

ENV RUSTFLAGS="-C target-feature=-crt-static"

# if needed, add additional dependencies here

RUN apk add --no-cache musl-dev pkgconfig openssl-dev

# set the workdir and copy the source into it

WORKDIR /app

COPY ./ /app

# do a release build

RUN cargo build --release --bin llm

RUN strip target/release/llm

step 4:  docker build -t rustformers:v1 .



 untimeError: cutlassF: no kernel found to launch!

Try to add

torch.backends.cuda.enable_mem_efficient_sdp(False)
torch.backends.cuda.enable_flash_sdp(False)

reference:

https://huggingface.co/stabilityai/stable-cascade/discussions/11