Agent Skill: Add New Operation to OpenVINO Frontend
Goal
Enable a new operation in an OpenVINO Frontend (FE) pipeline — translator creation, registration, conversion validation, and tests.
Framework-Specific Workflows
Each frontend has its own detailed workflow. Read the one matching the target framework:
| Frontend |
Skill file |
What it covers |
| PyTorch |
pytorch.md |
NodeContext API, op_table.cpp registration (TorchScript + FX/Export), translate_1to1_match_* wrappers, Python layer tests, Mark operations |
| ONNX |
onnx.md |
ov::frontend::onnx::Node API, ONNX_OP macro registration with OPSET_SINCE/OPSET_RANGE, .prototxt test models, C++ GTest cases, normalize-step transformations |
Related Skills (investigation & debugging)
Notes
- Keep this skill instruction-only in markdown.
Instruction Workflow (TensorFlow and generic fallback)
The following sections apply to frontends not covered by the framework-specific files above (e.g., TensorFlow), or as a general reference when no framework-specific skill is available.
1) Check current support state
- Verify whether translator file already exists.
- Verify whether op is already registered in frontend mapping table.
- If both exist and conversion is known to pass, skip scaffolding.
- If only partial state exists, repair only missing parts.
2) Add translator logic
- Preferred path: emit real OV conversion logic when the operation maps to an OpenVINO op or a set of operations that will provide reasonable performance.
- If the same operation already exists in another frontend, extract/reuse common translation logic instead of duplicating it.
- For simple 1:1 ops, prefer existing helper translation patterns/utilities already used in FE codebase.
- Fallback path: emit safe placeholder translator only when real mapping is unavailable.
- Never claim full support when fallback translator is used.
3) Register operation in frontend tables
- PyTorch:
- Add converter declaration in op table.
- Add TorchScript key registration (for example
aten::op).
- Add FX key registration (for example
aten.op.default).
- TensorFlow:
- For supported unary ops, prefer generic unary registration path.
- For unsupported cases, register dedicated translator function.
- ONNX:
- Ensure
ONNX_OP macro registration exists in translator file.
4) Add tests
- Add frontend smoke test file under
tests/frontend (not available for PyTorch).
- Add framework layer test under
tests/layer_tests where supported.
- Ensure test naming follows existing suite conventions.
5) Build prerequisites for validation
- Ensure frontend changes are available to runtime before conversion checks.
- Build frontend targets from source or use an existing OpenVINO build/package that already includes your FE changes.
- If neither is true, do not report conversion status as passed; mark validation as blocked.
6) Validate conversion and finalize
- run conversion check from generated model.
- if automated validation is unavailable, mark as skipped with explicit reason.
- Confirm no duplicate registrations are introduced.
- Confirm rerun is idempotent.
- Report one of three states: fully enabled, partially repaired, or scaffolded with fallback.
Translation Recommendations
Prefer runtime shape computation over conversion-time shape extraction.
- Use
ShapeOf-based graph logic for shape-dependent behavior.
- Avoid relying on
get_shape() / fully static shape reads during FE conversion.
get_partial_shape() is acceptable for compile-time rank-only decisions.
Handle data types according to framework semantics.
- If PyTorch op behavior allows mixed input types, preserve this in translation.
- Do not over-constrain translators to a single dtype when mixed-type execution is valid.
Avoid constants tied to compile-time element type queries.
- Do not create
Constant values from get_element_type() when type can be dynamic at conversion time.
- Prefer runtime type-safe construction paths that remain valid for dynamic element types.
Notes
- Keep this skill instruction-only in markdown.
- Prefer minimal, root-cause updates over broad refactors.
- Do not mark operation as supported unless FE conversion produces OV graph nodes (not framework fallback nodes).
1---2name: add-fe-op3description: Adds a new operation to OpenVINO Frontend pipelines with translator updates, registration, and tests.4---56# Agent Skill: Add New Operation to OpenVINO Frontend78## Goal9Enable a new operation in an OpenVINO Frontend (FE) pipeline — translator creation, registration, conversion validation, and tests.1011## Framework-Specific Workflows1213Each frontend has its own detailed workflow. Read the one matching the target framework:1415| Frontend | Skill file | What it covers |16|---|---|---|17| **PyTorch** | [pytorch.md](pytorch.md) | NodeContext API, `op_table.cpp` registration (TorchScript + FX/Export), `translate_1to1_match_*` wrappers, Python layer tests, Mark operations |18| **ONNX** | [onnx.md](onnx.md) | `ov::frontend::onnx::Node` API, `ONNX_OP` macro registration with `OPSET_SINCE`/`OPSET_RANGE`, `.prototxt` test models, C++ GTest cases, normalize-step transformations |1920## Related Skills (investigation & debugging)2122| Frontend | Skill file | When to use |23|---|---|---|24| ONNX | [conversion-issues/onnx.md](../conversion-issues/onnx.md) | Conversion failures, accuracy bugs, shape/type mismatches, opset version gaps |25| PyTorch | [conversion-issues/pytorch.md](../conversion-issues/pytorch.md) | Conversion failures, accuracy bugs, tracing mode issues, normalize-step failures |2627## Notes2829- Keep this skill instruction-only in markdown.3031---3233## Instruction Workflow (TensorFlow and generic fallback)3435The following sections apply to frontends **not** covered by the framework-specific files above (e.g., TensorFlow), or as a general reference when no framework-specific skill is available.3637### 1) Check current support state38- Verify whether translator file already exists.39- Verify whether op is already registered in frontend mapping table.40- If both exist and conversion is known to pass, skip scaffolding.41- If only partial state exists, repair only missing parts.4243### 2) Add translator logic44- Preferred path: emit real OV conversion logic when the operation maps to an OpenVINO op or a set of operations that will provide reasonable performance.45- If the same operation already exists in another frontend, extract/reuse common translation logic instead of duplicating it.46- For simple 1:1 ops, prefer existing helper translation patterns/utilities already used in FE codebase.47- Fallback path: emit safe placeholder translator only when real mapping is unavailable.48- Never claim full support when fallback translator is used.4950### 3) Register operation in frontend tables51- PyTorch:52 - Add converter declaration in op table.53 - Add TorchScript key registration (for example `aten::op`).54 - Add FX key registration (for example `aten.op.default`).55- TensorFlow:56 - For supported unary ops, prefer generic unary registration path.57 - For unsupported cases, register dedicated translator function.58- ONNX:59 - Ensure `ONNX_OP` macro registration exists in translator file.6061### 4) Add tests62- Add frontend smoke test file under `tests/frontend` (not available for PyTorch). 63- Add framework layer test under `tests/layer_tests` where supported.64- Ensure test naming follows existing suite conventions.6566### 5) Build prerequisites for validation67- Ensure frontend changes are available to runtime before conversion checks.68- Build frontend targets from source or use an existing OpenVINO build/package that already includes your FE changes.69- If neither is true, do not report conversion status as passed; mark validation as blocked.7071### 6) Validate conversion and finalize72- run conversion check from generated <frontend> model.73- if automated validation is unavailable, mark as skipped with explicit reason.74- Confirm no duplicate registrations are introduced.75- Confirm rerun is idempotent.76- Report one of three states: fully enabled, partially repaired, or scaffolded with fallback.7778## Translation Recommendations7980- Prefer runtime shape computation over conversion-time shape extraction.81 - Use `ShapeOf`-based graph logic for shape-dependent behavior.82 - Avoid relying on `get_shape()` / fully static shape reads during FE conversion.83 - `get_partial_shape()` is acceptable for compile-time rank-only decisions.8485- Handle data types according to framework semantics.86 - If PyTorch op behavior allows mixed input types, preserve this in translation.87 - Do not over-constrain translators to a single dtype when mixed-type execution is valid.8889- Avoid constants tied to compile-time element type queries.90 - Do not create `Constant` values from `get_element_type()` when type can be dynamic at conversion time.91 - Prefer runtime type-safe construction paths that remain valid for dynamic element types.9293## Notes9495- Keep this skill instruction-only in markdown.96- Prefer minimal, root-cause updates over broad refactors.97- Do not mark operation as supported unless FE conversion produces OV graph nodes (not framework fallback nodes).