Skip to content

devops : only build some specific targets for full image #9218

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 3 commits into from

Conversation

ngxson
Copy link
Collaborator

@ngxson ngxson commented Aug 28, 2024

Normally, the docker full-* image tag build all the targets. However, the entrypoint tools.sh only handle 3 tools: cli, server and quantize

This makes the build very wasteful, since most of the build time and storage space ended up not being used. Some CI run also breaks due to out of space (ref: https://github.com/ggerganov/llama.cpp/actions/runs/10584764326/job/29329766919)

This PR fixes the issue by only build targets used by tools.sh

@ngxson ngxson requested a review from ggerganov August 28, 2024 09:44
@ggerganov
Copy link
Member

AFAIU #9213 should reduce the build size dramatically because of linking ggml and llama dynamically.

@github-actions github-actions bot added the devops improvements to build systems and github actions label Aug 28, 2024
@mofosyne mofosyne added the Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix label Aug 30, 2024
@ngxson
Copy link
Collaborator Author

ngxson commented Aug 30, 2024

@ggerganov @slaren The current dockerfile introduced in #9213 only build llama-cli target for full-cuda image. I added llama-quantize and llama-server as required by tools.sh

Please let me know if this is OK. Thank you.

@slaren
Copy link
Member

slaren commented Aug 30, 2024

That was a mistake, I forgot to remove the --target.

@ngxson
Copy link
Collaborator Author

ngxson commented Aug 30, 2024

@slaren No problem! In fact, I just want to ask if it's ok to build only these 3 targets for full image (that's contrary to what you wanted to do, which is to build all binaries by removing --target)

For now, tools.sh does not provide entrypoint for other binaries like llama-bench or llama-perplexity. So, user can't access them without overriding --entrypoint in the docker run command. I'm not sure if anyone does that, though.

@slaren
Copy link
Member

slaren commented Aug 30, 2024

I have no idea who uses the full image, however with dynamic linking each executable should be <1MB, and building all of them will only increase the size of the image slightly (in my local build, the entire bin directory of a full build is only 32MB). Considering that the image is ~10GB, I don't see a good reason to not just build everything, even if only to avoid breaking it for people who depend on that.

@ngxson
Copy link
Collaborator Author

ngxson commented Aug 30, 2024

@slaren Hmm ok that makes sense. I think the better way would be to provide entrypoint to other tools via tools.sh. I'll do that in another PR then. Thanks for the response!

Maybe we should also bring dynamic link to full-rocm and full image.

@ngxson ngxson closed this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops improvements to build systems and github actions Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants