[ML] Add EuroBERT/Jina v5 ops and fix graph validator tests#3016
Closed
edsavage wants to merge 2 commits intoelastic:mainfrom
Closed
[ML] Add EuroBERT/Jina v5 ops and fix graph validator tests#3016edsavage wants to merge 2 commits intoelastic:mainfrom
edsavage wants to merge 2 commits intoelastic:mainfrom
Conversation
Jina Embeddings v5 is based on EuroBERT, which uses a different architecture from the BERT family: - RoPE (rotary position embeddings) → aten::sin, aten::cos - RMSNorm (instead of LayerNorm) → aten::rsqrt - SiLU activation (instead of GELU) → aten::silu Required for Eland PR elastic/eland#818 which adds support for importing Jina v5 models into Elasticsearch. Made-with: Cursor
aten::sin and aten::cos are now in the allowlist (needed by EuroBERT/Jina v5 for rotary position embeddings), so tests that used them as example "unrecognised" ops now fail. - Replace torch.sin with torch.logit in synthetic test modules - Update malicious model tests to check for ops that remain unrecognised (aten::tan, aten::exp) rather than sin/cos Made-with: Cursor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Closes #2890
Summary
Adds 4 ops required by the Jina Embeddings v5 model architecture (EuroBERT + LoRA adapters):
aten::sinaten::cosaten::rsqrtaten::siluAlso fixes graph validator tests that used
aten::sinas the canonical "unrecognised op" example — sincesinis now in the allowlist, these tests were failing:torch.sinwithtorch.logitaten::tan/aten::exp(still unrecognised) instead ofsin/cosOps verified by tracing
jinaai/jina-embeddings-v5-text-nanowith merged LoRA retrieval adapter locally.Cross-repo dependencies
byte_level_bpetokenization type + BPEmergesvocabulary format support (TBD)Test plan
Made with Cursor