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

llama : use ggml_backend_dev_get_extra_bufts #10228

Closed

Conversation

danbev
Copy link
Collaborator

@danbev danbev commented Nov 9, 2024

This commit updates the name argument for the ggml_backend_reg_get_proc_address function call in make_cpu_buft_list to be ggml_backend_dev_get_extra_bufts instead of ggml_backend_cpu_get_extra_bufts.

The motivation for this change is that in ggml_backend_cpu_get_proc_address, the name parameter is matched against ggml_backend_dev_get_extra_bufts and not ggml_backend_cpu_get_extra_bufts:

static void * ggml_backend_cpu_get_proc_address(ggml_backend_reg_t reg,
    const char * name) {
    if (strcmp(name, "ggml_backend_set_n_threads") == 0) {
        return (void *)ggml_backend_cpu_set_n_threads;
    }
    if (strcmp(name, "ggml_backend_dev_get_extra_bufts") == 0) {
        return (void *)ggml_backend_cpu_get_extra_bufts;
    }

    return NULL;

    GGML_UNUSED(reg);
}

This commit updates the `name` argument for the
`ggml_backend_reg_get_proc_address` function call in
`make_cpu_buft_list` to be `ggml_backend_dev_get_extra_bufts`
instead of `ggml_backend_cpu_get_extra_bufts`.

The motivation for this change is that in
`ggml_backend_cpu_get_proc_address`, the `name` parameter is matched against
`ggml_backend_dev_get_extra_bufts` and not
`ggml_backend_cpu_get_extra_bufts`:
```c++
static void * ggml_backend_cpu_get_proc_address(ggml_backend_reg_t reg,
    const char * name) {
    if (strcmp(name, "ggml_backend_set_n_threads") == 0) {
        return (void *)ggml_backend_cpu_set_n_threads;
    }
    if (strcmp(name, "ggml_backend_dev_get_extra_bufts") == 0) {
        return (void *)ggml_backend_cpu_get_extra_bufts;
    }

    return NULL;

    GGML_UNUSED(reg);
}
```
@slaren
Copy link
Collaborator

slaren commented Nov 14, 2024

This is already fixed in #9921.

@danbev danbev closed this Nov 14, 2024
@danbev danbev deleted the ggml_backend_dev_get_extra_bufts branch January 30, 2025 05:01
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.

2 participants