[EXPERIMENT][WIP][OpenVINO] Add support for Nomic Bert - #1864
Draft
mlukasze wants to merge 3 commits into
Draft
Conversation
- Register NomicBertOpenVINOConfig as a one-line subclass of BertOpenVINOConfig in optimum/exporters/openvino/model_configs.py, matching the existing pattern used by sibling BERT-family models (Albert, ConvBert, Electra, RoFormer, SqueezeBert, MobileBert, RemBert). - Add nomic_bert to OVModelForFeatureExtractionIntegrationTest.SUPPORTED_ARCHITECTURES in tests/openvino/test_modeling.py. - Add nomic_bert tiny-model registry entry in tests/openvino/utils_tests.py. - Add Nomic Bert docs row in docs/source/openvino/models.mdx. Verified against the real nomic-ai/nomic-embed-text-v1.5 checkpoint: export via optimum-cli produces a single-file openvino_model.xml/.bin, OVModelForFeatureExtraction inference passes for both PyTorch and NumPy inputs, and a locally-built tiny native-transformers nomic_bert model produces OV output matching the HF baseline (torch.allclose, atol=1e-4). No ModelPatcher needed - tracing succeeds cleanly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
The earlier 'Apply black formatting' commit used a newer black version than CI's pinned black~=23.1, which removed a blank line after the import block in both files. This confused ruff==0.4.4's isort check (I001). Restored via 'ruff check --fix', verified clean against the exact CI-pinned tool versions (black~=23.1, ruff==0.4.4). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
omega-intel
added a commit
to mlukasze/openvino.genai
that referenced
this pull request
Jul 13, 2026
The new test_nomic_bert_text_embedding_pipeline_matches_hf test depends on NomicBertOpenVINOConfig support in optimum-intel, which is only available in an unmerged draft PR (huggingface/optimum-intel#1864). CI here installs a stock optimum-intel release from PyPI that does not yet recognize the nomic_bert architecture, causing a fixture-setup error (not a real bug in this repo). Catch the specific 'unsupported architecture' ValueError in the fixture and skip cleanly with a message pointing at the blocking PR, following the same pattern as other known-issue markers in this file (pytest.mark.xfail with a ticket reference). The test will start running for real once optimum-intel releases nomic_bert support. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Known blocker requiring human action before merge: the Hub-hosted tiny test fixture
optimum-intel-internal-testing/tiny-random-nomic-bertreferenced in the newutils_tests.pyentry does not exist yet. A creation script (create_tiny_nomic_bert.py) has been generated and needs a maintainer with write access to theoptimum-intel-internal-testingorg to run it and upload the result before the new CI test can pass end-to-end on the Hub-hosted path. The new tests were independently verified passing (2 passed) against an equivalent local tiny native-transformersnomic_bertmodel in this session (substitution reverted before commit; committed diff still points to the pending Hub path).What does this PR do?
Adds OpenVINO export and inference support for
nomic_bert(NomicBertOpenVINOConfig), enablingnomic-ai/nomic-embed-text-v1.5and other native-transformersnomic_bertarchitecture models.NomicBertOpenVINOConfigas a one-line subclass ofBertOpenVINOConfiginoptimum/exporters/openvino/model_configs.py, following the same minimal pattern used by sibling BERT-family models (Albert, ConvBert, Electra, RoFormer, SqueezeBert, MobileBert, RemBert). No customModelPatcheris required; real-model tracing succeeds cleanly."nomic_bert"toOVModelForFeatureExtractionIntegrationTest.SUPPORTED_ARCHITECTURESintests/openvino/test_modeling.py.tests/openvino/utils_tests.py.Nomic Bertrow todocs/source/openvino/models.mdx.Verified with a real end-to-end export of
nomic-ai/nomic-embed-text-v1.5viaoptimum-cli(single-fileopenvino_model.xml/.binlayout, no fatal warnings) andOVModelForFeatureExtractioninference matching expected shape/dtype for both PyTorch and NumPy inputs. WWB accuracy validation passed on both CPU (0.9999992) and GPU (0.9999988).Installation instructions
Exporting cmd-line
optimum-cli export openvino --model nomic-ai/nomic-embed-text-v1.5 --task feature-extraction ov_modelInference script
Before submitting