-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[CANN] Adapt to dynamically loadable backends mechanism #9970
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -561,6 +561,10 @@ void * ggml_backend_reg_get_proc_address(ggml_backend_reg_t reg, const char * na | |
# include "ggml-amx.h" | ||
#endif | ||
|
||
#ifdef GGML_USE_CANN | ||
#include "ggml-cann.h" | ||
#endif | ||
|
||
struct ggml_backend_registry { | ||
std::vector<ggml_backend_reg_t> backends; | ||
std::vector<ggml_backend_dev_t> devices; | ||
|
@@ -584,11 +588,15 @@ struct ggml_backend_registry { | |
#ifdef GGML_USE_RPC | ||
register_backend(ggml_backend_rpc_reg()); | ||
#endif | ||
|
||
#ifdef GGML_USE_AMX | ||
register_backend(ggml_backend_amx_reg()); | ||
#endif | ||
|
||
// TODO: kompute, cann | ||
#ifdef GGML_USE_CANN | ||
register_backend(ggml_backend_cann_reg()); | ||
#endif | ||
|
||
// TODO: kompute | ||
|
||
register_backend(ggml_backend_cpu_reg()); | ||
} | ||
|
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 suspect that this macro was taken from the implementation in the CUDA backend, but the reason it exists there is because the same code is used to build the ROCm and MUSA backends, so the name of the backend may change depending on the build flags, but I don't think this is necessary in the CANN backend.
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.
Thanks for your review, this macro is no longer exposed to llama. I have moved this macro to the cann implementation file.