Skip to content

Feature Request: Hardware support check #8019

@mdegans

Description

@mdegans

Prerequisites

  • I am running the latest code. Mention the version if possible as well.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • I reviewed the Discussions, and have a new and useful enhancement to share.

Feature Description

Add a way to check if a model is supported on a given hardware backend.

Motivation

Currently, when an unsupported quantization is encountered, at least on Metal, asserts fire, leading to a crash. At least on my machine, called from a Rust GUI frontend, this manages to lock up the whole machine. Finder is unresponsive. Can't force quit. A cold reboot is actually necessary.

I don't believe there's a way to catch the assert so I'm looking a way to check for support and fail gracefully in such cases.

Possible Implementation

Here I'd be looking for advice but my initial thoughts would be to use the existing ggml_supports functions to check if the model's tensors are supported.

I see llama_model has some ggml_tensor and a std::vector of llama_layer also containing tensors. I figure there may be more to it than that, so I'd need guidance here.

The function might return a bool if the model is supported or some status code.

Alternatively, what would solve my immediate issue is for ggml_metal_graph_compute to return an error code in the cases where a model is unsupported. I see it already returns a ggml_status where GGML_STATUS_FAILED indicates failure. I'm assuming there's a good reason this behavior isn't already the case.

I'd be happy to work on and contribute such a feature if it would be of use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions