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

vulkan: multithread pipeline creation #963

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

jeffbolznv
Copy link
Contributor

No description provided.

@MaggotHATE
Copy link

Thank you! It works, shortens startup greatly. Though, does it suppose to use CPU and not GPU?

MaggotHATE added a commit to MaggotHATE/Llama_chat that referenced this pull request Sep 19, 2024
* ggerganov/ggml#963
* If both `ggml-vulkan-shaders.cpp` and `ggml-vulkan-shaders.hpp` exist, `shaders-gen` will be skipped
* Latest commits from llama.cpp
@jeffbolznv
Copy link
Contributor Author

Thank you! It works, shortens startup greatly. Though, does it suppose to use CPU and not GPU?

All compiles occur on the CPU, this just uses multiple threads to do them in parallel.

@jeffbolznv
Copy link
Contributor Author

Ping for review.

@ggerganov
Copy link
Owner

cc @0cc4m

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: MIT

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this copyright note is appropriate, as mentioned on #961.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Copy link
Collaborator

@0cc4m 0cc4m left a comment

Choose a reason for hiding this comment

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

This works well on Linux. I can't test it on Windows, but I assume it should be fine?

@MaggotHATE you tested it on Windows, right?

@jeffbolznv
Copy link
Contributor Author

I do most of my development on Windows, it works well there.

@MaggotHATE
Copy link

you tested it on Windows, right?

Yes, I did, although I use w64devkit, if that's important. I don't have MSVS installed to test there.

Comment on lines 614 to 615
std::mutex compile_count_mutex;
std::condition_variable compile_count_cond;
Copy link
Owner

Choose a reason for hiding this comment

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

These should be also static?

Also, do these have to be global and not per-device?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since they define a thread amount limit based on the CPU, I think it's correct that they are global.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed them to static and left them global.

@ggerganov ggerganov merged commit cdb2002 into ggerganov:master Sep 29, 2024
4 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.

4 participants