Skip to content

ggml-openvino : make op support a property of the registry - #307

Draft
cavusmustafa wants to merge 1 commit into
ravi9:dev_backend_openvinofrom
cavusmustafa:ov-supports-op-robust
Draft

ggml-openvino : make op support a property of the registry#307
cavusmustafa wants to merge 1 commit into
ravi9:dev_backend_openvinofrom
cavusmustafa:ov-supports-op-robust

Conversation

@cavusmustafa

@cavusmustafa cavusmustafa commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Created this PR as an initial draft for suports_op changes. CIs and supported models should be tested. Below is the AI generated description:

supports_op() could accept a node the backend then failed to translate. The conditions lived in a switch in ggml-openvino.cpp that 19 of the 54 registered ops never reached, so those ops were accepted unchecked and failed later inside the translator - ARGSORT on an unknown sort order, TRI on an out-of-range triangle type, PAD on an empty input.

Move the per-op conditions into openvino/op_support.{h,cpp} and give every registry entry a support rule beside its translator:

struct OpEntry {
    CreatorFunction  translate;
    SupportsFunction supports;
    OpEntry(CreatorFunction, SupportsFunction);   // both required
};

The constructor is deliberate. Without it OpEntry is an aggregate and {translate_foo} compiles with supports silently null, which would defeat the only guarantee the type exists to provide. A registry entry now cannot be added without stating when the op may be used, and that is checked by the compiler rather than by review.

The 20 case groups of is_op_supported_case() are migrated unchanged, so behaviour is identical: test-backend-ops -b OPENVINO0 gives 3386/3386, 17783 not supported, 0 FAIL, exit 0, matching the base exactly. New rules for ARGSORT, PAD and TRI turn three translator throws into gate declines.

Two categories in op_support.cpp are marked for reviewers because they are not statements about what an op means: declines that depend on the device name, which work around specific plugin defects and should be deleted when those are fixed, and declines keyed on a tensor name or an exact test shape.

Also: ggml-openvino.cpp loses 427 lines and gains 36; the empty ops_not_support_view_input set was dead code and is removed.

Note GGML_OP_SSM_CONV's rule has its "return true" commented out, so its stated intent of keeping the op on CPU is not implemented. Migrated as-is rather than changed.

Assisted-by: Claude Opus 5

@ravi9
ravi9 force-pushed the dev_backend_openvino branch 2 times, most recently from fd9bc04 to 33237ab Compare September 3, 2026 21:10
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.

1 participant