Skip to content

[ML] Revert #2991 and #2936#2995

Merged
valeriy42 merged 3 commits intoelastic:mainfrom
valeriy42:revert-pytorch-hardening
Mar 13, 2026
Merged

[ML] Revert #2991 and #2936#2995
valeriy42 merged 3 commits intoelastic:mainfrom
valeriy42:revert-pytorch-hardening

Conversation

@valeriy42
Copy link
Contributor

A change in PyTorch inference caused a large number of tests to fail. We need to figure out what's gone wrong.

@prodsecmachine
Copy link

prodsecmachine commented Mar 13, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@valeriy42 valeriy42 added the ci:run-qa-tests Run a subset of the QA tests label Mar 13, 2026
@valeriy42
Copy link
Contributor Author

buildkite run_qa_tests

@valeriy42 valeriy42 merged commit 4f1ec3e into elastic:main Mar 13, 2026
17 checks passed
edsavage added a commit to edsavage/ml-cpp that referenced this pull request Mar 15, 2026
edsavage added a commit that referenced this pull request Mar 19, 2026
…#2999)

Re-applies #2936 and #2991 which were reverted in #2995.

  -  Adds a static TorchScript graph validation layer (CModelGraphValidator, CSupportedOperations) that rejects models containing operations not observed in supported transformer architectures, reducing the attack surface by ensuring only known-safe operation sets are permitted.
   - Includes aten::mul_ and quantized::linear_dynamic in the allowed operations for dynamically quantized models (e.g. ELSER v2 imported via Eland).
   - Adds Python extraction tooling (dev-tools/extract_model_ops/) to trace reference HuggingFace models and collect their op sets, with support for quantized variants.
   - Adds reference_model_ops.json golden file and C++ drift test to detect allowlist staleness on PyTorch upgrades.
   - Adds adversarial "evil model" integration tests to verify rejection of forbidden operations.
   - Adds CHANGELOG entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants