Skip to content
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

ramalama container: Make it possible to build basic container on all RHEL architectures #722

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

jcajka
Copy link
Contributor

@jcajka jcajka commented Feb 3, 2025

Make it possible to build ramalama container on all RHEL arches.

Summary by Sourcery

Build:

  • Add support for building the ramalama container on multiple architectures by conditionally installing dependencies based on the architecture.

Copy link
Contributor

sourcery-ai bot commented Feb 3, 2025

Reviewer's Guide by Sourcery

This pull request enables building the ramalama container on all RHEL architectures by adding support for OpenBLAS when the architecture is not x86_64 or aarch64. Additionally, the platform detection logic was updated to use the container manager to determine the platform.

Flow diagram for container build architecture selection

graph TD
    A[Start Build] --> B{Check Architecture}
    B -->|x86_64 or aarch64| C[Install Vulkan Dependencies]
    B -->|Other architectures| D[Install OpenBLAS Dependencies]
    C --> E[Build with Kompute]
    D --> F[Build with OpenBLAS]
    E --> G[Final Container]
    F --> G
Loading

File-Level Changes

Change Details Files
Added support for OpenBLAS for non-x86_64 and non-aarch64 architectures.
  • Added openblas-devel to the list of packages to install for non-x86_64 and non-aarch64 architectures.
  • Added logic to enable GGML_BLAS and set the BLAS vendor to OpenBLAS when the architecture is not x86_64 or aarch64.
container-images/scripts/build_llama_and_whisper.sh
Updated platform detection logic to use the container manager.
  • The platform is now determined by querying the container manager (podman or docker) instead of relying on uname.
  • The logic now uses the container manager to determine the platform.
container_build.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jcajka - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please expand the PR description to specify which RHEL architectures are now supported and explain the different build approaches used (Kompute for x86_64/aarch64 vs OpenBLAS for others).
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

container_build.sh Outdated Show resolved Hide resolved
@ericcurtin
Copy link
Collaborator

Could you describe what OpenBlas give us that it's only applicable to ppc and s390? Worth putting in the commit message also

@rhatdan
Copy link
Member

rhatdan commented Feb 4, 2025

This PR needs a rebase.

@jcajka
Copy link
Contributor Author

jcajka commented Feb 4, 2025

Could you describe what OpenBlas give us that it's only applicable to ppc and s390? Worth putting in the commit message also

Feels kind of nitpicky, arbitrary. Why are you using kompute instead of naive CPU backends?

@ericcurtin
Copy link
Collaborator

ericcurtin commented Feb 4, 2025

Could you describe what OpenBlas give us that it's only applicable to ppc and s390? Worth putting in the commit message also

Feels kind of nitpickym, arbitrary. Why are you using kompute instead of naive CPU backends?

It's ok, don't let it block you, just curious. Know nothing about OpenBlas personally.

For the generic RamaLama container, the intent is that it is used for CPU based inferencing or used as a generic GPU backend. The most generic GPU API around is probably Vulkan, there are two Vulkan backends available for llama.cpp. One enabled via GGML_VULKAN=ON (this is probably more popular), the other enabled via GGML_KOMPUTE=ON

One of the gpu's we use this for is the one exposed via krunkit on podman-machine on macOS. @slp has had great joy using kompute there.

If it felt nitpicky I apologise. I am curious what are the advantages of this backend over the other. It's good that we give people choice over backends.

@ericcurtin ericcurtin merged commit 3fdcae1 into containers:main Feb 4, 2025
13 checks passed
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.

3 participants