Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR updates the default LlamaCpp configuration to extend the ARM64 thread-count heuristic beyond Windows ARM64 to also cover Linux aarch64 by adjusting the platform check in NewDefaultLlamaCppConfig. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary of ChangesHello @ericcurtin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request aims to broaden the applicability of a performance heuristic within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `pkg/inference/backends/llamacpp/llamacpp_config.go:23-24` </location>
<code_context>
- // Special case for Windows ARM64
- if runtime.GOOS == "windows" && runtime.GOARCH == "arm64" {
+ // Special case for ARM64 (aarch64 on Linux)
+ if runtime.GOARCH == "aarch64" && runtime.GOARCH == "arm64" {
// Using a thread count equal to core count results in bad performance, and there seems to be little to no gain
// in going beyond core_count/2.
</code_context>
<issue_to_address>
**issue (bug_risk):** The conditional checks for both 'aarch64' and 'arm64' simultaneously, which is always false.
Update the condition to check for the correct architecture value, as only one can be true at a time.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull Request Overview
This PR extends ARM64 performance optimization from Windows-only to all ARM64 platforms by updating the architecture check condition.
- Modifies the condition to apply ARM64 thread optimization to both Linux aarch64 and other ARM64 platforms
- Updates the comment to reflect the broader platform support
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request aims to generalize a performance heuristic for ARM64 architectures. However, the conditional logic introduced contains a bug where it uses a logical AND (&&) instead of a logical OR (||), which will cause the condition to always be false. I've provided a suggestion to fix this. It would also be beneficial to update the corresponding unit tests to cover this expanded logic for all ARM64 platforms.
|
Tested on ampere system: I'm 90% sure GOARCH arm64 is aarch64 on Linux. Testing... |
doringeman
left a comment
There was a problem hiding this comment.
I see it's arm64.
$ docker run --rm -it docker.io/library/golang:1.24.7 sh -c 'arch && go env GOARCH'
aarch64
arm64
Cool, I can delete |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Should be good @doringeman removed aarch64 |
It's a decent heuristic in general for aarch64. Signed-off-by: Eric Curtin <eric.curtin@docker.com>
It's a decent heuristic in general for aarch64.
Summary by Sourcery
Enhancements: