[ML] Reapply: Harden pytorch_inference with TorchScript model graph validation#3008
Merged
edsavage merged 5 commits intoelastic:mainfrom Mar 24, 2026
Merged
[ML] Reapply: Harden pytorch_inference with TorchScript model graph validation#3008edsavage merged 5 commits intoelastic:mainfrom
edsavage merged 5 commits intoelastic:mainfrom
Conversation
…alidation (elastic#2999)" (elastic#3006) This reverts commit ceabc9b.
✅ 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. |
The prepacked .multilingual-e5-small model uses aten::norm for normalization, which was not in the allowlist. This caused the model to be rejected with "Unrecognised operations: aten::norm". Made-with: Cursor
Extracted ops from intfloat/multilingual-e5-small (base and Eland text_embedding variant) and added both to the reference golden file. The base model uses standard XLM-RoBERTa ops. The Eland variant adds pooling/normalization ops (linalg_vector_norm, clamp, etc.). The prepacked .multilingual-e5-small model bundled with Elasticsearch uses aten::norm (added to the allowlist in the previous commit). Made-with: Cursor
The prepacked .multilingual-e5-small model uses aten::norm, which was missing from the allowlist and caused production failures. This test loads a tiny (24KB) model that mirrors the real prepacked model's graph structure (including aten::norm) and verifies graph validation passes. The test model was created by tracing a minimal XLM-RoBERTa-like architecture with normalization, then patching the TorchScript IR to use aten::norm (which modern PyTorch decomposes into aten::linalg_vector_norm, so it can't be generated via tracing). Made-with: Cursor
Made-with: Cursor
Contributor
Author
|
buildkite run_qa_tests |
Contributor
|
buildkite test this |
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.
Summary
Made with Cursor