Skip to content

Docker build of Alpaca.cpp #219

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

Closed
wants to merge 2 commits into from
Closed

Docker build of Alpaca.cpp #219

wants to merge 2 commits into from

Conversation

ksylvan
Copy link

@ksylvan ksylvan commented Apr 12, 2023

Build and Run Alpaca in Docker

This bypasses the need to install and maintain local toolchains on your machine to run the optimized Alpaca models locally
and further increases access and availability of these models.

Here's the build on my Macbook Air M2:

% make DOCKER_CLI=nerdctl docker                                        
I llama.cpp build info: 
I UNAME_S:  Darwin
I UNAME_P:  arm
I UNAME_M:  arm64
I CFLAGS:   -I.              -O3 -DNDEBUG -std=c11   -fPIC -pthread -DGGML_USE_ACCELERATE
I CXXFLAGS: -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -pthread
I LDFLAGS:   -framework Accelerate
I CC:       Apple clang version 14.0.3 (clang-1403.0.22.14.1)
I CXX:      Apple clang version 14.0.3 (clang-1403.0.22.14.1)

nerdctl build --build-arg UNAME_P=arm \
                --build-arg UNAME_M=arm64 -t alpaca.cpp .
[+] Building 13.0s (11/11)                                                                                                                                                         
[+] Building 13.1s (11/11) FINISHED                                                                                                                                                
 => [internal] load .dockerignore                                                                                                                                             0.0s
 => => transferring context: 79B                                                                                                                                              0.0s
 => [internal] load build definition from Dockerfile                                                                                                                          0.0s
 => => transferring dockerfile: 392B                                                                                                                                          0.0s
 => [internal] load metadata for docker.io/library/gcc:latest                                                                                                                 7.7s
 => [auth] library/gcc:pull token for registry-1.docker.io                                                                                                                    0.0s
 => [internal] load build context                                                                                                                                             0.0s
 => => transferring context: 432B                                                                                                                                             0.0s
 => [build 1/4] FROM docker.io/library/gcc@sha256:b12d1e7c37e101fd76848570b81352fe9546dd1caad84501d58aecd8d6c21cd8                                                            0.0s
 => => resolve docker.io/library/gcc@sha256:b12d1e7c37e101fd76848570b81352fe9546dd1caad84501d58aecd8d6c21cd8                                                                  0.0s
 => CACHED [build 2/4] WORKDIR /usr/src                                                                                                                                       0.0s
 => CACHED [build 3/4] COPY . /usr/src                                                                                                                                        0.0s
 => CACHED [build 4/4] RUN make UNAME_M=arm64 UNAME_P=arm                                                                                                                     0.0s
 => CACHED [stage-1 2/2] COPY --from=build /usr/src/chat /usr/src/quantize /usr/local/bin                                                                                     0.0s
 => exporting to docker image format                                                                                                                                          5.1s
 => => exporting layers                                                                                                                                                       0.0s
 => => exporting manifest sha256:9008dd57f2d3fa021178e7e670060a5bf9d6d5dd3eb5f65b206d60a95d73c247                                                                             0.0s
 => => exporting config sha256:145343d796357dce7b0ee939f5a103213debaa50f971841237f325db7658b177                                                                               0.0s
 => => sending tarball                                                                                                                                                        5.1s
Loaded image: docker.io/library/alpaca.cpp:latest

And the run looks like this (as in the README, this is not sped up):

asciicast

@ksylvan ksylvan closed this by deleting the head repository Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant