Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix ollama gpu acceleration #373924
fix ollama gpu acceleration #373924
Changes from all commits
6ad8f06
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be a good idea to replace the condition
stdenv.hostPlatform.isLinux
with(enableRocm || enableCuda)
.The replacement:
cp
was executed without any arguments to copy (there were no libraries to copy). I think that this probably happened because the copy was executed on CPU builds, and there aren't any files to copy on CPU builds (though, strangely, that would imply that there used to be GPU libraries to copy on CPU builds, since this script used to work).I'm not actually sure whether or not the CPU build does have any GPU libraries to copy, or whether my theory is at all accurate in the first place, so further testing is probably needed. See also my other comment on the topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think switching this would be good as it is more aligned to the intent of the build and isLinux feels like a hack. It may also cut down the build time.
We should test to confirm that there aren't any strange surprises.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback has been addressed (: I will test this on Nvidia and CPU (cannot test on AMD)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works on both machines! Nvidia and CPU are both good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are multiple types of CPU runners that use the same structure. A rocm + CPU build ends up with:
Official ollama releases end up with
cpu_avx cpu_avx2 cuda_v11_avx cuda_v12_avx rocm_avx
folders under runners.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so maybe we want to copy it indiscriminately then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, accel flag checking approach means CPU ollama build on this PR is missing
cpu_avx
/cpu_avx2
😅There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol I will revert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CPU build looks correct now: