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

Where is the definition or addition location of GGML_USE_HYBRID_THREADING? #172

Open
wfloveiu opened this issue Mar 25, 2024 · 2 comments
Open
Labels
question Further information is requested

Comments

@wfloveiu
Copy link

Where is the definition or addition location of GGML_USE_HYBRID_THREADING?

In the int ggml_graph_compute(struct ggml_cgraph * cgraph, struct ggml_cplan * cplan) function in the ggml.c file

#ifdef GGML_USE_HYBRID_THREADING
    int compute_status = (size_t) ggml_graph_compute_thread_hybrid(&workers[0]);
#else
    int compute_status = (size_t) ggml_graph_compute_thread(&workers[0]);
#endif

I see that the ggml_graph_compute_thread_hybrid function is added by you (I think this may be an importance function for PowerInfer), but my global search did not find the addition of GGML_USE_HYBRID_THREADING.

@wfloveiu wfloveiu added the question Further information is requested label Mar 25, 2024
@hodlen
Copy link
Collaborator

hodlen commented Apr 6, 2024

The GGML_USE_HYBRID_THREADING flag acts as a switch to decide if all GPU computation nodes should be exclusively assigned to a single specific CPU worker. By default, this feature is not active, hence you won't find its definition within the source code. If you wish to activate this feature, it can be enabled through the definition in CMake's CXXFLAGS and CFLAGS as follows:

cmake -S . -B build -DCMAKE_CXXFLAGS="-DGGML_USE_HYBRID_THREADING" -DCMAKE_CFLAGS="-DGGML_USE_HYBRID_THREADING"

@wfloveiu
Copy link
Author

wfloveiu commented Apr 8, 2024

Thank you for your answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants